tofujuice

tofujuice

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Python coding problems Jan. 7, 2014, 4:15 a.m.

Thank you graham for the help ! I don't really understand the way to use this codeas this still connects to my main null which has the button when i press several times.


>>> geo = hou.node(“/obj/geo1”)
>>> n1 = geo.createNode(“null”)
>>> n1
<hou.SopNode of type null at /obj/geo1/null3>
>>> n2 = geo.children().createOutputNode(“null”)
>>> n2.inputs()
(<hou.SopNode of type null at /obj/geo1/null3>,)


Furthermore, is there a way to increase the node digit by one every time I click the button as the code,


p2=hou.parm('/obj/geo1/xform1/tx')


will have problems when I create another one due to the naming being xform1 . If i am not wrong, python does not allow string parameter expressions.

Python coding problems Jan. 7, 2014, 1:24 a.m.

Hi all !

I'm trying to make an asset whereby a user can generate a simple game platform by pressing buttons which I'm creating to extend the platform to a direction, however I came across a few problems.
Firstly, I would like to know is it possible to do a similar way of “ copy parameter & paste copied relative references ” in python coding.

And is there a way where I'm able to attach the newly created node from pressing the button to the previously created node ? I know right now I'm just linking to the null node that has the buttons.



def onButtonPress():
import hou

b = hou.node(“/obj/grid_object1/DIRECTION”)
a = hou.node(“/obj/grid_object1/”).createNode(“duplicate”,“LEFT”)
a.parm(“newg”).set(1)
a.parm(“tx”).set(5)
a.parm(“sourceGrp”).set(“copyGroup1”)
a.inputs()
a.setNextInput(b)
a.inputs()
a.moveToGoodPosition()