Browse Source

Fix issue with toolbox operators clobbering page settings.

This happens in ZLZ-imported Ages, probably due to object name
collisions from multiple pages.
pull/197/head
Adam Johnson 4 years ago
parent
commit
79f81fc63a
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 10
      korman/properties/prop_object.py

10
korman/properties/prop_object.py

@ -19,13 +19,11 @@ from PyHSPlasma import *
class PlasmaObject(bpy.types.PropertyGroup): class PlasmaObject(bpy.types.PropertyGroup):
def _enabled(self, context): def _enabled(self, context):
# This makes me sad if not self.is_property_set("page"):
if not self.is_inited:
self._init(context) self._init(context)
self.is_inited = True
def _init(self, context): def _init(self, context):
o = context.object o = self.id_data
age = context.scene.world.plasma_age age = context.scene.world.plasma_age
# We want to encourage the pages = layers paradigm. # We want to encourage the pages = layers paradigm.
@ -47,8 +45,8 @@ class PlasmaObject(bpy.types.PropertyGroup):
page = StringProperty(name="Page", page = StringProperty(name="Page",
description="Page this object will be exported to") description="Page this object will be exported to")
# Implementation Details # DEAD - leaving in just in case external code uses it
is_inited = BoolProperty(description="INTERNAL: Init proc complete", is_inited = BoolProperty(description="DEAD",
default=False, default=False,
options={"HIDDEN"}) options={"HIDDEN"})

Loading…
Cancel
Save