Initial python script on Houdini : 1st attempt

It was done on the python source editor. Currently investigating the possibility of scripting inside the houdini node.

import hou

#this line create a box node in the geometry level

box=hou.node(“obj”).createNode(“geo”,run_init_scripts=False).createNode(“box”)

#this line is just to define a boolean variable

running=True

#the while loop is use

while running:

#this command is a houdini user interface function that calls up a input box

length_input=hou.ui.readInput(“Length input”)

#the input is turn into an interger and used as x the length of the box

x=int(length_input[1])

area=50

#y is define by a relationship with the area and length

y=area/x

#this line changes the parameter sizex and sizez with relation to ur input

box.parm(“sizex”).set(x)

box.parm(“sizez”).set(area/x)

#a condition was set in order for the box to be created

if x<y:

running=False

else:

length_input=hou.ui.displayMessage(“Length is too big”)

print “done”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s