Skip to content

Commit

Permalink
Further Updates to Toolbox and Panel
Browse files Browse the repository at this point in the history
Added suggestions from Hoikas
  • Loading branch information
DoobesURU committed Aug 20, 2021
1 parent 746e286 commit 9fbbe1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions korman/operators/op_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def execute(self, context):


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_description = "Toggles all materials to be double sided"

Expand All @@ -188,7 +188,7 @@ def execute(self, context):


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_description = "Toggles selected meshes' material(s) double sided value"

Expand All @@ -197,7 +197,7 @@ def poll(cls, context):
return super().poll(context) and hasattr(bpy.context, "selected_objects")

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))
for mat in mat_list:
mat.plasma_mat.plasma_double_sided = enable
Expand Down
2 changes: 1 addition & 1 deletion korman/properties/prop_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .. import idprops

class PlasmaMaterial(bpy.types.PropertyGroup):
bl_idname = "mat.plasma_mat"
bl_idname = "material.plasma_material"

plasma_double_sided = BoolProperty(name="Double Sided",
description="Sets this material as double sided (formerly TWOSIDE)",
Expand Down
4 changes: 2 additions & 2 deletions korman/ui/ui_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class PlasmaMaterialPanel(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Plasma Material Options"

def draw(self, context):
mat, slot = context.material, getattr(context, "material_slot", None)
mat_props = mat.plasma_mat
mat = context.material
mat_props = mat.plasma_material
layout = self.layout

split = layout.split()
Expand Down

0 comments on commit 9fbbe1b

Please sign in to comment.