On object level I am trying to store and disconnect an input, do in the same script some transforms and reconnect the stored input again. It gives me errors. Is there something I am overlooking?
deftest():selected=hou.selectedNodes()forkeesinselected:inputs=kees.inputs()print(inputs)inputs=str("'"+(str(kees.inputs())[30:][:-3])+"'")print(inputs)kees.setFirstInput(None)#do all kind of transformation stuffkees.setFirstInput(hou.node(inputs)
You can get the input node's path directly and use it instead of getting it using string slice.
deftest():selected=hou.selectedNodes()forkeesinselected:inputs=kees.inputs()print(inputs)kees.setFirstInput(None)#do all kind of transformation stuffkees.setFirstInput(hou.node(inputs[0].path()))