Browse Source

Apply suggestions from Hoikas' code review

Puts in suggestions from Hoikas.

Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
pull/280/head
Patrick Dulebohn 3 years ago committed by Patrick Dulebohn
parent
commit
37229c9117
  1. 6
      korman/operators/op_toolbox.py
  2. 4
      korman/properties/prop_material.py

6
korman/operators/op_toolbox.py

@ -183,7 +183,7 @@ class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator):
def execute(self, context): def execute(self, context):
enable = self.enable enable = self.enable
for mat in bpy.data.materials: for mat in bpy.data.materials:
mat.plasma_mat.plasma_double_sided = enable mat.plasma_material.double_sided = enable
return {"FINISHED"} return {"FINISHED"}
@ -198,9 +198,9 @@ class PlasmaToggleDoubleSidedSelectOperator(ToolboxOperator, bpy.types.Operator)
def execute(self, context): def execute(self, context):
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] 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_material.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_material.double_sided = enable
return {"FINISHED"} return {"FINISHED"}

4
korman/properties/prop_material.py

@ -22,6 +22,6 @@ class PlasmaMaterial(bpy.types.PropertyGroup):
bl_idname = "material.plasma_material" bl_idname = "material.plasma_material"
double_sided = BoolProperty(name="Double Sided", double_sided = BoolProperty(name="Double Sided",
description="Sets this material as double sided (formerly TWOSIDE)", description="Sets this material as double sided (formerly TWOSIDE)",
default=False) default=False)

Loading…
Cancel
Save