• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Parenting to layer inside a character rig comp

New Here ,
May 31, 2021 May 31, 2021

Copy link to clipboard

Copied

Hi everyone,

I hope you could help me with this.

I have a simple rig of a character in a comp, that I place in different comps "scenes" to build a story, I use Essential Properties to move the parts of the rig, this is very useful and works great for me.

Now there are some cases that I need an element of the scene to follow one element of the rig, like a cap on the head, but I don't want to have the cap in the character rig for several reasons.

The question is how do I parent the cap to the head in the nested comp?

I tried with an expression to link the properties of the cap to the head's one but those never actually change as the head is parented to the neck and is the neck rotating.

I've also tried to use a combination of null objects "copied with property links", but again the head "local" properties never change so doesn't work.

attached I've recreated a simplified version of my setup, where the star is the cap in this case.

This could have a very simple solution but I can't figure it out

 

robot-rig.jpg

Could anyone help with this?

Thanks

Alessio

TOPICS
Expressions , How to

Views

637

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2021 May 31, 2021

Copy link to clipboard

Copied

The position expression will probably look something like this:

xOffset = 0;
yOffset = -50;
L1 = comp("robot-rig").layer("Head");
p1 = L1.toComp(L1.anchorPoint + [xOffset,yOffset]);
L2 = thisComp.layer("robot-rig");
L2.toComp(p1)

Adjust xOffset and yOffset to position the hat exactly where you want it on the head. It gets more complicated if you need the hat to rotate with the body.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2021 May 31, 2021

Copy link to clipboard

Copied

I went ahead and worked out the rotation, if you want the hat to rotate with the head:

L1 = comp("robot-rig").layer("Head");
v1 = L1.toCompVec([1,0,0]);
L2 = thisComp.layer("robot-rig");
v2 = L2.toCompVec(v1)
value + radiansToDegrees(Math.atan2(v2[1],v2[0]))

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

@Dan Ebberts Hey Dan Thank you so much for looking into this, much appreciated. 

I've tried to add your expressions to the hat/star position and rotation but it won't follow the character when I move it.

I've tried to attach the project and the assets but it won't let me, so I took another screenshot

robot-rig-2.jpg 

Am I missing something?

 

thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

So you're animating the layers inside the robot-rig comp and the star/hat is not moving with them, is that correct? I'm stumped. It works in the simple mockup I did here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Exactly, I animate them using Essential properties, as you can see in the bottom layer,

Would you be able to send me your test project? 

I don't know why if I attach the ae file here it tells me that is not a valid file.

I've uploaded them on wetransfer if you want to have a look

https://we.tl/t-qHvXvkHtgv

 

thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Once you animate one of the Essential Properties in the Scene 01 comp, if you click the Push to Primary Comp button for that property, it moves the animation into the robot-rig comp, and then it works. I don't know if that fits your workflow though.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Hey Dan, you are right that works but the problem is that if I embed the animation in the master rig then I can't use it in other scenes unless I make copies of it. 

The actual project is quite big and I have several full-body character rigs, So I would like to save resources and have reusable assets.

Anyway, your code is very clever, is there any way to point to the local proprieties of the rig in the current scene?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

Sorry, I can't think of anything that doesn't involve some seriously complex math, but I'm not very familiar with Essential Properties. Maybe someone else will come up with a better idea...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2021 Jun 04, 2021

Copy link to clipboard

Copied

LATEST

Hey Dan, no problem, thank you for your help and time anyway, much appreciated 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines