houdini_stubs
houdini_stubs copied to clipboard
Python Stub File Generator for Houdini
Houdini Stub File Generator
Type annotation builder for SideFX Houdini hou-python Module
Usage:
- run
main.pyto build the stub files$ hou_stubs/main.py "/path/to/your/houdini/19.5.303/houdini/python3.9libs/hou.py" # eg.: $ hou_stubs/main.py /software/houdini/19.5/houdini/python3.9libs/hou.py --out=./hou-stubs - include them in your
$PYTHONPATH$ export PYTHONPATH="${PYTHONPATH}:/the/path/where/hou-stubs/is"
Examples:
Error Checking:

IDE Docs:

here is an example from the generated stubs:

Features:
Automatic splitting of Submodules:

Nodes/Todo:
-
Some C++ type are'nt 100% correct translated. In some cases I took shortcuts and and used similar behaving python types. eg.: pointers are just dropped. Different variations of Integer/Float/String types are all annoted as their basic
int/float/str. -
The imports and namespaces in the submodules is a bit messy. Maybe its best to keep everything combined as one big module.
-
process.process_parametercurrently readsfunc.module.classeswhich takes a decent bit of time. Might be worth trying to optimize this. Maybe wrap the griffe-classes into our own sublclasses and makeclasses()a cached property -
Only the
hou.pyitself is supported/test. In theory the code should work fine on other modules, but its untested as of right now.
Credits:
Large parts of the Code are inspired by mypy-boto3-builder.