|
|
@ -174,7 +174,7 @@ class PlasmaToggleAllPlasmaObjectsOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
bl_idname = "mat.plasma_toggle_double_sided" |
|
|
|
bl_idname = "material.plasma_toggle_double_sided" |
|
|
|
bl_label = "Toggle All Double Sided" |
|
|
|
bl_label = "Toggle All Double Sided" |
|
|
|
bl_description = "Toggles all materials to be double sided" |
|
|
|
bl_description = "Toggles all materials to be double sided" |
|
|
|
|
|
|
|
|
|
|
@ -188,7 +188,7 @@ class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PlasmaToggleDoubleSidedSelectOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
class PlasmaToggleDoubleSidedSelectOperator(ToolboxOperator, bpy.types.Operator): |
|
|
|
bl_idname = "mat.plasma_toggle_double_sided_selected" |
|
|
|
bl_idname = "material.plasma_toggle_double_sided_selected" |
|
|
|
bl_label = "Toggle Selected Double Sided" |
|
|
|
bl_label = "Toggle Selected Double Sided" |
|
|
|
bl_description = "Toggles selected meshes' material(s) double sided value" |
|
|
|
bl_description = "Toggles selected meshes' material(s) double sided value" |
|
|
|
|
|
|
|
|
|
|
@ -197,7 +197,7 @@ class PlasmaToggleDoubleSidedSelectOperator(ToolboxOperator, bpy.types.Operator) |
|
|
|
return super().poll(context) and hasattr(bpy.context, "selected_objects") |
|
|
|
return super().poll(context) and hasattr(bpy.context, "selected_objects") |
|
|
|
|
|
|
|
|
|
|
|
def execute(self, context): |
|
|
|
def execute(self, context): |
|
|
|
mat_list = [i.data for i in context.selected_objects if i.type == "MATERIAL"] |
|
|
|
mat_list = [slot.material for slot in itertools.chain.from_iterable((i.material_slots for i in context.selected_objects)) if slot and slot.material] |
|
|
|
enable = not all((mat.plasma_mat.plasma_double_sided for mat in mat_list)) |
|
|
|
enable = not all((mat.plasma_mat.plasma_double_sided for mat in mat_list)) |
|
|
|
for mat in mat_list: |
|
|
|
for mat in mat_list: |
|
|
|
mat.plasma_mat.plasma_double_sided = enable |
|
|
|
mat.plasma_mat.plasma_double_sided = enable |
|
|
|