Skip to main content
Known Participant
February 11, 2024
Answered

Can't use thisComp in a path on parented text. How can I overcome this?

  • February 11, 2024
  • 2 replies
  • 872 views

I want to rotate three words around a null object. Easy. Parent the words to the null and hit one rotation property. Then, apply this "value - parent.transform.rotation" on each word's rotation to keep them upright.

 

I then wanted to make it look better by having lines between the words. The points of each line are references using thisComp to point to the words as shown below:

 

p1 = thisComp.layer("Word1").position;
p2 = thisComp.layer("Word2").position;
pts = [p1, p2];
createPath(pts, inTangents = [], outTangents = [], isClosed = false)

 

This does not work because the expression can't use thisComp to connect the lines. This is because the line points then go to 0,0, which is what the anchoring values become when parented to the null. Now I need a better configuration or expressions to make it work with just a null, three words and three lines. I am trying to create a fluid triangle shape based on the layer's position but only needing one rotation property to the keyframe instead of keyframing each word's positions and making non-uniform triangles.

 

 

 

This topic has been closed for replies.
Correct answer Dan Ebberts

You're probably looking for something like this:

L1 =thisComp.layer("Simplifi");
L2 = thisComp.layer("RFiD");
p1 = fromComp(L1.toComp(L1.anchorPoint));
p2 = fromComp(L2.toComp(L2.anchorPoint));
p =[p1,p2];
createPath(p,[],[],false)

2 replies

Legend
February 11, 2024

You can parent the Shape Layer to the Null and set the position to [0,0]

 

Text Layers Position:

radius = 400;
x = Math.cos(degreesToRadians(120) * (index - 1)) * radius;
y = Math.sin(degreesToRadians(120) * (index - 1)) * radius;
[x,y]

 

Text Layers Rotation:

value - parent.rotation

 

Shape Layer Path:

p1 = thisComp.layer("Word 1").position;
p2 = thisComp.layer("Word 2").position;
p3 = thisComp.layer("Word 3").position;
pts = [p1, p2, p3];
createPath(pts, inTangents = [], outTangents = [], isClosed = true)

 

 

Known Participant
February 12, 2024

Thank you, this looks interesting. I definitely need to use a lot more math equations like this. It seems to have a lot more functionality than boring entry-level basics.

Mylenium
Legend
February 11, 2024

Convert the coordinates using toWorld() or whatever other layer space transform method is appropriate.

 

Mylenium

Known Participant
February 11, 2024

Could you please explain how this would work with an example? I need to learn this. I wouldn't know what layers space transform method is appropriate.  It's very much in a minimalist phase

 

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
February 11, 2024

You're probably looking for something like this:

L1 =thisComp.layer("Simplifi");
L2 = thisComp.layer("RFiD");
p1 = fromComp(L1.toComp(L1.anchorPoint));
p2 = fromComp(L2.toComp(L2.anchorPoint));
p =[p1,p2];
createPath(p,[],[],false)