Replacement animation/Driven Layer keys

I have been trying for awhile now to get some sort of replacement animation system working in blender. What would work best for my needs is some way of using a bone to drive the Ipo Layer. Pretty much exactly like the Driven Shape Keys except with Layers instead of shape keys. I do have a little experience with setting up the driven shape keys etc… So I understand how to setup an IPO driver. But for some reason I just can’t get it to work with the layers. An example of what I am trying to accomplish would be. I have the default cube, and I have a “driven layer key” tied to a bone. By moving the bone back and fourth in the Z axis I can move the cube from Layer 1 to Layer 20 and back to layer 1 etc…

So I’ve tried to set something like this up. But I am not sure if it’s either that A.) I am dumb and can’t figure it out or B.) It’s just not possible to do this with the Layer Ipo and I should forget it and try something else.

I have done a number of searches through the forums trying to solve this problem on my own… but so far I haven’t really come up with anything that will work well for me. So I’m hoping someone here could help me. I certainly appreciate any and all insight anyone can give me here. I am including an example .blend so maybe someone can take a look at that and tell me what I’m doing wrong.



I don’t think layers can be driven yet? Also pydrivers are no good because they are input not output. Also even though you can write a pydriver to accomplish this it makes more sense to make an object script link.

One last detail - you were trying to drive this using pose, but you never specified a bone. Also the driver object needs to have keys before you can see the effect.

Ok, I’m curious, what would a “driven layer animation” accomplish for you ? :confused:

If you explain what the end result is, mabye there is already another solution.


hey thanks for the reply’s guys. Mike, I’m basicly trying to get some form of
replacement animation working. But I think that Kitsu is right and that Layer’s can not be driven. I think I need to come up with another approach. I’m wondering if there might be some way to swap objects with each other? So for example set an Empty and have several meshes that somehow cycle in and out of that empty position? I also thought about using ztranp…but the problem with that is say I had 20 meshes I wanted to cycle through? they would all occupy the same space. Now it would look ok for rendering but for animating in the 3d view it would get really confusing very fast. So I’m trying to figure out something that won’t hinder me while I animate and will also render well.

Also just so everyone understands what I am trying to do. My main interest in blender is 2d cutout style animation. So for example say I need to lip sync a character. Replacement animation would allow me to swap out various mouth shapes to make him talk. Now to a certain extent Shape keys work for this… I can also manually set key frames for layers on each object… but that get’s to be confusing and painfull real fast. I’ve been trying to find a way to do replacement animation easier for the past 6 months or so…and I just need help. So any ideas anyone has would be really appreciated.

What I really want is some way of building a control surface in blender that I can use to swap various objects in and out of place with.

Just thought I would wrap up this thread. My replacement animation problem has now been solved thanks to python. My main problem is that I am not a programmer… but luckily a good friend of mine is. Anyway I now have a script that works perfect for my needs. I will at some point post back here with a tutorial + python script. In the mean time if anyone else is interested or having the same problem feel free to message me and I’ll help out as much as I can.

Sounds interesting.

If you’d like to post the script without the tutorial, I wouldn’t mind taking a look to see what you’re doing.

Some other ideas that you might (or not :slight_smile: ) find useful

  • You can keyframe the different mouth shapes locations and change their Loc curve interpolation to constant. That way they would “instantly” swap positions

  • You could duplicate the character(s), and keyframe the Loc of a camera, setting the camera’s Loc Ipo curves interpolation to constant, to “snap” the camera into the new position.

There is also the camera changer script for switching between multiple cameras.


hey mike
thanks for the ideas. the camera one could possibly come in handy
at some point for me.

here’s a copy of the script. first draft only though… my friend is
cleaning/adding more things to it. But for right now it suites
my needs. I can post a .blend with an example if you want.

import Blender

handle =
base = handle.getName()[:-4]
locator = Blender.Object.Get(base)

zero out all animation for all replacements

for i in range(1,5):
repobjname = “%s.%03d” % (base, int(i))
repobj = Blender.Object.Get(repobjname)
if (repobj):

determine replacement object by checking handle x-pos

x,y,z = handle.getLocation()
if x<1: x==1
repobjname = “%s.%03d” % (base, int(x))
repobj = Blender.Object.Get(repobjname)

set replacement to be child of empty

if repobj:
locator.makeParent( [repobj], 1)