Question on vectors and trigonometry

What type of scripts do you need?

Moderator: byronnash

Post Reply
dunkelzahn
Posts: 7
Joined: November 16th, 2011, 4:14 am

hey everybody,

I´m new here, so I hope this post is is in accordance with this site´s ettiquette.

I´m currently trying to create a 2D character rig in After Effects. I´m using a layered puppet system with marionette pins to make the limbs bendy. After some time I´ve hit a wall. I´m trying to create a hierarchy of null objects to give our animator better tools to animate. However hierarchies of Null objects lead to the child bones not changing thier position coordinates, as they are moved by the parent. This makes my marionette pins bound to the null objects stay static.Not good.

I guess I´ll have to bind the null objects to each other by expressions. I´ve tried to bind their positions to each other by this expression:

[thisComp.layer("Null_parent").position[0]+10 ,thisComp.layer("Null_parent").position[1]+150]

But once I rotate them, the children don´t stay in line. i´ve tried several approaches, binding the rotation to each other and creating a simple look at constraint with the help of JJ Giffords tutorials. But I can´t seem to recreate a simple hierarchy where each member of the hierarchy produces proper position coordinates when animated. I guess, I´ll have to create a vector between each of the bones and have them looking towards each other. but I don´t know how to tell After Effects on how to do this.

Any help on this topic, including nudges in the right direction are much appreciated.

Cheers

Dunkelzahn
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

You just need to use layer space transforms to bind your puppet pins to your nulls. Like this:

fromWorld(thisComp.layer("Null 1").toWorld([0,0,0]))

That way your pins will stick to the world position of the nulls, even if the nulls have parents.

Dan
dunkelzahn
Posts: 7
Joined: November 16th, 2011, 4:14 am

Mr. Ebbert,

You just made a fellow digital grunt a very happy man! Thank you very much. That is exactly what I needed. This will allow me to work just like I am used from 3D rigging.

Cheers and have a good week

Dunkelzahn
Post Reply