Getting a list of actions that apply to an armature

Hi,

I have an armature, and on that armature, I’ve created two animations; “walk” and “run”

My armature is called ‘Skeleton’, so in order to get the currently assigned animation, I do:

bpy.data.objects[‘Skeleton’].animation_data.action

However, this will only give me whatever action is currently assigned, not the list of applicable animations for this armature

Does anyone know of a way to get the full list of animations that apply to a given armature?

Hi ferg,

AFAIK there is no link between actions and objects once they are unassigned from the object (ob.animatiion_data.action , as you mentioned), or via the NLA. A workaround I’ve used is to assign a cross reference ID property (or similar) to your actions.



action["Skeleton"] = True 

You can then retrieve a list of associated actions with:


skeleton_actions = [ a for a in bpy.data.actions if "Skeleton" in a.keys()]

Also pays to assign a fake user to unassigned actions.