Python Resources

Updated on Aug 4 2024

PythonInHoudini

Deborah R. Fowler



Python in Houdini - Python Shell

Updated Oct 6  2013
Update March 30  2019

Python Shell - similar to an hscript textport shell

Importing py files

You create files outside of houdini using any text editor. Notepad++ or gedit are two commonly used editors. For example, I have used the phyllotactic pattern example written in python. I have used calls to houdini to create the geometry.

Open up Houdini and set the desktop to technical (or simply open up a python shell under the Window menu). Download the py file and hip file. To run the code in the python shell (make sure you save the files appropriately, and on Windows, launch by double clicking the hipnc). NOTE: if you run houdini from the command line in the directory where the files are, the imports will work perfectly.

import circlehouPhyllo
circlehouPh
yllo.phyllocircle(10)
MISSING IMAGE

Note when you import this, it creates a compiled python file (.pyc) in your folder.

Alternatively, you can use the Python Source Editor.