Browse Source

Fix op_toolbox.py ordering

pull/67/head
Adam Johnson 7 years ago
parent
commit
b6b065e253
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 39
      korman/operators/op_toolbox.py

39
korman/operators/op_toolbox.py

@ -21,6 +21,26 @@ class ToolboxOperator:
return context.scene.render.engine == "PLASMA_GAME" return context.scene.render.engine == "PLASMA_GAME"
class PlasmaConvertLayerOpacitiesOperator(ToolboxOperator, bpy.types.Operator):
bl_idname = "texture.plasma_convert_layer_opacities"
bl_label = "Convert Layer Opacities"
bl_description = "Convert layer opacities from diffuse color factor"
def execute(self, context):
for mesh in bpy.data.meshes:
for material in mesh.materials:
if material is None:
continue
for slot in material.texture_slots:
if slot is None:
continue
slot.texture.plasma_layer.opacity = slot.diffuse_color_factor * 100
slot.diffuse_color_factor = 1.0
return {"FINISHED"}
class PlasmaEnablePlasmaObjectOperator(ToolboxOperator, bpy.types.Operator): class PlasmaEnablePlasmaObjectOperator(ToolboxOperator, bpy.types.Operator):
bl_idname = "object.plasma_enable_all_objects" bl_idname = "object.plasma_enable_all_objects"
bl_label = "Plasma Objects" bl_label = "Plasma Objects"
@ -48,22 +68,3 @@ class PlasmaEnableTexturesOperator(ToolboxOperator, bpy.types.Operator):
continue continue
slot.use = True slot.use = True
return {"FINISHED"} return {"FINISHED"}
class PlasmaConvertLayerOpacitiesOperator(ToolboxOperator, bpy.types.Operator):
bl_idname = "texture.plasma_convert_layer_opacities"
bl_label = "Layer Opacities"
bl_description = "Convert layer opacities from diffuse color factor"
def execute(self, context):
for mesh in bpy.data.meshes:
for material in mesh.materials:
if material is None:
continue
for slot in material.texture_slots:
if slot is None:
continue
slot.texture.plasma_layer.opacity = slot.diffuse_color_factor * 100
slot.diffuse_color_factor = 1.0
return {"FINISHED"}

Loading…
Cancel
Save