I'm making an addon for the NLA editor, and I need to know precisely which strips are selected in the NLA editor.

Unfortunately this means checking every single data object in the blend file, because there are 20 other data types with animation data to consider beside Objects - materials, nodetrees, armatures, worlds, etc...

The problem however is in telling whether or not one of these non-Objects are associated within the active scene, because if I have 5 scenes with NLA tracks in each one, I may have multiple NLA tracks selected in one scene's summary dopesheet, but I just want to know the selected nla strips in the active scene's summary dopesheet (ignoring filters and such).

Simply put, I need to know which non-Objects (ie, material, armature, world, etc) are associated with a scene in any way.

Any ideas?

  • $\begingroup$ Can you not make use of the "users" data recorded for each of these data types? I know users are recorded per file and not per scene and due to the purging method it sometimes reports false users but seems like a good starting place. $\endgroup$
    – kheetor
    Commented Mar 29, 2019 at 18:34

1 Answer 1


I looked at Blender's source code and realised it was quite an ordeal for the dopesheet to filter objects relevant to a context, so I gave up any hope of a simple solution and just went about doing a ersatz version of it in python.

It's a bit of a mess, but it works for detecting most non-objects (and objects) with animation data in a context:



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .