This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) | |
print(editor.nodeShapes()) | |
# Returned tuple of strings: | |
# ('rect', 'bone', 'bulge', 'bulge_down', 'burst', 'camera', | |
# 'chevron_down', 'chevron_up', 'cigar', 'circle', 'clipped_left', | |
# 'clipped_right', 'cloud', 'diamond', 'ensign', 'gurgle', 'light', | |
# 'null', 'oval', 'peanut', 'pointy', 'slash', 'squared', 'star', | |
# 'tabbed_left', 'tabbed_right', 'tilted', 'trapezoid_down', | |
# 'trapezoid_up', 'wave') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Acquire node from network | |
node = hou.node('/obj/geo/node') | |
# Add folder used to collect all newly create parameters | |
folder = hou.FolderParmTemplate("folder", "Folder Name") | |
# Define folder type; default is Tabs. Set to Simple | |
folder.setFolderType(hou.folderType.Simple) | |
# Add parameter types, defined by parameter name, label, and number of components | |
# Add float parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets the node shape to be a circle | |
node.setUserData('nodeshape', 'circle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sorted from left to right and top to bottom. | |
# Row 1 | |
hou.Color(0.8,0.016,0.016) | |
hou.Color(1.0,0.0,0.0) | |
hou.Color(0.98,0.275,0.275) | |
hou.Color(0.996,0.682,0.682) | |
hou.Color(1.0,0.529,0.624) | |
hou.Color(0.624,0.329,0.396) | |
# Row 2 | |
hou.Color(0.573,0.353,0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create custom variable | |
int pt_id = i@ptnum; | |
// Assign variable to point attribute | |
i@pt_id = pt_id; | |
// Map point attribute to local variable | |
addvariablename(0, "pt_id", "PT_ID"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stamp("../pathtoNode", "variableName", 1) | |
// The 3rd arg is the default value if the | |
// retrieved variable for a corresponding point | |
// does not exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set Wrangle to 'Run Over Points'. | |
// Collect closest pts for each pt, based on radius and max pts. | |
// Includes user-managed channels for radius and max pts. | |
// Note that this list will include the current point being run | |
// through this point wrangle. | |
int pts[] = pcfind(0,"P",@P,chf('search_radius'),chi('max_points')); | |
// Used to visualize list in geo spreadsheet; for debugging. | |
i[]@pts = pts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Base formatting: | |
// Curly brackets for encapsulating multiple statements. | |
if([email protected] > 0){ | |
v@Cd = {1, 0, 0}; | |
} | |
else{ | |
v@Cd = {0, 1, 0}; | |
} | |
// Inline formatting: |
OlderNewer