cudarsjanis Posted October 22, 2019 Share Posted October 22, 2019 Hi could anyone help me with this expression that I use in Geometry ROP node in OUT context? basically I just need to look for /light/ in the string and if it`s there replace it with /fx/ Here`s what my expression looks now. and If I save hiop somewhere else expression breaks `strreplace(strreplace($HIP, houdini/hip, cache), P:, V:)`/cache_001.$F4.bgeo.sc V:/project/sequences/201/201_0020/fx/work/cache/cache_001.0957.bgeo.sc $HIP - P:/project/sequences/201/201_0020/fx/work/houdini/hip $HIP(in lighting) - P:/project/sequences/201/201_0020/light/work/houdini/hip look for /light/ if there is no /light/ in the string do nothing else replace with /fx/ Thanks a lot Janis Quote Link to comment Share on other sites More sharing options...
kleer001 Posted October 22, 2019 Share Posted October 22, 2019 Are you overthinking it? strreplace($HIP, "light", "fx") right? Quote Link to comment Share on other sites More sharing options...
cudarsjanis Posted October 22, 2019 Author Share Posted October 22, 2019 18 minutes ago, kleer001 said: Are you overthinking it? strreplace($HIP, "light", "fx") right? I need to get an if statement that replaces /light/ to /fx/ only if there is a /light/ in the path, if there isn`t then just leave it as it is. Quote Link to comment Share on other sites More sharing options...
cudarsjanis Posted October 22, 2019 Author Share Posted October 22, 2019 Turns out expression doesn`t error out if it can`t find light in the path. so no need to use if statement. All works now. Cheers 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.