Jump to content

Using expressions to create a filename in a ROP

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?



Share this post

Link to post
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.

Share this post

Link to post
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.

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