Browse Source

POC Plasma Synch panel

TODO: This is not hooked up to anything.
pull/6/head
Adam Johnson 10 years ago
parent
commit
abaf574a68
  1. 1
      korman/properties/__init__.py
  2. 25
      korman/properties/prop_object.py
  3. 21
      korman/ui/ui_object.py

1
korman/properties/__init__.py

@ -20,6 +20,7 @@ from .prop_world import *
def register():
bpy.types.Object.plasma_net = PointerProperty(type=PlasmaNet)
bpy.types.Object.plasma_object = PointerProperty(type=PlasmaObject)
bpy.types.World.plasma_age = PointerProperty(type=PlasmaAge)
bpy.types.World.plasma_fni = PointerProperty(type=PlasmaFni)

25
korman/properties/prop_object.py

@ -18,6 +18,17 @@ from bpy.props import *
from PyHSPlasma import *
def SdlEnumProperty(name):
return bpy.props.EnumProperty(name=name,
description="{} state synchronization".format(name),
items=[
("save", "Save to Server", "Save state on the server"),
("volatile", "Volatile on Server", "Throw away state when the age shuts down"),
("exclude", "Don't Send to Server", "Don't synchronize with the server"),
],
default="save")
class PlasmaObject(bpy.types.PropertyGroup):
def _enabled(self, context):
# This makes me sad
@ -60,3 +71,17 @@ class PlasmaObject(bpy.types.PropertyGroup):
is_inited = BoolProperty(description="INTERNAL: Init proc complete",
default=False,
options={"HIDDEN"})
class PlasmaNet(bpy.types.PropertyGroup):
manual_sdl = BoolProperty(name="Override SDL",
description="ADVANCED: Manually track high level states on this object",
default=False)
# Some of the standard plSynchedObject states
agmaster = SdlEnumProperty("AGMaster")
layer = SdlEnumProperty("Layer")
physical = SdlEnumProperty("Physical")
responder = SdlEnumProperty("Responder")
sound = SdlEnumProperty("Sound")
xregion = SdlEnumProperty("XRegion")

21
korman/ui/ui_object.py

@ -38,4 +38,25 @@ class PlasmaObjectPanel(ObjectButtonsPanel, bpy.types.Panel):
pl_age = context.scene.world.plasma_age
layout.active = pl_obj.enabled
# Which page does this object go in?
# If left blank, the exporter puts it in page 0 -- "Default"
layout.prop_search(pl_obj, "page", pl_age, "pages", icon="BOOKMARKS")
class PlasmaNetPanel(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Plasma Synchronization"
def draw_header(self, context):
self.layout.prop(context.object.plasma_net, "manual_sdl", text="")
def draw(self, context):
layout = self.layout
pl_net = context.object.plasma_net
layout.active = pl_net.manual_sdl
layout.prop(pl_net, "agmaster", text="Animation")
layout.prop(pl_net, "layer", text="Material")
layout.prop(pl_net, "physical")
layout.prop(pl_net, "responder")
layout.prop(pl_net, "sound")
layout.prop(pl_net, "xregion")

Loading…
Cancel
Save