Context override for action stashing


I need to find a way to stash some actions in NLA, using python API. Is there a way to do it. Currently, I can’t because I can’t find what data to override in context during bpy.ops call.

More general related question : Is there a way to know, for any operators, what are the context / overridden data that are needed to run the operator ?

Thanks :slight_smile:

1 Like

For anyone asking, I wrote this code that does same thing, but wihtout any ops call :

import bpy

def stash(obj, action, track_name, start_frame):
    # Simulate stash :
    # * add a track
    # * add an action on track
    # * lock & mute the track
    # * remove active action from object
    tracks = obj.animation_data.nla_tracks
    new_track = = track_name
    strip =, start_frame, action)
    new_track.lock = True
    new_track.mute = True
    obj.animation_data.action = None

# Test
1 Like

In order to find the right context for specific operator, you have to take a look at c sources.