Jump to content

Using expressions to create a filename in a ROP


Spaz8

Recommended Posts

So I have a scene that composites a bunch of meshes together. What I want to do is build a descriptive filename based on parameters I have set. For example if the mesh is male or female, what version of pants, or shirt is it using etc. 

I have a ROP with a two expressions in it. The 2nd expression `chs("switch_LEG_Manual/input")` seems to work fine because it is just concatenating a numeric value (0-5) based on a slider position.

However trying to add the string prefix HMM, or HMF I'm not having luck.  First I tried to use an IF statement, but could not replace the true, false values of 0 and 1 with strings. So I made some detail - string attributes with the prefixes, and then a switch node to pitch the appropriate prefix, but cannot seem to place that detail string attribute in my filename. Aslo tried a local variable $ATT without success.

I have tried, 

$HIP/Clothes_Fitter_Output/LEG_output/`chs("GENDER/string1")`_LEG_Default.`chs("switch_LEG_Manual/input")`.obj  - i get nothing.. _LEG_Default.

$HIP/Clothes_Fitter_Output/LEG_output/`chsraw("GENDER/string1")`_LEG_Default.`chs("switch_LEG_Manual/input")`.obj   - I get the $ATT local variable but not its actual value of (hmm or hmf)

$HIP/Clothes_Fitter_Output/LEG_output/`details("../GENDER","GENDER",0)`_LEG_Default.`chs("switch_LEG_Manual/input")`.obj -

 

Any ideas? or a better approach to making dynamic file names in a rop?

 

Thanks.

Link to comment
Share on other sites

Your expressions look fine, so I suspect something else is wrong with your setup. Maybe you could make a simple asset that just reproduces the issue you are having and post that. Alternatively if you're looking for a different approach you could always try python expressions instead.

Link to comment
Share on other sites

Thanks. I made a simple scene and got things working immediately. It seems there are gremlins in the Rops I have linked to my HDA. I might try doing all the concatenating with python and just put the final result into the rop.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...