Disconnect all inputs from an op

I was trying to figure out how to disconnect all inputs from an op (without disconnecting them one at a time). I searched the forums and the only posts I found seemed to indicate that this isn’t a feature at the moment.

The solution I have for now is this little script:

#path to op you want to disconnect all inputs from
op_path = "layout1"

op_ins = op(op_path).inputConnectors

for i in range(len(op_ins)-1):
    op_ins[0].disconnect()

Does anyone know of a better way? Seems like something that should be in a rightclick menu or in the Input Ops section of the parameter window, but I haven’t seen it.

2 Likes

Thank you for this. I was about to manually disconnect 208 inputs.

Thank you!!

op('your_op').setInputs([])