Jump to content
davo

How Do You Ref $pt At Root Level Of Otl (da)

Recommended Posts

Hi Folks,

How do you reference $PT, from a node inside a digital asset, at the top level through the promoted parameters?

Seems like it would be a natural thing to do but it doesn't pass through using the ch or chs function.

Any ideas or corrections?

:David

Edited by davo

Share this post


Link to post
Share on other sites

You can try using the point() expression...

Share this post


Link to post
Share on other sites
You can try using the point() expression...

I tried that, no good. Doesn't error the node, but doesn't pass it. Plus in my case it would require me to use the $PT variable, which is the

problem to begin with.

;D

Edited by davo

Share this post


Link to post
Share on other sites

what are you trying to do?

you could create a parameter at the top level and then use that as a reference down in SOPs or where ever...

check out this example file...

the myPoint parameter will tell the rivet object inside what point on the curve to attach to...

HTH

pointExample.otl

Share this post


Link to post
Share on other sites
what are you trying to do?

you could create a parameter at the top level and then use that as a reference down in SOPs or where ever...

check out this example file...

the myPoint parameter will tell the rivet object inside what point on the curve to attach to...

HTH

Hi,

I know you are trying to help, but the example is just the same as standard promoted parameter, it is just created through the type properties

dialog box and then manually referenced, no?

What I am trying to do is, is animate at the top level based on an inside node's value of $PT, without having to go into the asset, to manually change it (just for convenience). So it would be like promoting one of the curve's parameters and typing in $PT or some arbitrary expressions based upon $PT.

You would think someone has run into this sometime before.

:D

Edited by davo

Share this post


Link to post
Share on other sites

Local variables are only when evaluated inside the appropriate parameter of the appropriate SOP. Doing a ch() expression will cause the referenced parameter to be evaluated relative to the referenced parameter's owner, not the ch() expression's owner node. So to do what you want, you need to evaluate the raw expression of your referenced parameter inside a parameter that can use local variables, eg. using eval(chs()) or eval(chsraw()). I've attached an example.

promote_localvars.hip

Share this post


Link to post
Share on other sites
Local variables are only when evaluated inside the appropriate parameter of the appropriate SOP. Doing a ch() expression will cause the referenced parameter to be evaluated relative to the referenced parameter's owner, not the ch() expression's owner node. So to do what you want, you need to evaluate the raw expression of your referenced parameter inside a parameter that can use local variables, eg. using eval(chs()) or eval(chsraw()). I've attached an example.

Hi Edward,

Didn't have time to check out your file, but the eval() worked great in combination with chsraw().

I have a clearer understanding now.

Thanks!

D

Edited by davo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×