Hi, I'd like to disconnect the outputs of some selected nodes… but I can't find a hou.Node.setoutput … there's only setinput.
so is the only way to find the node that it is connected to, then run a setinput(None) on that other node's input?
hom node set output?
4143 3 1- josh3light
- Member
- 120 posts
- Joined: Feb. 2008
- Offline
- graham
- Member
- 1909 posts
- Joined: Nov. 2006
- Offline
- graham
- Member
- 1909 posts
- Joined: Nov. 2006
- Offline
For completeness sake, here's the code to do it:
connections = mynode.outputConnections()
for connection in connections:
output_node = connection.outputNode()
index = connection.inputIndex()
output_node.setInput(index, None)
Depending on exactly what your circumstances are, you could also just call hou.Node.outputs() to get all the nodes connected to the output and then just blindly clear all their inputs or delete them or whatever else. The above code merely just ensures you are only disconnecting the particular input that is connected to the node.
connections = mynode.outputConnections()
for connection in connections:
output_node = connection.outputNode()
index = connection.inputIndex()
output_node.setInput(index, None)
Depending on exactly what your circumstances are, you could also just call hou.Node.outputs() to get all the nodes connected to the output and then just blindly clear all their inputs or delete them or whatever else. The above code merely just ensures you are only disconnecting the particular input that is connected to the node.
Graham Thompson, Technical Artist @ Rockstar Games
- josh3light
- Member
- 120 posts
- Joined: Feb. 2008
- Offline
-
- Quick Links