Copy link to clipboard
Copied
Yes the question is straight forward. Let me know if it possible. Thank you.
The way toComp work is that it converts the coordinates of a point on the surface of a layer to its coordinates on the comp's screen so if it is offseted it may be that your targeted layer's anchor point doesn't match the coordinates that are between the toComp's parenthesis if the point you are trying to match is the layer's anchorpoint... and as rick pointed out that only works if you are trying to get a 2D coordinate otherwise you should use toWorld...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It works but I've a little issue. Whenever I apply toComp([0,0,0]) it have some variation in the result. X position differ by 0.5xxxx and Y Position differ by 74.60xxxx May I know why is it happening?
Copy link to clipboard
Copied
l = thisComp.layer("Null 1");
l.toComp([0,0,0])// returns the position of Null 1 relative to the comp - z axis will not match in 3D layers especially if you start dragging values
l = thisComp.layer("Null 1");
l.toWorld([0,0,0]) // will always match position coordinates for Null 1
Does that make sense? That is how it has always worked.
Copy link to clipboard
Copied
The way toComp work is that it converts the coordinates of a point on the surface of a layer to its coordinates on the comp's screen so if it is offseted it may be that your targeted layer's anchor point doesn't match the coordinates that are between the toComp's parenthesis if the point you are trying to match is the layer's anchorpoint... and as rick pointed out that only works if you are trying to get a 2D coordinate otherwise you should use toWorld...
Copy link to clipboard
Copied
The actual Position of a child layer ("Null 1" in this example) is retrieved by using the toWorld(AnchorPoint) function like this:
L = thisComp.layer("Null 1");
pos = L.toComp(anchorPoint);
If you need more than that, we need screenshots with the modified properties of the problem layers. Select the layers, press the 'u' key twice, then take a screenshot of the entire UI and share it.
Copy link to clipboard
Copied
Yo! If anyone like me had trouble understanding what is going on with the toComp() function and how to use it, I found this really helpful https://www.youtube.com/watch?v=gSq19gpWwSU