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. I seem to run into issues trying to insert a string.
I am trying to add the prefix HMM, or HMF based on a slider setting and 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. I then have a detail string attribute “GENDER”, that gets the local variable $ATT based on which way the switch is flipped. I cannot seem to place that detail string attribute in my filename. Also tried a local variable $ATT without success. The local variable seems to not be recognized by the ROP.
I have tried,
$HIP/`chs(“GENDER/string1”)`_LEG_Default.`chs(“switch_LEG_Manual/input”)`.obj - i get nothing.. _LEG_Default.
$HIP/`chsraw(“GENDER/string1”)`_LEG_Default.`chs(“switch_LEG_Manual/input”)`.obj - I get the $ATT , the local variable but not its actual value its storing of (hmm or hmf)
$HIP/`details(“../GENDER”,“GENDER”)`_LEG_Default.`chs(“switch_LEG_Manual/input”)`.obj - i get nothing.. _LEG_Default.
$HIP/`detail(“../GENDER”,“GENDER”,0)`_LEG_Default.`chs(“switch_LEG_Manual/input”)`.obj - i get a 0_LEG_Default.
Any ideas? or a better approach to making dynamic file names in a rop?
Thanks.
Using expressions to create a filename in a ROP
4303 2 1- Kfinla
- Member
- 100 posts
- Joined: 8月 2014
- Offline
- Enivob
- Member
- 2633 posts
- Joined: 6月 2008
- Offline
- Kfinla
- Member
- 100 posts
- Joined: 8月 2014
- Offline
Enivob
I would probably just drop down a Python node and do all my string concatenation in Python. Then assign the final string to the parameter in ROP.
I think that's a good idea. I made a simple scene and got things working immediately. It seems there are gremlins (bad parameter ref's) in the Rop's I have linked to my HDA.
-
- Quick Links