Tail secondary movement


Hi all,
I’m a long time observer, first time poster here on cgtalk.
My character has a spline ik tail. I know there is already a bunch of tutorials on this, but I want to create a satisfying automatic secondary movement for this tail. The results I have so far with particle or softbody dynamics are no good because they create a “springboard” effect, while im looking for a whip effect.
There is a solution I found in this book “Maya Character Creations”, it involves an expression:

int $time = ‘currentTime -query’;
int $delay10 = ‘getAttr -time ($time - 10) Hips.ry’;
int $delay20 = ‘getAttr -time ($time - 20) Hips.ry’;
int $delay30 = ‘getAttr -time ($time - 30) Hips.ry’;
int $delay40 = ‘getAttr -time ($time - 40) Hips.ry’;
TailRoot.rotateZ = 0 + Hips.rotateY;
Tail2.rotateZ = 0 + $delay10;
Tail3.rotateZ = 0 + $delay20;
Tail4.rotateZ = 0 + $delay30;
TailEnd.rotateZ = 0 + $delay40;

You can find the chapter that explains this expression online, halfway down this page:

I followed every step in the book from scratch, but I cannot get this expression to work. It gives me an error at every line of code. Is it because its not compatible with Maya 5? I am not too familiar with Mel and expressions but I have implemented some without any problems in the past. So please could someone show me how to make this work or suggest me something else.



it looks to me like you are mistaking the single quote marks for being apostrophes. you want to use the key above the tab, not the apostrophe key when evaluating an expression. It’s a common mistake and one thats hard to spot.
Your code should be:

int $time = currentTime -query;
int $delay10 = getAttr -time ($time - 10) Hips.ry;
int $delay20 = getAttr -time ($time - 20) Hips.ry;
int $delay30 = getAttr -time ($time - 30) Hips.ry;
int $delay40 = getAttr -time ($time - 40) Hips.ry;
TailRoot.rotateZ = 0 + Hips.rotateY;
Tail2.rotateZ = 0 + $delay10;
Tail3.rotateZ = 0 + $delay20;
Tail4.rotateZ = 0 + $delay30;
TailEnd.rotateZ = 0 + $delay40;


it worked.
many thanks.


A time delayed expression like the one you have here should yield a fairly convincing ‘whipping’ motion. I’ve used a similar expression to animate a sting ray.

Damb backticks/apostrophes will get you every time!:wink:


instead of using mel in an expression, try using the frame cache node.

to create one: createNode frameCache;

then plug what you want into the node, and it will output the result of that node, but offset in time. much better than using mel in an expression…


instead of using mel in an expression, try using the frame cache node.

You actually got that thing to work, Mac? Last time I tried it, it was just freakin´ out all ova´ da´ place. …But I think that was in 4.5. Did they improve this in 5.0?


pretty much the same for me.

in the help is written:

…eg. output 1 is the stream’s value at “frame + 1”…

but in the connection editor only past[0] or future[0] could be connected.


No, I mean, I could connect everything no problem, it just behaved extremely erratically- it didn´t produce predictable or correct results. I think I tried it on some tail joints once, and the tail just kept twitching about hectically.

You might need to use MEL to connect it properly.



yeah you’re right, it does seem pretty finicky and unstable. it doesn’t seem to refresh its own cache or something… i keep getting elements of old animation stored in the nodes.

maybe you’re right dave, mel in expressions could be the way to go.


No luck here either. Glad to know it’s not just me. Where’s Scheifer? He’s the one who introduced me to this… how the heck did he make it work? If anyone else knows how to successfully use this node, please let me know.

Guess I’ll have to use an expression for now, only days till Siggraph and the reel is still not ready for compositing.

  • Jeremy


Hi Jeremy,

you could e.g. try the lagNode… -->
lagNode and expressoUtils plugins




This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.