HI,can i use script to disconnected two nodes?

   4806   2   1
User Avatar
Member
4 posts
Joined: Nov. 2014
Offline
i want to disconnected two node in houdini, but i don't find a function to do it, anyone know how to do?
thx
User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
With hou.NodeConnection class

import hou
nodes = hou.selectedNodes()
for node in nodes:
#disconnect inputs:
ins = node.inputConnections()
for inCon in ins:
inIndex = inCon.inputIndex()
inNode = inCon.outputNode()
inNode.setInput(inIndex,None,0)

#disconnect outputs:
outs = node.outputConnections()
for outCon in outs:
outIndex = outCon.inputIndex()
outNode = outCon.outputNode()
outNode.setInput(outIndex,None,0)


Or simple disconnection of all 4 inputs of the node that you can do in recursion on all chained nodes:

import hou
nodes = hou.selectedNodes()
for node in nodes:
# simple disconnect all of 4 inputs
User Avatar
Member
4 posts
Joined: Nov. 2014
Offline
thank you very much pezetko, i will try this way to finish my work at the last day of 2014, what a great finish of this year~!
  • Quick Links