Browse Source

Update Animation Group modifier

Fix an issue with ObData animations and update the UI to match other
list-based modifiers.
pull/40/head
Adam Johnson 9 years ago
parent
commit
66264331a6
  1. 6
      korman/properties/modifiers/anim.py
  2. 9
      korman/ui/modifiers/anim.py

6
korman/properties/modifiers/anim.py

@ -93,16 +93,16 @@ class PlasmaAnimationModifier(ActionModifier, PlasmaModifierProperties):
class AnimGroupObject(bpy.types.PropertyGroup):
object_name = StringProperty(name="Child",
object_name = StringProperty(name="Child Animation",
description="Object whose action is a child animation")
class PlasmaAnimationGroupModifier(PlasmaModifierProperties):
class PlasmaAnimationGroupModifier(ActionModifier, PlasmaModifierProperties):
pl_id = "animation_group"
pl_depends = {"animation"}
bl_category = "Animation"
bl_label = "Group"
bl_label = "Group Master"
bl_description = "Defines related animations"
bl_icon = "GROUP"

9
korman/ui/modifiers/anim.py

@ -45,12 +45,14 @@ def animation(modifier, layout, context):
class GroupListUI(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_property, index=0, flt_flag=0):
layout.prop_search(item, "object_name", bpy.data, "objects", icon="ACTION")
label = item.object_name if item.object_name else "[No Child Specified]"
icon = "ACTION" if item.object_name else "ERROR"
layout.label(text=label, icon=icon)
def animation_group(modifier, layout, context):
action = _check_for_anim(layout, modifier)
if not action:
if action is None:
return
row = layout.row()
@ -65,6 +67,9 @@ def animation_group(modifier, layout, context):
op.collection = "children"
op.index = modifier.active_child_index
if modifier.children:
layout.prop_search(modifier.children[modifier.active_child_index], "object_name", bpy.data, "objects", icon="ACTION")
class LoopListUI(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_property, index=0, flt_flag=0):

Loading…
Cancel
Save