Browse Source

Further Updates to Toolbox and Panel

Added suggestions from Hoikas
pull/280/head
Patrick Dulebohn 3 years ago
parent
commit
0bdd42204e
  1. 2
      korman/exporter/material.py
  2. 6
      korman/operators/op_toolbox.py
  3. 4
      korman/properties/prop_material.py
  4. 6
      korman/ui/ui_material.py

2
korman/exporter/material.py

@ -1401,7 +1401,7 @@ class MaterialConverter:
state = layer.state state = layer.state
is_waveset = bo.plasma_modifiers.water_basic.enabled is_waveset = bo.plasma_modifiers.water_basic.enabled
if bm.plasma_material.plasma_double_sided: if bm.plasma_material.double_sided:
if is_waveset: if is_waveset:
self._report.warn("FORCING single sided--this is a waveset (are you insane?)") self._report.warn("FORCING single sided--this is a waveset (are you insane?)")
else: else:

6
korman/operators/op_toolbox.py

@ -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

4
korman/properties/prop_material.py

@ -19,9 +19,9 @@ from bpy.props import *
from .. import idprops from .. import idprops
class PlasmaMaterial(bpy.types.PropertyGroup): class PlasmaMaterial(bpy.types.PropertyGroup):
bl_idname = "mat.plasma_mat" bl_idname = "material.plasma_material"
plasma_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)

6
korman/ui/ui_material.py

@ -31,12 +31,12 @@ class PlasmaMaterialPanel(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Plasma Material Options" bl_label = "Plasma Material Options"
def draw(self, context): def draw(self, context):
mat, slot = context.material, getattr(context, "material_slot", None) mat = context.material
mat_props = mat.plasma_mat mat_props = mat.plasma_material
layout = self.layout layout = self.layout
split = layout.split() split = layout.split()
col = split.column() col = split.column()
sub = col.column() sub = col.column()
col.prop(mat_props, "plasma_double_sided") col.prop(mat_props, "double_sided")

Loading…
Cancel
Save