diff options
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/ui_mocap.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/release/scripts/startup/ui_mocap.py b/release/scripts/startup/ui_mocap.py index dd5e6fa5d6d..19a96750e49 100644 --- a/release/scripts/startup/ui_mocap.py +++ b/release/scripts/startup/ui_mocap.py @@ -382,6 +382,7 @@ class ExtraToolsPanel(bpy.types.Panel): layout.prop(settings, "blend_amount") layout.prop(settings, "second_offset") layout.prop_search(settings, "stick_bone", context.active_object.pose, "bones") + layout.operator('mocap.animstitchguess', text="Guess Settings") layout.operator('mocap.animstitch', text="Stitch Animations") @@ -765,6 +766,25 @@ class OBJECT_OT_AnimationStitchingButton(bpy.types.Operator): return False +class OBJECT_OT_GuessAnimationStitchingButton(bpy.types.Operator): + '''Guesses the stitch frame and second offset for animation stitch''' + bl_idname = "mocap.animstitchguess" + bl_label = "Guesses the stitch frame and second offset for animation stitch" + + def execute(self, context): + mocap_tools.guess_anim_stitch(context, context.active_object) + return {"FINISHED"} + + @classmethod + def poll(cls, context): + activeIsArmature = False + if context.active_object: + activeIsArmature = isinstance(context.active_object.data, bpy.types.Armature) + if activeIsArmature: + stitch_settings = context.active_object.data.stitch_settings + return (stitch_settings.first_action and stitch_settings.second_action) + return False + def register(): bpy.utils.register_module(__name__) |