Jump to content
Sign in to follow this  
jporter313

After Effects: Getting world space coordinates of parented null

Recommended Posts

Hi, I have a hierarchy in After Effects and I'm trying to lock a position parameter of a spherize effect on another layer to a Null that I have parented into the hierarchy, getting the sphere to follow the Null. Because the null is parented, I need to find it's world space for the expression to work since it's position values con't change when it moves. I've found several references to this expression:

 

lay = (pickwhip the child null layer) ;

pos = lay.toWorld( lay.anchorPoint);

 

Such as here:

 

http://www.videocopilot.net/forum/viewtopic.php?f=5&t=24113

 

Seems to work for everyone else, but when I implement it, I get this error:

 

After Effects warning: Function lay.toWorld is undefined Expression disabled.

 

Error occured at line 2.

Comp 'XXXXXXXX'

Layer 17 ('HelmetReflectionAnimated')

Property: 'Center of Sphere'

 

Any ideas what I might be missing?

Share this post


Link to post
Share on other sites

What exactly? Post your own code. Not much point in referencing other people's template code when you could be doing something as trivial as having a typo somewhere in your own variation...

 

Mylenium

Share this post


Link to post
Share on other sites

Please, please do a site-specific Google search of this forum next time! I personally have answered this one three times, and much as it should be a sticky, it isn't. THREAD

 

You haven't put the array at the end of the code, even if the function were defined. Your code should look like this:

 

lay = thisComp.layer("Parent NULL")

wrld=lay.toWorld(lay.anchorPoint);

[wrld[0],wrld[1]]

Share this post


Link to post
Share on other sites

Sorry guys it's been really busy this week. I figured out the problem a bit after posting this. In case anyone needs the answer, the expression I used was:

 

lay = PICKWHIP TARGET LAYER;
lay.toWorld(lay.transform.anchorPoint);

 

The problem seems to have been the "pos =" part, don't know where that came from in the examples.

 

iline, I did search for this, didn't have much luck, maybe I was just searching using the wrong terms.

 

Thanks for the help guys.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...