Skip to content

Commit cb5b35c

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

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

korman/exporter/material.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ def _propagate_material_settings(self, bo, bm, layer):
13011301
state = layer.state
13021302

13031303
is_waveset = bo.plasma_modifiers.water_basic.enabled
1304-
if bm.plasma_material.plasma_double_sided:
1304+
if bm.plasma_material.double_sided:
13051305
if is_waveset:
13061306
self._report.warn("FORCING single sided--this is a waveset (are you insane?)")
13071307
else:

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
from .. import idprops
2020

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

24-
plasma_double_sided = BoolProperty(name="Double Sided",
24+
double_sided = BoolProperty(name="Double Sided",
2525
description="Sets this material as double sided (formerly TWOSIDE)",
2626
default=False)
2727

korman/ui/ui_material.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ 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()
3939
col = split.column()
4040
sub = col.column()
41-
col.prop(mat_props, "plasma_double_sided")
41+
col.prop(mat_props, "double_sided")
4242

0 commit comments

Comments
 (0)