Python: Creating nodes without the view 'jumping' to an other context?

   3728   5   0
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
Hi,


I'm using a python sop to copy some nodes to a subnet. But every time the python sop is evaluated, the ‘view’ jumps to that other view, showing the newly created nodes.

Thing is that if the network is correct, this prevents me from diving into certain nodes that contain the py sop, as the node is re-cooked and therefore I'm ported automatically to the new nodes.

Is there a way to prevent this?
Edited by deadalvs - Nov. 11, 2016 09:19:03
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Maybe I'm not understanding what your asking…but if it is what I am thinking; Each network view has a ‘pin’. So you could create more than one network view, and pin(lock) which ones you don't want to change.
User Avatar
Staff
3456 posts
Joined: July 2005
Offline
it sounds like once the node(s) are created they are being set to ‘current’ which makes the view jump.
see
https://www.sidefx.com/docs/houdini15.5/hom/hou/Node [sidefx.com]
down in the Selection section
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
2565 posts
Joined: June 2008
Offline
Try clicking the StickPin icon on the window you don't want to change.
Edited by Enivob - Nov. 13, 2016 09:51:12
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
hi,

that is one option, yes.

I don't see this is possible programmatically. ah well.

thanks!
matt
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Hi, I had the same problem and just found out that u can just write node.setPicked(1) just after you create a node.
“node” would be the node you want stay with.
Example:
myNode = hou.pwd()
obj = hou.node("/obj/")
obj.createNode("cam" , "myNewCam")
myNode.setPicked(1)  #let's go back to myNode level

cheers
  • Quick Links