In Blender, specify the range of actions in units called strips
There is a function called ** Non-Linear Animation (NLA) ** that superimposes or loops multiple motions.
You can also export the strip as one motion when exporting FBX etc.
When creating repetitive motions for games, etc.
I made it because I often check the movement by repeating with the length of the strip
An add-on that sets the specified strip range to the timeline preview
Add the item "Strip to preview range" to the selection menu of the non-linear animation editor.

Fixed what was used at work in the 2.7 era to support 2.8 or later
y_StripTime_to_preview.py
bl_info = {
    "name": "set activeStripTime to preview",
    "description": "Set the range of active strips to the preview range",
    "author": "Yukimi",
    "version": (0,3),
    "blender": (2,80, 0),
    "location": "NLA",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Animation"}
import bpy
def Striptime_to_preview(context):
    active_track = context.active_object.animation_data.nla_tracks.active
    if not active_track :return()
    for strip in active_track.strips:
        if strip.active:
            active_strip = strip
    if active_strip == "":return()
    #Get strip information
    frame_start = strip.frame_start
    frame_end = strip.frame_end
    repeat = strip.repeat
    #Preview only the first repeat
    context.scene.use_preview_range = True
    context.scene.frame_preview_end = frame_start + int(( frame_end - frame_start)/ repeat) -1
    context.scene.frame_preview_start = frame_start
class NLA_OT_StripTimeToPreview(bpy.types.Operator):
    '''    set activestrip to preview '''
    bl_idname = "action.striptime_to_preview"
    bl_label = "set activeStripTime to preview"
    def execute(self, context):
        Striptime_to_preview(context)
        return {'FINISHED'}
classes = (NLA_OT_StripTimeToPreview,)
###################################################
def menu_func(self, context):
    self.layout.operator("action.striptime_to_preview", 
        text="Strip into preview range" )
def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.NLA_MT_select.prepend(menu_func)
def unregister():
    bpy.types.NLA_MT_select.remove(menu_func)
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)
if __name__ == "__main__":
    register()
        Recommended Posts