• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Offsetting time and position of several layers relative to preceding layer

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

19.2K

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

Copy link to clipboard

Copied

Like this:

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

Dan

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

Copy link to clipboard

Copied

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

Cheers,

gj

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
Guide ,
Oct 23, 2012 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?

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 ,
Oct 23, 2012 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

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
Guide ,
Oct 23, 2012 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.  :+)

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 ,
Oct 23, 2012 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

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

Copy link to clipboard

Copied

LATEST

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

IT WORKS!

Thanks MUCH.  :+)

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