Thursday, November 25, 2010

Post #100 - Quick Action Management Tip

Yay! According to my sidebar, this marks my 100th post on this blog. 

The real topic of today's post is to answer a little question regarding managing Actions - that is,
How do you change/remove the Action used by a datablock?

A little background info
Most of the relinkable data in Blender exists in so-called "ID-Blocks". In Computer Science terms, these are basically objects (from OO-terminology) with Serialisation information, or if you like, "national identification cards" for clusters of related settings. Examples of ID-blocks include Object (not to be confused with the other type mentioned earlier), Lamp, Material, Texture, World, Mesh, Curve, etc.

Now, attached within each of these ID-blocks that can be animated, there is another block of data called "AnimData". This contains all the information Animato (the animation system) needs to know to animate this block, such as (a link to) the Active Action, the NLA Stack (Tracks+Strips), and Drivers. All "data_paths" used by F-Curves/Drivers found within this AnimData block are evaluated relative to the ID-block this AnimData block is attached to.

At this point, I should probably show some pictures to clarify all this, so here goes:
1) A diagram of this made by Ton (this by and large shows the situation described)
2) The diagram I had in the original Animato docs (which I never finished writing)

Putting theory into practice
Ok, so now we know how this works, how exactly do you change the action assigned to one of these blocks?

Many people who are asking this question will no doubt have tried to do this via the Action Editor, but probably failed to see any keyframes, or perhaps they did but quickly became confused as to why those keyframes didn't work once assigned. Perhaps, they might've even seen red lines under the names of all those F-Curves once assigned.

The simple answer is that currently the Action Editor can only deal with Object-level animation. That is, it can only "see" the Action attached to the Object ID-blocks' AnimData. Admittedly, this part is something that is still a bit WIP, but currently I don't have any really good ideas of how to allow choosing the ID-block to grab the action from without heaps of confusion/context-problems.

So then, how do you do it? Well, believe it or not, this can currently be done via the NLA Editor!

Here's what to do:
1) Open NLA Editor, and make sure the Properties Region (NKEY) is visible
2) In the Channels List, click on the blue-coloured channel of the ID-block where the keyframes live. For example, for Object-level, click on the dark blue Object channel with no indention. For Object data (i.e. Lamp, Mesh, Curve, etc.), click on the light-blue channel indented one level below the Object data.
3) In the Properties Region, you should now see the "Animation Data" panel.
4) Within this panel, you'll see the Action browser widget. Use this like the selector in the Action Editor :)

Hopefully this helps :)


  1. It would be very useful to be able to manipulate actions from within the dopesheet/fcurve editor, i wanted that a lot recently.

    Crude mockup:

  2. I agree with Matt, and of course, thanks a lot for making this very very usefull posts explainig a lot of great things!! :D

  3. Hmm.. good idea... "direct manipulation"

    Will tinker with this when I get time.