• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Strange toComp() Expression Issues

Community Beginner ,
Jul 27, 2022 Jul 27, 2022

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:

2022-07-27_12-07-34.png

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:

2022-07-27_12-17-14.png

UNTIL the Position value is touched and then the Square is in the correct position as it should be BUT it's invisible:

2022-07-27_12-18-52.png

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:

2022-07-21_09-07-32.png

So i don't get why Position isn't taking the values from Anchor Point correctly. 

 

 

 

 

 

 

TOPICS
Expressions

Views

254

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

Proj file is attached AE 22.5

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2022 Jul 27, 2022

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.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

LATEST

That doesnt answer the question unfortunately. to/fromComp is being used correctly above.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines