Jump to content
art3mis

The need for {} in path values

Recommended Posts

I understand the need sometimes for back ticks to evaluate expressions but don't understand why parentheses are sometimes necessary

 

ie

$JOB/export/${HIPNAME}_$OS_mesh.fbx

fails but

$JOB/export/${HIPNAME}_${OS}_mesh.fbx

succeeds.  Why doesn't JOB as well need to be in parentheses? Seems inconsistent.

Edited by art3mis

Share this post


Link to post
Share on other sites

Underscore is a valid character inside variable names (e.g: $HOUDINI_PATH), you need curly braces to enforce word boundaries. Or use non-valid characters as delimiters like "." as suggested default. Evaluate string with MMB to see if it is correct.

  • Thanks 1

Share this post


Link to post
Share on other sites

You can create a linked field that displays the expression evaluated. Makes it easy to see valid delimters.

Screen Shot 2017-09-08 at 6.27.41 AM.png

Screen Shot 2017-09-08 at 6.27.33 AM.png

  • Like 1

Share this post


Link to post
Share on other sites

@marty please how did you link those channels? If I put relative reference `chs("file")`  in the EXPANDED channel, it evaluates on MMB, but I see dotted outline. Do you have another trick please?

ref.PNG.f98644dcf1e31f06e9a2ea651333f799.PNG

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

×