dd2a1734eb
- Shelf tool to open/close command port in Houdini - hhb client script (eval, script, get-selected, set-param, etc.) - Hermes skill with standard hou module workflows - Example: create pyro setup - hou module quick reference
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
"""
|
|
Example: Create a simple Pyro simulation setup in Houdini.
|
|
Run via: hhb script examples/create_pyro_setup.py
|
|
"""
|
|
import hou
|
|
|
|
# Create geometry container
|
|
obj = hou.node('/obj')
|
|
geo = obj.createNode('geo', 'pyro_sim')
|
|
|
|
# Source geometry (sphere)
|
|
sphere = geo.createNode('sphere', 'pyro_source')
|
|
sphere.parm('radx').set(0.5)
|
|
sphere.parm('rady').set(0.5)
|
|
sphere.parm('radz').set(0.5)
|
|
|
|
# Transform to position it
|
|
xform = geo.createNode('xform', 'position')
|
|
xform.setInput(0, sphere)
|
|
xform.parm('ty').set(2)
|
|
|
|
# Null for output
|
|
null_geo = geo.createNode('null', 'OUT_GEO')
|
|
null_geo.setInput(0, xform)
|
|
|
|
# Create DOP network for the sim
|
|
dopnet = geo.createNode('dopnet', 'pyro_sim')
|
|
dopnet.setInput(0, null_geo)
|
|
|
|
# Inside the DOP: we'd need to set up pyro solver, smoke object, etc.
|
|
# For now, just create the structure
|
|
dopnet.moveToGoodPosition()
|
|
|
|
# Layout
|
|
sphere.moveToGoodPosition()
|
|
xform.moveToGoodPosition()
|
|
null_geo.moveToGoodPosition()
|
|
|
|
print("Pyro setup skeleton created at:", geo.path())
|
|
print("Nodes:", [n.name() for n in geo.children()])
|