When you sample SDF VDB outside it’s bounds, volumesample returns SDF border’s value, volumegradient returns None.
Houdini
Move Layout From HDA to HDA
node = hou.node('/obj/matnet_explosion/pyroshader_improved1') src = hou.node('/shop/pyro_improved1') node.type().definition().setParmTemplateGroup(src.type().definition().parmTemplateGroup(), rename_conflicting_parms=False) node.setParmTemplateGroup(node.type().definition().parmTemplateGroup(), rename_conflicting_parms=False)
hou.phm() in event handlers
phm() → hou.HDAModule
“This shortcut lets you write hou.phm() instead of hou.pwd().hdaModule(). You are most likely to use this shortcut from event handlers, button callbacks, and menu generation scripts in digital assets.”
It is Houdini’s Help.
But phm() and hou.pwd().hdaModule() do not work in event handlers.
Use instead in event handlers:
kwargs['node'].hdaModule().foo()
Pre-render create directory
Custom parameter (shader_node) with path to node with filename parameter (if You use it in shader etc.):
`opfullpath("/obj/geo_heating/shopnet/material_bake/heating_pc_v001")`
Pre-render script to create non-existent directory:
import os path = hou.pwd().parm('shader_node').evalAsString() dirName = os.path.dirname(hou.node(path).parm('filename').evalAsString()) if not os.path.exists(dirName): os.makedirs(dirName)
Scale Packed Geometries
This is a simple VEX code that allows you to change the size of objects:
matrix3 xform = primintrinsic(0, "transform", @primnum); scale(xform, chf("scale")); setprimintrinsic(0, "transform", @primnum, xform);
A simple script to search for nodes
This is a simple script to search for nodes by name. You can use it in python shell. And don’t forget increasing indent on each line:
for node in hou.root().allSubChildren(): if "ray" in node.name(): print node.path()