Highlighted

Offsetting time and position of several layers relative to preceding layer

New Here ,
Aug 08, 2012

Copy link to clipboard

Copied

Hello -

Pardon the newbie questions, but I've keyframed 'Black Solid' moving along the x axis and basically would like to duplicate the layer (perhaps with a new color) several times so that each 'new layer' follows the previous layer and offsets itself a certain amount of pixels...say 20px for example.

I found a simple expression that I applied to the first dup'd layer and it works fine but I can't figure out where to tell it to offset 20px to the left of the main layer.

thisComp.layer("Black Solid 1").transform.position.valueAtTime(time -.1);

I suppose I'm trying for a cascading effect + offset.

Thanks!

gj

Topics

Expressions

Views

17.2K

Likes

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

Offsetting time and position of several layers relative to preceding layer

New Here ,
Aug 08, 2012

Copy link to clipboard

Copied

Hello -

Pardon the newbie questions, but I've keyframed 'Black Solid' moving along the x axis and basically would like to duplicate the layer (perhaps with a new color) several times so that each 'new layer' follows the previous layer and offsets itself a certain amount of pixels...say 20px for example.

I found a simple expression that I applied to the first dup'd layer and it works fine but I can't figure out where to tell it to offset 20px to the left of the main layer.

thisComp.layer("Black Solid 1").transform.position.valueAtTime(time -.1);

I suppose I'm trying for a cascading effect + offset.

Thanks!

gj

Topics

Expressions

Views

17.2K

Likes

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
Guide ,
Aug 08, 2012

Copy link to clipboard

Copied

Like this:

thisComp.layer("Black Solid 1").transform.position.valueAtTime(time -.1) - [20,0];

Dan

Likes

3 Likes

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
Reply
Loading...
New Here ,
Aug 08, 2012

Copy link to clipboard

Copied

Easy enough...for you that is! Thanks Dan!

Cheers,

gj

Likes

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
Reply
Loading...
Guide ,
Oct 23, 2012

Copy link to clipboard

Copied

This doesn't seem to work for Illustrator paths converted to shapes. AE sends error: "couldn't find layer named 'shape-1'" -- this seems to be because AE doesn't think of converted shapes as "layers." -- ??

Is there an expression workaround?

Likes

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
Reply
Loading...
Guide ,
Oct 23, 2012

Copy link to clipboard

Copied

That expression should work fine with any type of layer. Maybe the layer's name isn't precisely 'shape-1'. Is it possible there's an extra space or dash, or a capitalization, or spelling mismatch? If you used the pickwhip you should be OK though.

Or are you trying to get at one of the groups within the shape layer? That would be a different issue.

Dan

Likes

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
Reply
Loading...
Guide ,
Oct 23, 2012

Copy link to clipboard

Copied

Everything is spelled correctly. Yes, the problem seems to be that I'm trying to refer to shape groups, not proper layers. This was done by importing an Illustrator file and then creating shapes from vector layer. (Each shape gets its own "group," which apparently AE doesn't see as layers.)

This is also weird, since simple expressions, such as

content("shape-1").transform.position-100

work fine. I guess that's because there's no layer reference, only a reference to the shape name, "shape-1".

Is there a way for an expression to address position and time for these "non-layer" shapes?

Thanks for your help.  :+)

Likes

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
Reply
Loading...
Guide ,
Oct 23, 2012

Copy link to clipboard

Copied

If you wanted another layer to follow a particular group's position with a .1 second delay, you could do it like this:

L = thisComp.layer("shape-1");

L.toComp(L.content("Group 1").transform.position, time-.1)

For another group within the same shape layer, it would be like this:

content("Group 1").transform.position.valueAtTime(time-.1)

Dan

Likes

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
Reply
Loading...
DrStrik9 LATEST
Guide ,
Oct 23, 2012

Copy link to clipboard

Copied

content("shape-1").transform.position.valueAtTime(time-.1) - [100];

IT WORKS!

Thanks MUCH.  :+)

Likes

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
Reply
Loading...