ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Convert Shape Layer object space to Comp Space

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brady Baltezore
Convert Shape Layer object space to Comp Space
on Mar 21, 2020 at 12:55:23 pm
Last Edited By Brady Baltezore on Mar 22, 2020 at 12:23:25 am

(There's a very similarly named thread on here from a few years ago, but it seems to convert the info in the opposite direction I'm trying to)

I have a shape layer with a number of ellipses, the positions of which are being driven by sliders on another null. Great.
The ellipses are in pairs, each heading in the opposite direction of one another.

I'm trying to create a line that emerges as each pair separates (connecting the dots essentially) and I'd really like the lines' end points to be driven by the position of each ellipse.

I tried creating a layer with a beam effect, and connecting the start and end point to the position of the relevant ellipses.
However, shape layer space and comp space are separate, and toComp doesn't seem to work within a shape layer?

Any help appreciated!


Return to posts index

Andrei Popa
Re: Convert Shape Layer object space to Comp Space
on Mar 24, 2020 at 10:14:55 am

I don't think you need that information to create the links.
I suggest you create a Path and add this expression to it. That way, you can have all the benefits from shapes(stroke width, color, dots, linecap etc)
You can even create it in the same layer with the ellipses. If you create the Path in the same layer, add this expression to it:

pos1 = content("Ellipse 1").transform.position;
pos2 = content("Ellipse 2").transform.position;
dots = [pos1,pos2];

If you want a different layer, make sure both have the same position(you can link the position of this second layer to the one with the ellipses) and add this expression to your Path:

pos1 = L.content("Ellipse 1").transform.position;
pos2 = L.content("Ellipse 2").transform.position;
dots = [pos1,pos2];

My Envato portfolio.

Return to posts index

Brady Baltezore
Re: Convert Shape Layer object space to Comp Space
on Mar 24, 2020 at 1:44:14 pm
Last Edited By Brady Baltezore on Mar 24, 2020 at 1:45:32 pm


Thank you so much! I was not aware that you could use expressions to create paths, so thank you - this worked perfectly. I had actually built it with the two dot colors each on their own separate layers, but it was easy enough to create a new layer for the lines and write:

pos1 = thisComp.layer("DOTS_layer01").content("DOT_01").content("DOT 1").position;
pos2 = thisComp.layer("DOTS_layer02").content("DOT_01").content("DOT 1").position;
dots = [pos1,pos2];

Appreciate your suggestion, problem solved. Still curious about the original way, for future purposes

Thanks again,

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved