ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Using a layer's scale to determine another layer's position.

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nick Vaka
Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 3:07:11 pm

Working on an animated blowfish in After Effects and wanted to see if someone had a quick and dirty solution for parenting his spikes' position to his toro's scale. Basically, as his body puffs out I'd like the spikes to stay near the edge of it without having to keyframe the position of each, while maintaining their original size (since simply parenting would scale the spikes up as well.

I know there's probably an expression out there, but I haven't the foggiest on where.

Thanks in advance!

Nick

Nick Vaka
Motion Graphics & Animation
http://www.nickvaka.com


Return to posts index

Dave LaRonde
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 3:41:30 pm

Is this a cartoon-looking blowfish or a photorealistic blowfish? Either way, I DO NOT recommend using AE. I recommend using a 3D application.

Since I don't have AE CC, I can't tell you if AE 12's improved 3D capabilities would allow you to do this.

Dave LaRonde
Former Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

Nick Vaka
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 7:31:04 pm

It's a cartoony blowfish (Illustrator file). He doesn't need volume, he's just going to grow a bit and then I've got two subsequent character models of him more and more swelled up. I was thinking it'd just be nice to have his body well up a bit and then begin to expand without scaling the spikes themselves.

How would I do it in C4D out of curiosity (if that would work better)?

Thanks!

Nick Vaka
Motion Graphics & Animation
http://www.nickvaka.com


Return to posts index



Kevin Camp
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 8:44:56 pm

i'm not entirely clear on how you have things set up currently, but i think if you were to simply parent the spikes to the body, then scale the body, the spikes would stay in position relative to the body, correct?

but you'd like it if the spikes moved with the body as it scaled, but not scale themselves -- or the scaling remained in dependent of the body?

if that is the case then you could try an expression like this to 'cancel out' the parent scale:

xScale = value[0]/parent.scale[0];
yScale = value[1]/parent.scale[1];
100*[xScale,yScale]


with that expression, after the spikes are parented to the body, as the body scales up, the spkes will look like the stick to the body, but the scale will remain the same. you can still animate the spikes' scales if separately if needed.

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Nick Vaka
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 9:15:42 pm

Thanks! This is exactly the expression I was looking for. Works like a charm.

Nick Vaka
Motion Graphics & Animation
http://www.nickvaka.com


Return to posts index

Synnøve Ludvigsen
Re: Using a layer's scale to determine another layer's position.
on Feb 12, 2015 at 9:55:55 am

Hi :)

I have a similar problem, and this looks like a good script for me, but I couldnt make it work.

I put your script on scale on the child layer and got this message:

After Effects warning: an expression was disabled as a result of an error.
Error at line 3 in property 'Scale' of layer 12 ('tak') in comp 'comp name'
invalid numeric result (divide by zero?)

Would you know why?


Return to posts index



Anders Hattne
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 8:27:17 pm

Depending on the look of the blowfish I would use nulls parented to the blowfish's body, then use the compTo expression to tie the spikes to the nulls. I made a quick experiment to try it out.. and thought it looked better when I added a bit of increase of scale to the spikes.
I'll just attach my li'l project for you!
6602_blowfish.aep.zip

Maybe there is an expression free way of doing this as well?

http://www.ardillamedia.com


Return to posts index

Nick Vaka
Re: Using a layer's scale to determine another layer's position.
on Oct 4, 2013 at 9:16:34 pm

Thanks for this! I might end up using the expression, but I've got a few other applications for this thing.

Thank you for your help!

Nick Vaka
Motion Graphics & Animation
http://www.nickvaka.com


Return to posts index

Anders Hattne
Re: Using a layer's scale to determine another layer's position.
on Oct 5, 2013 at 8:56:19 am

When I woke up this morning, I had a simpler solution for this!
Delete the nulls. *You noticed my layers where all different colours? That way I can click the colour, and select label group, delete all nulls in one go.. or select all spikes etc!)

Parent spikes to body and apply this expression to the scale

sub=thisComp.layer("body").transform.scale-[100, 100];
value-sub

http://www.ardillamedia.com


Return to posts index


Anders Hattne
Re: Using a layer's scale to determine another layer's position.
on Oct 5, 2013 at 9:55:53 am

Just realised that doesn't quite work. But Kevin Camp had a similar idea that probably works. Gonna check that out!

http://www.ardillamedia.com


Return to posts index

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