Using the VDB Combine to multiply VDB by -1 gives unpredictable results. The Volume Wrangle gives the correct result.
Using the VDB Combine to multiply VDB by -1 gives unpredictable results. The Volume Wrangle gives the correct result.
Share:
Noise Name Min Max
Perlin 0.55 1.37
Original Perlin -0.53 0.49
Sparse Convolution -0.66 0.78
Alligator 0 0.53
Simplex -0.26 0.21
Zero centered perlin -0.2 0.2
Anti-aliased -0.4 0.4
Share:
An example of getting the component RZ
from the object’s transform:
explodematrix(optransform("path_to_object"), "RST", "XYZ", "RZ")
Share:
When writing regular expressions in VEX, use raw strings. Write the character r before the regex line:string num = re_find(r"(\d+)$", s);
When using groups in the re_replace() function, also use raw strings and \1 syntax to get groups. $1 syntax from the help does not work:s@material = re_replace(r".(.).*$", r"\1", s@name);
Share:
Be careful with @TimeInc in VOP before the dynamics: this does not work correctly during dopnet substep simulation. Use custom expressions like 1/@FPS.
Share:
This is a simple script to search for nodes by name. You can use it in python shell. And don’t forget to increase the indentation in each line:
for node in hou.root().allSubChildren():
if "ray" in node.name():
print node.path()
Share:
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);
Share:
This is a simple python script to print filenames in all Write nodes from Nuke:
print "========================"
for node in nuke.allNodes():
if 'Write' in node['name'].value():
print node['file'].value()
To run this script you can save it to file .py and run from File/Run Script menu (Alt + X).
The result will be printed in the Script Editor (right click to any content menu, Windows/Script Editor).
You can change Write to Read to print all comp’s references:
print "========================"
for node in nuke.allNodes():
if 'Read' in node['name'].value():
print node['file'].value()
To find the filenames with specific location run next script:
print "========================"
location = '/LOCATION_PATH/'
for n in nuke.allNodes():
if 'Read' in n['name'].value() or 'Write' in n['name'].value():
if location in n['file'].value():
print n['file'].value()
Share:
node = hou.node('/obj/matnet_explosion/new_shader')
src = hou.node('/shop/old_shader')
node.type().definition().setParmTemplateGroup(\
src.type().definition().parmTemplateGroup(),\
rename_conflicting_parms=False)
node.setParmTemplateGroup(\
node.type().definition().parmTemplateGroup(),\
rename_conflicting_parms=False)
Share:
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()
Otherwise, you can use hou.phm()
to access the Python Module in the asset. For example, to call a function when a button is pressed:
hou.phm().foo(kwargs['node'])
It is worth noting that the kwargs dictionary is fully accessible only in events. Only kwargs['type']
is available in the Python Module:
https://www.sidefx.com/docs/houdini/hom/locations.html#node_event_kwargs
Share: