Jump to content
Sign in to follow this  
cudarsjanis

[SOLVED]Expression in Geometry ROP node

Recommended Posts

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

Share this post


Link to post
Share on other sites
Are you overthinking it? 

strreplace($HIP, "light", "fx")

 

right?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

  • Like 1

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
Sign in to follow this  

×