VEX Snippets
# Wrangle Cheat Sheet
I try my best to credit and link to any sources. That being said, some of those are pretty old and I have no idea where they came from.
I recommend installing Vex Snippet Library to manage your own snippet collection. You can find all snippets formatted as .json files ready to be plugged into the library here.
Hot Tip:
You can find the attribute wrangle node by just typing
aw
;)
# Utilities
# Attribute based Probability Grouping
//point wrangle
|
|
# Angle between 2 Vectors
// point wrangle
|
|
# Attribute Min Max
// point wrangle
|
|
# Attribute to String
// point wrangle
|
|
# Attribute Transfer
// point wrangle
|
|
# Average Point Cloud Positions
// point wrangle
|
|
# Bias and Gain
// point wrangle
|
|
Sources:
# Bounding Box
// point wrangle
|
|
# Camera Position and Direction
// point wrangle
|
|
# Collision Check and Deintersection with SDF VDB
// point wrangle
|
|
# Color Palette Refinement using ‘Despill’ Technique
// point wrangle
|
|
Sources:
# Crowd Transition Mirrored Clips
// primitive wrangle
|
|
This is a useful snippet to setup correct transitions of mirrored clips based on the transition settings configured by hand for the base clips. To use this you have to create a name attribute on your points by copying the clipname
attribute. You can find more here.
# Crowd Clip Properties Mirrored Clips
// point wrangle
|
|
Read more here
# Edgefalloff
// point wrangle
|
|
# Expand Group Over Geo
// point wrangle
|
|
# Extract Tranformation Matrix
// point wrangle
|
|
Have a look at this note for more information on how it’s used.
# Flow Vector around Geometry
// point wrangle
|
|
# Follow Surface with Particles using the VDB Gradient
// point pop wrangle
|
|
# Frustum Culling Volume Fields in DOPs
// gas field wrangle
|
|
Sources:
Read more here
# Group by N Connections
// point wrangle
|
|
# Gravity on Curves (Hanging Cables)
// point wrangle
|
|
Sources:
# Helix from Line
// point wrangle
|
|
# If Statements, Ternary Operations, Select Function
// point wrangle
|
|
# Inflate Geo and Avoid Intersections / Fake Collisions
// point wrangle
This snippet is best used by running it inside a compiled for-each loop set to “by count”. Make sure to recalculate the point normals of the geometry inside the loop before the wrangle!
|
|
Sources:
Jacob Clark shared this amazing setup on a houdini discord channel. Thanks for letting me post it!
# Isolate Overlapping Points
// point wrangle
|
|
# Name Attribute for each Prim Group
// point wrangle
|
|
# Normalize @age
// point wrangle
|
|
# Orientation Template for Copy
// point wrangle
|
|
# Point Density
// point wrangle
|
|
# Ray to Surface SDF
// point wrangle
|
|
# Remove Point by Condition
// point wrangle
Mai Ao compared two point deletion methods, where method 1 gives a 15x speed increase over the traditional removepoint()
function
- group points first and blast group in another step
|
|
- removepoint()
|
|
Sources:
# Remove Point Percentage
// point wrangle
|
|
# Remove Point Percentage (ID aware)
// point wrangle
|
|
Sources:
Thanks Hannes!
# Rotate Vector
// point wrangle
|
|
# Sharpen Point Cloud
// point wrangle
|
|
# Vector Flow on Objects
// point wrangle
|
|
# Velocity Tester
// point wrangle
Very useful to visualize how meshed fluids will move in the motion blur of a rendered frame.
|
|
Sources:
Thanks Hannes!
# Wave Expressions
Summary of different useful periodic functions like square or sawtooth