ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

how to link a layer with a rigged expression to a null without messing it up?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Roei Tzoref
how to link a layer with a rigged expression to a null without messing it up?
on Jul 23, 2017 at 12:07:33 pm

I am looking for a way to link an expression rigged layer to a null and keeping it's absolute values so there won't be a shift when I parent it to a null.

this is what's happening:


this is the beginning of a bar chart template I am creating.
the bar has this expression:
t1 = key(1).time;
t2 = key(2).time;
v1 = 1413;
v2 = linear(effect("Slider Control")("Slider"),100,0,1413,885);
ease(time,t1,t2,v1,v2);

it's set on the Y position. now I can change the slider and the animation will act according to 0-100. I want to duplicate this bar and spread them on the X axis. it will be with other layers so I need to parent them so I can move them together. when I do, unless my Null is set to the exact same value as the Bar, there will be a shift. I can either set my null to 0, or parent it and then set it manually back into place. I am looking for something more elegant. to parent it with the right code and not have it to offset.

what's the magic combination here please? I can't seem to make toworld work here.

Thank you

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index

Walter Soyka
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 23, 2017 at 12:44:35 pm

You don't want toWorld(), you want fromWorld(). Give this a spin:

t1 = key(1).time;
t2 = key(2).time;
v1 = 1413;
v2 = linear(effect("Slider Control")("Slider"),100,0,1413,885);
x = 0;
y = ease(time,t1,t2,v1,v2);
(fromWorld([x,y]) + thisLayer.position)[1]


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Roei Tzoref
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 23, 2017 at 10:31:01 pm

Thank you Walter. when I paste it, there is a shift on the Y axis.

here's the project for you to test it:
https://drive.google.com/file/d/0B5wyUt17-tu2Y19pcElBUTZkOUU/view?usp=drive...

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index


Roei Tzoref
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 23, 2017 at 10:56:31 pm
Last Edited By Roei Tzoref on Jul 23, 2017 at 11:09:52 pm

it seems that offseting the shape layer group position in space 260 pixels "fixes" it and now parent and unparent has no shift. still can't make sense of it because I was thinking default location should produce the most neutral state. maybe it because the shape start position is outside the comps dimensions?

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index

Roei Tzoref
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 25, 2017 at 4:40:29 am

Hi, What do you think? Is there a way to avoid this jump due to relative coordinates? I can't find a related thread about it and to/from World goes over my head... maybe if I see the code, I can understand the principle like with some more complex expressions ideas.

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index

Walter Soyka
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 25, 2017 at 4:00:01 pm

[Roei Tzoref] "Hi, What do you think? Is there a way to avoid this jump due to relative coordinates? I can't find a related thread about it and to/from World goes over my head... maybe if I see the code, I can understand the principle like with some more complex expressions ideas."

Let's step back to the beginning. You seem to want a mix of absolute and relative positioning. Why?

When I build bar charts, I go all-out and control just about everything with expressions. Here's a very simple example of the kind of approach I usually take:

11540_barchart.aep.zip

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Roei Tzoref
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 25, 2017 at 7:34:27 pm

Thanks Walter. I will study this rig. in a first impression it looks quite robust and not that simple.

I guess I want to "fix" things in more straightforward manner (in my eyes) if that's at all possible. take a look at just a simple example, is there a code that can overcome it? or do you have to build your rig in advanced knowing this limitation cannot be fixed in a straightforward way (or you could also so say "the way I want it to work")



project file: https://drive.google.com/file/d/0B5wyUt17-tu2YkdBM3ZfQkhpd0E/view?usp=drive...

we can leave it just for research purposes, I am curious if this jump can be avoided...

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index

Roei Tzoref
Re: how to link a layer with a rigged expression to a null without messing it up?
on Jul 24, 2017 at 12:26:44 am

here's another basic example. a green solid is linked to a position of a red solid. I want to parent it to a null without a jump.



what expression could help me here?

here's the project:
https://drive.google.com/file/d/0B5wyUt17-tu2YkdBM3ZfQkhpd0E/view?usp=drive...

Roei Tzoref
After Effects Artist & Instructor
♫ Ae Blues Tutorials


Return to posts index

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