VEX chsop, return node path?

   1416   3   0
User Avatar
Member
340 posts
Joined: June 2013
Online
https://www.sidefx.com/docs/houdini/vex/functions/chsop.html [www.sidefx.com]
"Evaluates an operator path parameter and return the path to the operator."

I expecting that if I pass "/obj/geo1/box1/scale" to it, to get in return, "/obj/geo1/box1" but instead I get the value of the parameter "1". Is this a docs problem or am I missing something?

Thanks
Edited by probiner - Sept. 20, 2021 09:26:55

Attachments:
PRB_chsop.hiplc (90.0 KB)

User Avatar
Member
8622 posts
Joined: July 2007
Offline
chsop() VEX is similar to chsop() expression which has much better worded explanation
https://www.sidefx.com/docs/houdini/expressions/chsop.html [www.sidefx.com]

so essentially, it evaluates string (or operator path) parameter and expects to find a path to the operator
it will turn it to full path string
chsop("parm")is sort of like opfullpath(ch("parm"))
I wouldn't guarantee that it's exactly the same, but without thinking about it too much the use roughly seems the same to me
Edited by tamte - Sept. 20, 2021 12:12:49
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
340 posts
Joined: June 2013
Online
tamte
chsop() VEX is similar to chsop() expression which has much better worded explanation
https://www.sidefx.com/docs/houdini/expressions/chsop.html [www.sidefx.com]

so essentially, it evaluates string (or operator path) parameter and expects to find a path to the operator
it will turn it to full path string
chsop("parm")is sort of like opfullpath(ch("parm"))
I wouldn't guarantee that it's exactly the same, but without thinking about it too much the use roughly seems the same to me

I see now, so what I was trying to get out of it doesn't make sense. Although to add to your info, while opfullpath() won't return the full path of a parm reference in a string parm with "../box1/scale", chsop() will return the fullpath "/obj/geo1/box1/scale"

Cheers
User Avatar
Member
8622 posts
Joined: July 2007
Offline
probiner
Although to add to your info, while opfullpath() won't return the full path of a parm reference in a string parm with "../box1/scale", chsop() will return the fullpath "/obj/geo1/box1/scale"
Did you try opfullparh(ch()) though? as that's what you need to do to evaluate the parm value first so that it returns "../boxes/scale" for opfullpath to convert for the same result as with chsop() alone
Edited by tamte - Sept. 21, 2021 16:52:16
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links