how to get selectedNodes from user by press enter!

   2260   4   2
User Avatar
Member
46 posts
Joined: Jan. 2012
Offline
hi all advances!
have anybody know how to give user “selecte Node”,
just like the houdini default tools.
I just got way to select “obj” & “sop” level from “sceneView”
I want to get from other level nodes.

PS.
I want to make a “reference copy” type function,
but it's not to make a new node.
just for selected any level two nodes,
first selected is source parms, and second selected is dest.
I will make a loop every parm on dest node,
and make every dest match source parm,
then make they connect! (match by parm speceifed node name)

thanks !!
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
did your mean found a way to take selected node in the other place or sop level ?

maybe this is your answer :
use this python script to access selected node by user in the scene view

hou.selectedNodes()
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
46 posts
Joined: Jan. 2012
Offline
Thanks Joker
unfortunally, that isn't what I mean.
I want to selected one more level nodes in the same time.
example:
I selected ‘geo1’ sop & ‘mantra1’ out,
then use hou.selectedNodes(), only will return ‘mantra1’.
is it posible to return all of nodes in different level?

I'm trying to reference sop vop noise parameter with shop vop noise parameter.
I just try to make it procedual.

No matter how, I really thank you reply me, really thx
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
Houdini won't let you select multiple nodes in different contexts. You'll have to use the node chooser widget to select the other node.

hou.ui.selectNode()
http://www.sidefx.com/docs/houdini12.5/hom/hou/ui [sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
106 posts
Joined: June 2011
Offline
As graham said, if you wanna select multiple nodes in different contexts, you have to use the UI widget. But if you just want to create parameter reference you can do something like this without selecting nodes


amp1 = hou.node(“/obj/geo1/vopsop1”).parm('amp')
amp2 = hou.node(“/shop/vopmaterial1”).parm('amp')
relPath = amp2.node().relativePathTo(amp1.node())
amp2.setExpression('chs(“%s/%s”)' % (relPath, amp1.name()), hou.exprLanguage.Hscript)


P.S
If you want to select the nodes to create parameter reference, you can use the UI widget to select the nodes and assign it to variables and change the above function accordingly. Hope this helps

Cheers
-J
  • Quick Links