FORUMS: list search recent posts

Match position across 2 different compositions

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Luca Zecchi
Match position across 2 different compositions
on Nov 13, 2019 at 6:48:36 pm

Hi everyone, I need some help with my animation rig.

Setting:
I have two comps: "MAN", 10.000*10.000px large and "HORSE", 9.000*6.195px (please don't ask me why).
Both compositions are working together in a third one where the "MAN" is set to a scale of 43,5% and the "HORSE" is set to 30%.

My problem:
The bridles are driven by a DUIK rig consisting of two bones: one is called "HAND" and is parented to the hand of the man; the other is called "MOUTH". The bridles are within the "MAN" comp. I need to parent the "MOUTH" bone all the way to the "HORSE" comp, to a null object (called "CHILD") that follows exactly the horse's head.

I know there's is a solution!! I already saw this post (Linking nulls in two comps of different dimensions) from Josh. The problem is similar.
I also have tested other expressions but I'm too stupid for make them work ☹ I can manage to get the "MOUTH" bone to follow the horse's head quite closely, but it always ends up to be a little off. I can't understand where this error stems from.

I can pay in keyframes, pls help.



Luca


Return to posts index

Cassius Marques
Re: Match position across 2 different compositions
on Nov 13, 2019 at 8:29:30 pm
Last Edited By Cassius Marques on Nov 13, 2019 at 8:41:31 pm

double post


Return to posts index

Cassius Marques
Re: Match position across 2 different compositions
on Nov 13, 2019 at 8:40:37 pm

Because I was not accounting for the compositions to have different scales.

Given those numbers if you change the code to:

ref=comp("Man");
a=comp("Man").layer("mouth").position;
b=100/thisComp.layer("mouth").transform.scale[0];
nx=a[0]-ref.width/2;
ny=a[1]-ref.height/2;
[nx*1.45/b+(thisComp.width/2),ny*1.45/b+(thisComp.height/2)]


A layer named mouth in Horse comp with this expression applied to its position would match the position of the same layer in the man comp in any third reference composition. You should notice that the 1.45 is the difference in scale between Man and Horse comps. (in case you adjust things)

Remember that those comps still must have the same aligned center. If you need the other way around, you just change the value from 1.45 to 0.69 (thats ~0,6896... or 30/43,5‬).

Cassius Marques
http://www.zapfilmes.com


Return to posts index


Luca Zecchi
Re: Match position across 2 different compositions
on Nov 14, 2019 at 11:57:49 am

Hi Cassius, thanks a lot!
Of course the rigs are not in the center... I had to change your expression to make it work, I added two sliders for adjust the position:

ref=comp("HORSE");
a=comp("HORSE").layer("CHILD").position;
b=100/thisComp.layer("B | BRIGLIA | BRIGLIA_BOCCA").transform.scale[0];
nx=a[0]-ref.width/2+effect("X")("Slider");
ny=a[1]-ref.height/2+effect("Y")("Slider");
[nx*0.69/b+(thisComp.width/2),ny*0.69/b+(thisComp.height/2)]

The mouth bone position is still a bit off, but less than before. I think it's fine now,



.
If you have some improvement, I'm all ears.


Luca


Return to posts index

Cassius Marques
Re: Match position across 2 different compositions
on Nov 14, 2019 at 12:44:38 pm

I expected them to be aligned because you could move the whole rig inside the composition with a master instead of moving the outside comp. But I know sometimes we do whichever is simpler/faster.

Anyway I guess I could dig through the math to make it work for whatever position those comps are. But I wont cause you already have a pretty neat animation there =].

Good luck.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Luca Zecchi
Re: Match position across 2 different compositions
on Nov 15, 2019 at 10:39:42 am

Thanks a lot Cassius!


Luca


Return to posts index

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