Bart87 Posted November 20, 2017 Share Posted November 20, 2017 Hi, I am trying to do my asset for houdini and I am looking a method which can allow me to connect one node to anoter I use something like this, but this option is connecting everything to imput1 ('grey imput') staticsolver = doptoolutils.createSolver("staticsolver", True) - create staticsolver node staticobject = dopnet.createNode("staticobject") - create staticobject node doptoolutils.addObjectToSolver(staticobject, staticsolver, True) - connect staticobject to staticsolver but some nodes has more inputs: multisolver has 2 inputs one is grey and another purple - how I can connect my node to the purple one using python language? and another constraintnetwork has 3 inputs, one grey, green and purple and also if merge node has 3 inputs connected, how I can tell which should be first? I need explanation how I can connect something to each input. I found something like this but I dont understand what I should write to make it works:http://www.sidefx.com/docs/houdini/hom/hou/NodeConnection.html#outputNode if someone can write to me an example how should I write my script lines which show how I should connect node to purple input in multisolver, how to connect to green and purple input for constraintnetwork and how to define which is the first input in merge node. I attached picture as example what I want to connect to. Thank you Bart Quote Link to comment Share on other sites More sharing options...
Atom Posted November 20, 2017 Share Posted November 20, 2017 (edited) Check out the help docs on setInput() function. You need two variables, the node to connect and the node to connect to. The value of 0 is the zero based input to connect to. node_source.setInput(0,node_target) node_source.setDisplayFlag(True) node_target.moveToGoodPosition() Edited November 20, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
Bart87 Posted November 20, 2017 Author Share Posted November 20, 2017 (edited) 15 minutes ago, Atom said: Check out the help docs on setInput() function. You need two variables, the node to connect and the node to connect to. The value of 0 is the zero based input to connect to. node_source.setInput(0,node_target) node_source.setDisplayFlag(True) node_target.moveToGoodPosition() I have done something like this, but doesnt work staticsolver = dopnet.createNode("staticsolver") staticobject = dopnet.createNode("staticobject") staticobject.setInput(0,staticsolver) staticobject.setDisplayFlag(True) staticsolver.moveToGoodPosition() Edited November 20, 2017 by Bart87 screenshot Quote Link to comment Share on other sites More sharing options...
Atom Posted November 21, 2017 Share Posted November 21, 2017 Wouldn't it be the other way around? Did you try... staticsolver.setInput(0,staticobject) Quote Link to comment Share on other sites More sharing options...
Bart87 Posted November 21, 2017 Author Share Posted November 21, 2017 (edited) 1 hour ago, Atom said: Wouldn't it be the other way around? Did you try... staticsolver.setInput(0,staticobject) Hay, I found the mistake there should be staticsolver.setInput(0,staticobject,0) 1st zero is for input to my staticsolver and 2nd zero is for my staticobject output. so you only missed one zero but its help me a lot to understand what to do... Thank you!!! Edited November 21, 2017 by Bart87 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.