addon updates

This commit is contained in:
Jack Andersen 2015-08-13 11:29:38 -10:00
parent 3341e6c4f3
commit 247e80fc1a
4 changed files with 35 additions and 28 deletions

View File

@ -51,8 +51,8 @@ def draw(layout, context):
if linked_action is None: if linked_action is None:
layout.label("Source action not set", icon='ERROR') layout.label("Source action not set", icon='ERROR')
else: else:
layout.prop(linked_action, 'hecl_index', text="Index") #layout.prop(linked_action, 'hecl_index', text="Index")
layout.prop(linked_action, 'hecl_anim_props', text="Props") #layout.prop(linked_action, 'hecl_anim_props', text="Props")
layout.prop(linked_action, 'hecl_fps', text="Frame Rate") layout.prop(linked_action, 'hecl_fps', text="Frame Rate")
layout.prop(context.scene, 'hecl_auto_remap', text="60-fps Remap") layout.prop(context.scene, 'hecl_auto_remap', text="60-fps Remap")
@ -134,9 +134,9 @@ class SACTAction_load(bpy.types.Operator):
subtype = actor_data.subtypes[actor_data.active_subtype] subtype = actor_data.subtypes[actor_data.active_subtype]
# Refresh event markers # Refresh event markers
actor_event.clear_event_markers(actor_data, context) #SACTEvent.clear_event_markers(actor_data, context)
actor_event.update_action_events(None) #SACTEvent.update_action_events(None)
actor_event.active_event_update(None, context) #SACTEvent.active_event_update(None, context)
# Clear animation data for all subtypes # Clear animation data for all subtypes
for s in range(len(actor_data.subtypes)): for s in range(len(actor_data.subtypes)):
@ -170,8 +170,8 @@ class SACTAction_load(bpy.types.Operator):
bpy.context.scene.frame_end = action_obj.frame_range[1] bpy.context.scene.frame_end = action_obj.frame_range[1]
# Events # Events
#actor_event.clear_action_events(self, context, actor_data) #SACTEvent.clear_action_events(self, context, actor_data)
#actor_event.load_action_events(self, context, action_obj, 0) #SACTEvent.load_action_events(self, context, action_obj, 0)
return {'FINISHED'} return {'FINISHED'}
@ -190,9 +190,9 @@ class SACTAction_load(bpy.types.Operator):
# Registration # Registration
def register(): def register():
bpy.types.Action.hecl_fps = bpy.props.IntProperty(name="HECL Actor Sub-action Frame-rate", bpy.types.Action.hecl_fps = bpy.props.IntProperty(name="HECL Actor Sub-action Frame-rate",
description="Frame-rate at which action is authored; to be interpolated at 60-fps by runtime", description="Frame-rate at which action is authored; to be interpolated at 60-fps by runtime",
min=1, max=60, default=30, min=1, max=60, default=30,
update=active_action_update) update=active_action_update)
bpy.utils.register_class(SACTAction) bpy.utils.register_class(SACTAction)
bpy.utils.register_class(SACTAction_add) bpy.utils.register_class(SACTAction_add)
bpy.utils.register_class(SACTAction_load) bpy.utils.register_class(SACTAction_load)

View File

