Vex - get parameter from other node

   4750   3   0
User Avatar
Member
13 posts
Joined: April 2019
Offline
Hi,
In a attrib wrangle, I'd like to query another node parameter value.
Is there a way to do that in a single line of code?


I usually create a chf() in my wrangle node and paste the paramater as reference in this chf param, but it's really tedious…

It seems
ch(int op_id, int parm_index, int vector_index)
can give me what I want but I don't know how to find the op_id.
Is there a way to do that using the nodes path ( ‘/obj/ctrl’ etc) ?

Thanks
Edited by BenWall - May 15, 2020 04:07:32
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Hi there,
the doc relative to ch() says to use https://www.sidefx.com/docs/houdini/vex/functions/chid.html [www.sidefx.com] to get the opid
User Avatar
Member
8538 posts
Joined: July 2007
Offline
No, it's not better to reference other nodes from VEX because you not only lose dependency tracking, therefore renaming the other object would break your code but also you will not be able to jist reuse that node in other project without reediting

I'd stick with local UI and referencing parms you need

If however you really want to do that you can literally just put full path to functions like chf() and others
chf(“/full/path/to/parm”)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
13 posts
Joined: April 2019
Offline
Thanks for your replies.

@tamte: Agreed, but on short personal tests which do not need to be reused, I like to make it quick

I also like having one big “CTRL” null node with an edited parameter interface, which means my path will mostly point to “../CTRL/param”
Edited by BenWall - May 18, 2020 01:08:44
  • Quick Links