Skip to content

Commit 9fbbe1b

Browse files
committed
Further Updates to Toolbox and Panel
Added suggestions from Hoikas
1 parent 746e286 commit 9fbbe1b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

korman/operators/op_toolbox.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def execute(self, context):
174174

175175

176176
class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator):
177-
bl_idname = "mat.plasma_toggle_double_sided"
177+
bl_idname = "material.plasma_toggle_double_sided"
178178
bl_label = "Toggle All Double Sided"
179179
bl_description = "Toggles all materials to be double sided"
180180

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

189189

190190
class PlasmaToggleDoubleSidedSelectOperator(ToolboxOperator, bpy.types.Operator):
191-
bl_idname = "mat.plasma_toggle_double_sided_selected"
191+
bl_idname = "material.plasma_toggle_double_sided_selected"
192192
bl_label = "Toggle Selected Double Sided"
193193
bl_description = "Toggles selected meshes' material(s) double sided value"
194194

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

199199
def execute(self, context):
200-
mat_list = [i.data for i in context.selected_objects if i.type == "MATERIAL"]
200+
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]
201201
enable = not all((mat.plasma_mat.plasma_double_sided for mat in mat_list))
202202
for mat in mat_list:
203203
mat.plasma_mat.plasma_double_sided = enable

korman/properties/prop_material.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .. import idprops
2020

2121
class PlasmaMaterial(bpy.types.PropertyGroup):
22-
bl_idname = "mat.plasma_mat"
22+
bl_idname = "material.plasma_material"
2323

2424
plasma_double_sided = BoolProperty(name="Double Sided",
2525
description="Sets this material as double sided (formerly TWOSIDE)",

korman/ui/ui_material.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class PlasmaMaterialPanel(MaterialButtonsPanel, bpy.types.Panel):
3131
bl_label = "Plasma Material Options"
3232

3333
def draw(self, context):
34-
mat, slot = context.material, getattr(context, "material_slot", None)
35-
mat_props = mat.plasma_mat
34+
mat = context.material
35+
mat_props = mat.plasma_material
3636
layout = self.layout
3737

3838
split = layout.split()

0 commit comments

Comments
 (0)