Copy link to clipboard
Copied
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.
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)
Copy link to clipboard
Copied
Convert the coordinates using toWorld() or whatever other layer space transform method is appropriate.
Mylenium
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
Thank you, this worked. That is precisely what I needed for this project.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.