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

Getting global coordinates from parented local coords.

Enthusiast ,
Oct 29, 2010 Oct 29, 2010

I have a mocha tracked null. I child another null thats slightly offset in XY. Now the child's coordinates are relative to the parent. But how can I get the child's true position in the comp?

This seems too easy:

thisComp.layer("parentNULL").transform.position + thisComp.layer("childNULL").transform.position

Am I missing something?

TOPICS
Expressions
3.9K
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 ,
Oct 29, 2010 Oct 29, 2010

That should work if they're both nulls, but this is probably the better way to do it:

thisComp.layer("childNULL").toWorld([0,0,0])

Or maybe this, if it's all 2D stuff:

thisComp.layer("childNULL").toComp([0,0,0])

Dan

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
Enthusiast ,
Oct 29, 2010 Oct 29, 2010
LATEST

Aha! Fantastic! I was getting some minor misalignment errors with my method. Yours is spot on! Thank you!

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