Animating the visibility of several objects, in one action?

For a quick 'n dirty animation (animatic), I want to be able to switch a character from a smile, to a shocked expression, to a pissed-off expression, by toggling the “visiblity” option in the Outliner. I can see in the Action Editor that when I toggle this and “insert keyframe,” an action is automatically created, named (say) Mouth_SmileAction, with a single channel named “Restrict View.” And I see one of these for each mouth-shape.

But, what I want is a strip (that I can use in the NLA editor) which will contain a set of visibilty-settings (On or Off) for all three of the mouth-shape objects. So that I can drop-in one strip called “MouthSmile,” another “MouthAghast,” and a third “MouthPissed,” and move these three around to determine exactly when the character changes her expression.

I want to do this partly because it may well be that, in the final version, the mouth is handled differently. (I’m toying with a shape-keyed object that’s shrinkwrap-modifier applied to the spherical head surface, but I digress.) As I fiddle with the timing of everything, I’d like to be able to shuffle these things around. Each action, so to speak, would be like the group of button on/off settings for a particular radio-button being selected in a radio-group … so to speak (not literally). One on, all others off.

Any ideas? Simple ones? Don’t want to do Python, don’t want bunches of drivers, and I’m not sure that the architecture used to “animate anyting” was devised with this situation in mind. But, just thought I’d ask.

(I’m also not interested in using layers.)

If this sort of thing can be readily, “quick 'n dirty” done, then I’d like to know more. If not, it’s no big deal for me. Curiosity…

I would seek out and find Nathan Vegdahl on something like this… search his webpage and I believe he has an email listed there… He might just know how to do something like this…

to me the most interesting part of what your proposing is the use of activation of an animation in the NLA…
using the Action Editor I would suppose…
But I’m not sure how you would do that exactly…
it’s a fairly easy thing to save an action for later use and activate it via a Controller bone…
but then connect that to be activated in the NLA… I’m not sure exactly…

im not sure i fully under stand, but all you have to do is create the actions then simply add them in your NLA were ever you want them. You can duplicate them, slow them down, stop mid way and reverse. Strips above override strips below. once youve made an action you can use over and over in the nla.

yes on most things that is true… In this case… and I… like yourself may not be fully understanding what sundialsvc4 is wanting here…
but I think they are asking for something like a controller bone that would opperate on several different actions…

which I can think of several situtations where something like this would make animating much easier…

NLA strips are per object so you can’t combine/flatten multiple strips between objects into a single master strip. Unless…you use python or drivers to make some kind of bind or connection. So you are stuck doing it the hard way (manual input via GUI).

But python can ease the chore of creating a bunch of keyframes. For instance, python can spit out a bunch of keyframes for you and then you can drag them around.


import bpy

ob = bpy.data.objects.get("Cube")
for i in range(1,300, 30):
    ob.hide = False
    ob.keyframe_insert(data_path='hide', frame=(i))
    ob.keyframe_insert(data_path='hide', frame=(i+15))
    ob.hide = True
    ob.keyframe_insert(data_path='hide', frame=(i+16))
    ob.keyframe_insert(data_path='hide', frame=(i+29))

Make the default cube blink in the viewport. Change hide to hide_render to make it blink in rendered output.

Here is a more complex script that alternates displaying each object in the list for 1 second, or 30 frames at a time.


import bpy

ob_list = ['Cube','Cone','Sphere']
ob_list_index = 0
display_length = 30
for i in range(1,300, display_length):
    ob = bpy.data.objects.get(ob_list[ob_list_index])
    if ob != None:
        ob.hide = False
        ob.keyframe_insert(data_path='hide', frame=(i))
        ob.hide = True
        ob.keyframe_insert(data_path='hide', frame=(i+(display_length-1)))

    ob_list_index += 1
    if ob_list_index == len(ob_list):
        ob_list_index = 0

Attachments


27_blink_cube.blend (88.5 KB)

Wow… that’s cool… man I need to learn scripting in blender… I was doing scripting a few years back when I was working with XSI… using python… but I haven’t done anything with it since then…