Browse Source

Add new Plasma Material properties and UI

Start of Plasma Material Panel additions
pull/280/head
Patrick Dulebohn 3 years ago
parent
commit
53c5073749
  1. 2
      korman/exporter/material.py
  2. 2
      korman/properties/__init__.py
  3. 28
      korman/properties/prop_material.py
  4. 1
      korman/ui/__init__.py
  5. 38
      korman/ui/ui_material.py

2
korman/exporter/material.py

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

2
korman/properties/__init__.py

@ -19,6 +19,7 @@ from .prop_anim import *
from .prop_camera import *
from .prop_image import *
from .prop_lamp import *
from .prop_material import *
from . import modifiers
from .prop_object import *
from .prop_scene import *
@ -32,6 +33,7 @@ def register():
bpy.types.Camera.plasma_camera = bpy.props.PointerProperty(type=PlasmaCamera)
bpy.types.Image.plasma_image = bpy.props.PointerProperty(type=PlasmaImage)
bpy.types.Lamp.plasma_lamp = bpy.props.PointerProperty(type=PlasmaLamp)
byp.types.Material.plasma_material = bpy.Props.PointerProperty(type=PlasmaMaterial)
bpy.types.Object.plasma_net = bpy.props.PointerProperty(type=PlasmaNet)
bpy.types.Object.plasma_object = bpy.props.PointerProperty(type=PlasmaObject)
bpy.types.Scene.plasma_scene = bpy.props.PointerProperty(type=PlasmaScene)

28
korman/properties/prop_material.py

@ -0,0 +1,28 @@
# This file is part of Korman.
#
# Korman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Korman is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Korman. If not, see <http://www.gnu.org/licenses/>.
import bpy
from bpy.props import *
from .. import idprops
class PlasmaMaterial(bpy.types.PropertyGroup):
bl_name = "material.plasma_material"
plasma_double_sided = BoolProperty(name="Double Sided",
description="Sets this material as double sided (formerly TWOSIDE)",
default=False)

1
korman/ui/__init__.py

@ -18,6 +18,7 @@ from .ui_camera import *
from .ui_image import *
from .ui_lamp import *
from .ui_list import *
from .ui_material import *
from .ui_menus import *
from .ui_modifiers import *
from .ui_object import *

38
korman/ui/ui_material.py

@ -0,0 +1,38 @@
# This file is part of Korman.
#
# Korman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Korman is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Korman. If not, see <http://www.gnu.org/licenses/>.
import bpy
from . import ui_list
class MaterialButtonsPanel:
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
class PlasmaMaterialPanel(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Plasma Material Options"
def draw(self, context):
material = context.material, getattr(context, "material_slot", None)
mat_props = material.plasma_material
layout = self.layout
split = layout.split()
col = split.column()
sub = col.column()
col.prop(mat_props, "plasma_double_sided")
Loading…
Cancel
Save