Hello,
Can someone give me a hint on how to conditionally return a string within an expression? I've tried several different syntax but can't seem to get it right. The “ifs” never resolves when I middle-click to see the value (shown in “resolved.png”). It resolves both paths correctly, but doesn't return just one. I'm sure I'm missing some single quotes somewhere or something…any help is really appreciated.
Thanks,
Caesar
ifs in expression for file output
1958 3 0- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
Because it is a string parameter your ifs() needs to be wrapped in `` to cause it to evaluate as an expression. This also then requires you to modify the string formatting of everything else since they aren't being treated as actual strings, expression-wise. The following should evaluate as you expect:
`ifs(1==1, “$HIP/render/” + opname(“../..”) + “/$OS.$F4.png”, “$HIP/render/” + opname(“../..”) + “/$OS.png”)`
Also in your specific example, you could make the ifs() less complex and only handle the addition of the $F4 to the path:
$HIP/render/`opname(“../..”)`/$OS`ifs(1==1, “.$F4”, “”)`.png
`ifs(1==1, “$HIP/render/” + opname(“../..”) + “/$OS.$F4.png”, “$HIP/render/” + opname(“../..”) + “/$OS.png”)`
Also in your specific example, you could make the ifs() less complex and only handle the addition of the $F4 to the path:
$HIP/render/`opname(“../..”)`/$OS`ifs(1==1, “.$F4”, “”)`.png
Graham Thompson, Technical Artist @ Rockstar Games
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
-
- Quick Links