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

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

New Here ,
Apr 08, 2024 Apr 08, 2024

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
212
Translate
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

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

Translate
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

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.

Translate
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
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.

Translate
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