Browse Source

Update Texture props to ID properties

pull/56/head
Adam Johnson 7 years ago
parent
commit
9f158c3726
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/exporter/material.py
  2. 14
      korman/properties/prop_texture.py
  3. 2
      korman/ui/ui_texture.py

6
korman/exporter/material.py

@ -476,11 +476,11 @@ class MaterialConverter:
# Whoever wrote this PyHSPlasma binding didn't follow the convention. Sigh.
visregions = []
for region in texture.plasma_layer.vis_regions:
rgn = bpy.data.objects.get(region.region_name, None)
rgn = region.control_region
if rgn is None:
raise ExportError("'{}': VisControl '{}' not found".format(texture.name, region.region_name))
raise ExportError("'{}': Has an invalid Visibility Control".format(texture.name))
if not rgn.plasma_modifiers.visregion.enabled:
raise ExportError("'{}': '{}' is not a VisControl".format(texture.name, region.region_name))
raise ExportError("'{}': '{}' is not a VisControl".format(texture.name, rgn.name))
visregions.append(self._mgr.find_create_key(plVisRegion, bl=rgn))
pl_env.visRegions = visregions

14
korman/properties/prop_texture.py

@ -16,10 +16,18 @@
import bpy
from bpy.props import *
class EnvMapVisRegion(bpy.types.PropertyGroup):
from .. import idprops
class EnvMapVisRegion(idprops.IDPropObjectMixin, bpy.types.PropertyGroup):
enabled = BoolProperty(default=True)
region_name = StringProperty(name="Control",
description="Object defining a Plasma Visibility Control")
control_region = PointerProperty(name="Control",
description="Object defining a Plasma Visibility Control",
type=bpy.types.Object,
poll=idprops.poll_visregion_objects)
@classmethod
def _idprop_mapping(cls):
return {"control_region": "region_name"}
class PlasmaLayer(bpy.types.PropertyGroup):

2
korman/ui/ui_texture.py

@ -52,7 +52,7 @@ class PlasmaEnvMapPanel(TextureButtonsPanel, bpy.types.Panel):
op.index = layer_props.active_region_index
rgns = layer_props.vis_regions
if layer_props.vis_regions:
layout.prop_search(rgns[layer_props.active_region_index], "region_name", bpy.data, "objects")
layout.prop(rgns[layer_props.active_region_index], "control_region")
layout.separator()
layout.prop(layer_props, "envmap_color")

Loading…
Cancel
Save