Add subscript with the <sub></sub>
tags.
ni
kni
Add superscript with the <sup></sup>
tags.
x2
# Sets the node shape to be a circle | |
node.setUserData('nodeshape', 'circle') |
stamp("../pathtoNode", "variableName", 1) | |
// The 3rd arg is the default value if the | |
// retrieved variable for a corresponding point | |
// does not exist. |
// Base formatting: | |
// Curly brackets for encapsulating multiple statements. | |
if(v@P.x > 0){ | |
v@Cd = {1, 0, 0}; | |
} | |
else{ | |
v@Cd = {0, 1, 0}; | |
} | |
// Inline formatting: |
# Extract consecutive trailing numerical digits from a node's name. | |
import hou | |
return pwd().digitsInName() | |
# For example, a node named 'NEW_GEO_101' will return the int 101 | |
# into the field. Returns 0 if name does not include any trailing | |
# numerical digits. |
Add subscript with the <sub></sub>
tags.
ni
kni
Add superscript with the <sup></sup>
tags.
x2
// Replace <value> with value intended to be rounded. | |
round(<value> * 1000) / 1000 |
// Static Values | |
variable = {0,1,2}; | |
// Dynamic Values | |
variable = set(x,y,z); |
// Fractured pieces are generated with @name such as 'piece0', 'piece1', etc. | |
// The following prim wrangle renames each piece with a padded number. | |
// String var to hold padded piece number. | |
string new_name = sprintf("piece_%04d", opdigits(@name)); | |
// Update piece name. | |
s@name = new_name; |
# Get default Houdini OOTB colors for Sticky Notes, Text, and Network Boxes | |
print(hou.defaultColor(hou.colorItemType.StickyNote)) | |
# <hou.Color r=1, g=0.969, b=0.522> | |
print(hou.defaultColor(hou.colorItemType.StickyNoteText)) | |
# <hou.Color r=0, g=0, b=0> | |
print(hou.defaultColor(hou.colorItemType.NetworkBox)) | |
# <hou.Color r=0.52, g=0.52, b=0.52> | |
# Set custom default colors for Houdini Sticky Notes and Network Boxes | |
# Sticky Notes set to white |
rotateNode = hou.node('obj/box1/transform1') | |
speed = 20 | |
# set() used to specify param value with corresponding data type. | |
rotateNode.parm('rz').set(10) | |
# However, it cannot be used to set the value with a non-compatible | |
# data type, such as a string channel reference. The use of | |
# setExpression() allows for such instances. | |
rotateNode.parm('ry').setExpression('ch("../box1/divrate2") * {}'.format(speed)) | |
# Reference: https://www.sidefx.com/docs/houdini/hom/hou/Parm.html |