@ -400,16 +400,14 @@ def active_event_update(self, context):
actor_data = context.scene.hecl_sact_data actor_data = context.scene.hecl_sact_data
if actor_data.active_action in range(len(actor_data.actions)): if actor_data.active_action in range(len(actor_data.actions)):
action_data = actor_data.actions[actor_data.active_action] action_data = actor_data.actions[actor_data.active_action]
if action_data.active_subaction in range(len(action_data.subactions)): for marker in context.scene.timeline_markers:
subaction_data = action_data.subactions[action_data.active_subaction] if marker.name.startswith('hecl_'):
for marker in context.scene.timeline_markers: blend_action = bpy.data.actions[action_data.name]
if marker.name.startswith('hecl_'): event_name = blend_action.hecl_events[blend_action.hecl_active_event].name
blend_action = bpy.data.actions[subaction_data.name] if marker.name == 'hecl_' + str(blend_action.hecl_index) + '_' + str(blend_action.hecl_active_event) + '_' + event_name:
event_name = blend_action.hecl_events[blend_action.hecl_active_event].name marker.select = True
if marker.name == 'hecl_' + str(blend_action.hecl_index) + '_' + str(blend_action.hecl_active_event) + '_' + event_name: else:
marker.select = True marker.select = False
else:
marker.select = False
# Registration # Registration
def register(): def register():
@ -423,7 +421,7 @@ def register():
bpy.utils.register_class(hecl_actor_subaction_event_move_down) bpy.utils.register_class(hecl_actor_subaction_event_move_down)
bpy.utils.register_class(hecl_actor_subaction_event_move_up) bpy.utils.register_class(hecl_actor_subaction_event_move_up)
bpy.types.Action.hecl_events = bpy.props.CollectionProperty(name="HECL action event", bpy.types.Action.hecl_events = bpy.props.CollectionProperty(name="HECL action event",
type=hecl_actor_event) type=hecl_actor_event)
bpy.types.Action.hecl_active_event = bpy.props.IntProperty(name="HECL active action event", bpy.types.Action.hecl_active_event = bpy.props.IntProperty(name="HECL active action event",
default=0, default=0,
update=active_event_update) update=active_event_update)

View File

@ -1,4 +1,4 @@
from . import SACTSubtype, SACTAction, SACTEvent, ANIM from . import SACTSubtype, SACTAction, ANIM
from .. import hmdl from .. import hmdl
import bpy import bpy
@ -25,8 +25,8 @@ class SACTData(bpy.types.PropertyGroup):
show_actions =\ show_actions =\
bpy.props.BoolProperty() bpy.props.BoolProperty()
show_events =\ #show_events =\
bpy.props.BoolProperty() #bpy.props.BoolProperty()
# A Routine to resolve HECL DAG-relative paths while ensuring database path-constraints # A Routine to resolve HECL DAG-relative paths while ensuring database path-constraints
def resolve_local_path(blend_path, rel_path): def resolve_local_path(blend_path, rel_path):
@ -235,20 +235,29 @@ def cook(writebuffunc, platform, endianchar):
def draw(layout, context): def draw(layout, context):
SACTSubtype.draw(layout.box(), context) SACTSubtype.draw(layout.box(), context)
SACTAction.draw(layout.box(), context) SACTAction.draw(layout.box(), context)
SACTEvent.draw(layout.box(), context) #SACTEvent.draw(layout.box(), context)
# Time-remap option update
def time_remap_update(self, context):
if context.scene.hecl_type == 'ACTOR':
SACTAction.active_action_update(self, context)
# Registration # Registration
def register(): def register():
SACTSubtype.register() SACTSubtype.register()
SACTEvent.register() #SACTEvent.register()
SACTAction.register() SACTAction.register()
bpy.utils.register_class(SACTData) bpy.utils.register_class(SACTData)
bpy.types.Scene.hecl_sact_data = bpy.props.PointerProperty(type=SACTData) bpy.types.Scene.hecl_sact_data = bpy.props.PointerProperty(type=SACTData)
bpy.types.Action.hecl_fps = bpy.props.IntProperty(name='HECL Acion FPS', default=30) bpy.types.Action.hecl_fps = bpy.props.IntProperty(name='HECL Acion FPS', default=30)
bpy.types.Scene.hecl_auto_remap = bpy.props.BoolProperty(name="Auto Remap",
description="Enables automatic 60-fps time-remapping for playback-validation purposes",
default=True, update=time_remap_update)
def unregister(): def unregister():
bpy.utils.unregister_class(SACTData) bpy.utils.unregister_class(SACTData)
SACTSubtype.unregister() SACTSubtype.unregister()
SACTAction.unregister() SACTAction.unregister()
SACTEvent.unregister() #SACTEvent.unregister()

@ -1 +1 @@
Subproject commit d0577ae3040aa19861009b95bf28ea05f12b8c53 Subproject commit 5b38596595a0b457ce617b36e1c7fa23620303fc