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

Expression to return the coordinates of the bounding box of a precomp

New Here ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

Hi there, I'm wondering if anyone has an expression that returns the realtime coordinates of a null that is parented to a rotating precomp.

 

The issue I'm having is that because the null is parented to the precomp, the position and anchor point of the null don't technically change, even though it is rotating based on the rotation of the precomp.

 

Let me know if you need more info.

 

Thanks!

Matt

TOPICS
How to

Views

98

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
New Here ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

It might also be helpful to find an expression that returns the coordinates of the edges of the precomp's bounding box 🙂

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
New Here ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

Screenshot 2024-04-08 at 9.04.31 PM.png

This hopefully describes the problem. I have a layer (could be a shape layer or a precomp) that is rotating from the anchor point at the bottom. I have a null (purple box at the top left of the shape layer) parented to this rotating shape layer. When I try to get the coordinates of the null object, it only gives the coordinates of the null relative to the anchor point of the shape layer, the layer it's parented to.

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 ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

LATEST

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.

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