Skip to content

Instantly share code, notes, and snippets.

View morphingdesign's full-sized avatar
💭
Learning something new

Hans Palacios morphingdesign

💭
Learning something new
View GitHub Profile
@morphingdesign
morphingdesign / hou_staticDynamicValues.h
Created May 12, 2021 21:10
Differentiation between initializing static and dynamic values in Houdini VEX.
// Static Values
variable = {0,1,2};
// Dynamic Values
variable = set(x,y,z);
@morphingdesign
morphingdesign / hou_roundToSpecdDigits.h
Created April 6, 2021 02:17
Setup to round parameter value digits to specified number of digits, such as to 3 digits.
// Replace <value> with value intended to be rounded.
round(<value> * 1000) / 1000
@morphingdesign
morphingdesign / markdown_SubAndSuperscript.md
Created February 22, 2021 06:59
Formatting for subscript and superscript in markdown.

Add subscript with the <sub></sub> tags.

ni

kni

Add superscript with the <sup></sup> tags.

x2

@morphingdesign
morphingdesign / hou_trailingNumFromNodeName.py
Created February 10, 2021 05:19
Extract consecutive trailing numerical digits from a Houdini node name.
# 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.
@morphingdesign
morphingdesign / hou_inlineTernaryIf.h
Created February 4, 2021 19:43
Variations in formatting simple inline if statements in Houdini Vex. Complex conditionals should utilize base formatting for clarity.
// 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:
@morphingdesign
morphingdesign / hou_stampExp.h
Created January 26, 2021 00:53
HScript expression to retrieve local variable from stamping operator in Houdini.
stamp("../pathtoNode", "variableName", 1)
// The 3rd arg is the default value if the
// retrieved variable for a corresponding point
// does not exist.
@morphingdesign
morphingdesign / set_nodeShape.py
Created January 24, 2021 00:32
Syntax for setting a node to a specified node shape from available Houdini node shapes.
# Sets the node shape to be a circle
node.setUserData('nodeshape', 'circle')