ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Copy puppet pins and positions

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Anoek HoubenCopy puppet pins and positions
by on Jun 3, 2013 at 3:44:55 pm

Hello!

So, I have this scene with all sorts of musical instruments which will dance together, and I want to use the puppet tool. But, instead of animating them all one by one, I want to copy the motion I made for one instrument, and copy that onto another instrument. I've tried simply copying and pasting the keyframes, but nothing happens. Also, I've tried to copy the whole effect (in the dropdown menu) but then the pins are still attached to the first object, in stead of being copied to the second object. So it moves somewhat the same, but the pins are on a different place. When I try to move these pins, I move the pins for the first object as well. So AE uses the same pins for the second object, but I'd like to copy the pins as well, on the second object.
I hope its a bit clear, but summarizing, I'd like to copy a puppet motion on another object.

And oh yeah, the objects are the same (I've made a different 'dance' for each different instrument).

I hope there is a solution to my problem, other than duplicating the first object, because that would mean a whole lot more layers on my not so compact composition as it is...


Return to posts index

Andy GallowayRe: Copy puppet pins and positions
by on Jun 3, 2013 at 8:13:33 pm

Hi mate,

This expression seems to work. You will want to have the same amount of pins on each instrument in a relative position. Make sure that puppet pin 1,2,3, etc are always in the same position i.e. pin 1 is always top, 2 middle, 3 bottom left on so on.

Add this expression to each pin on all the instruments you want to follow your master instrument animation.

A = thisComp.layer("MASTER INSTRUMENT LAYER NAME HERE").effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[0];
B = thisComp.layer("MASTER INSTRUMENT LAYER NAME HERE").effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[1];
[effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[0]+A-X VALUE OF PIN 1 OF MASTER INSTRUMENT HERE, effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[1]+B-Y VALUE OF PIN 1 OF MASTER INSTRUMENT HERE]

So just to clarify you need to change the lettering in bold to the name of the layer you have animated with keyframes. Then change the X and Y values that are in bold to the that of the corresponding pin on your master object.

This is how it looks in my test project.

A = thisComp.layer("Shape Layer 2").effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[0];
B = thisComp.layer("Shape Layer 2").effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[1];
[effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[0]+A-1280, effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position[1]+B-196]

When you apply this expression to pin 2 just replace "Puppet Pin 1 with "Puppet Pin 2" wherever it appears in the expression and change x and y valuess in expression to that of pin 2. Obviously repeat this step for all following pins.


Return to posts index

Anoek HoubenRe: Copy puppet pins and positions
by on Jun 9, 2013 at 1:29:48 pm

Hi!

Thanks for your reaction! I've never worked with expressions before, and I've managed to create an expression now ( :P )
But it doesnt work, AE just yells that the expressions is disabled, and I cant enable it. I'm not sure I'm using it the right way though. I tried to copy the whole (a + b) thing in the expression for the pin I want to mimmick the original pin, and I tried to copy the A-part in de original pin, and the B-part in the pin I want to mimmick the original. But it doesnt work :(

What am I doing wrong?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]