Copy link to clipboard
Copied
Hey,
Little bit unsure whats going on here (AE 22.5):
Have 2 Squares (with Path Pos [0,0] and Path Transform Anchor / Pos [0,0]). Am trying to Pan-Behind the Anchor of Left Square to the Position of Right Squares Anchor using Expressions:
So figuring is: Left Squares Anchor Point is where it's Crosshair is in it's Layer Space, so Anchor values don't care about Parent as Parent only affects Space in which Position works (Childs Position is where Crosshair is in Parents Layer Space). So can convert Right Squares Anchor to Comp Space and then take that value from Comp Space to Left Squares Layer Space. This is correct.
Then figured, could just offset the Position by adding the Anchor value to Left Squares Position (which is all Pan-Behind is doing?)
However the Square goes to the left as if the Position expression is doing nothing xD:
UNTIL the Position value is touched and then the Square is in the correct position as it should be BUT it's invisible:
Maybe I don't understand how Expressions work between properties. I assumed that if a Property references another property (with an expression on), then the value it gets back is AFTER the Expression has been applied. Like here with Dans script for time remapping audio, the Time Remap is taking the values from thes Slider after the ease has been applied:
So i don't get why Position isn't taking the values from Anchor Point correctly.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I don't have time right now, but I will look at your project file later today.
toComp and toWorld will return 2D coordinates for 3D layers, but they will not work in reverse. You can use toComp to tie the position of a 2D effect like the center of a Lens Flair to the position of a 3D layer like a comp light, but you can't take the position of a 2D effect on a 3D layer and extract the 3D position of that effect.
For example, you can create a shape layer path, then use the Create Nulls from Paths/Track script to make a null follow that path. If you make the Shape layer 3D and the Null 3D, parent the null to the shape layer, then rotate the shape layer, you cannot retrieve the 3D position of the null that looks like it is moving in Z space. All you can get are the 2D coordinates of the null.
Copy link to clipboard
Copied
That doesnt answer the question unfortunately. to/fromComp is being used correctly above.