From aa2d9d563125f9e48d3e867e93048484d1af323c Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 5 Sep 2016 19:51:11 -1000 Subject: [PATCH] Add 'looping' flag to actions --- hecl/blender/BlenderConnection.cpp | 1 + hecl/blender/BlenderConnection.hpp | 1 + hecl/blender/hecl/sact/SACTAction.py | 1 + hecl/blender/hecl/sact/__init__.py | 2 ++ 4 files changed, 5 insertions(+) diff --git a/hecl/blender/BlenderConnection.cpp b/hecl/blender/BlenderConnection.cpp index d06e06810..83dd148a6 100644 --- a/hecl/blender/BlenderConnection.cpp +++ b/hecl/blender/BlenderConnection.cpp @@ -1047,6 +1047,7 @@ BlenderConnection::DataStream::Actor::Action::Action(BlenderConnection& conn) conn._readBuf(&interval, 4); conn._readBuf(&additive, 1); + conn._readBuf(&looping, 1); uint32_t frameCount; conn._readBuf(&frameCount, 4); diff --git a/hecl/blender/BlenderConnection.hpp b/hecl/blender/BlenderConnection.hpp index 77fa9c098..a77553dc0 100644 --- a/hecl/blender/BlenderConnection.hpp +++ b/hecl/blender/BlenderConnection.hpp @@ -685,6 +685,7 @@ public: std::string name; float interval; bool additive; + bool looping; std::vector frames; struct Channel { diff --git a/hecl/blender/hecl/sact/SACTAction.py b/hecl/blender/hecl/sact/SACTAction.py index e05021043..c72f13f86 100644 --- a/hecl/blender/hecl/sact/SACTAction.py +++ b/hecl/blender/hecl/sact/SACTAction.py @@ -56,6 +56,7 @@ def draw(layout, context): row = layout.row() row.prop(context.scene, 'hecl_auto_remap', text="60-fps Remap") row.prop(linked_action, 'hecl_additive', text="Additive") + #row.prop(linked_action, 'hecl_looping', text="Looping") diff --git a/hecl/blender/hecl/sact/__init__.py b/hecl/blender/hecl/sact/__init__.py index 41aef1b98..c13fae964 100644 --- a/hecl/blender/hecl/sact/__init__.py +++ b/hecl/blender/hecl/sact/__init__.py @@ -290,6 +290,7 @@ def cook(writebuf): writebuf(struct.pack('f', 1.0 / bact.hecl_fps)) writebuf(struct.pack('b', int(bact.hecl_additive))) + writebuf(struct.pack('b', int(bact.hecl_looping))) write_action_channels(writebuf, bact) writebuf(struct.pack('I', len(sact_data.subtypes))) @@ -351,6 +352,7 @@ def register(): bpy.types.Scene.hecl_sact_data = bpy.props.PointerProperty(type=SACTData) bpy.types.Action.hecl_fps = bpy.props.IntProperty(name='HECL Action FPS', default=30) bpy.types.Action.hecl_additive = bpy.props.BoolProperty(name='HECL Additive Action', default=False) + bpy.types.Action.hecl_looping = bpy.props.BoolProperty(name='HECL Looping Action', default=False) 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)