Are you spending too much time wrestling with wide brushes and group nodes to affect only a handful of polygons? Does the lack of per-face precision in complex scenes slow down your creative flow?
With the Houdini Primitive SOP, you can bypass cumbersome workarounds and target faces directly. This node lets you filter primitives based on patterns, attributes, or expressions, giving you surgical control over geometry.
Once you master face-level operations, adjustments like bevels, normals tweaks, or material assignments become seamless. No more guesswork or accidental edits on neighboring elements.
In the following guide, you’ll discover how to set up selection filters, drive parameter changes with custom attributes, and integrate the Primitive SOP into real-world modeling and shading tasks. Get ready to streamline your workflow and gain face-by-face accuracy.
What is the Primitive SOP and when should you use it instead of Group, Edit or Attribute nodes?
The Primitive SOP is a geometry node in Houdini’s SOP context designed for per-primitive operations such as transforms, orientation, normals correction and intrinsic attribute edits. Unlike other nodes, it targets entire primitives rather than points, letting you adjust scale, pivot, color or even extrude facets in a single interface.
While the Group SOP focuses solely on selecting sets of primitives, the Edit SOP provides interactive, handle-based deformations at vertex or point level. Attribute nodes and VEX-based wrangles let you author custom attributes but often require scripting. The Primitive SOP exposes common tasks—rotate, scale, orient, set normals, assign material attributes—without jumping into VEX or switching between multiple nodes.
- Bulk transforms: uniformly scale or rotate each primitive using per-primitive controls.
- Randomization: drive orientation or pivot jitter procedurally without a wrangle.
- Color and material assignments: set Cd or shop_materialpath directly per face.
- Extrusions and bevels: apply polyExtrude-style operations grouped by primitive IDs.
- Intrinsic attribute tweaks: adjust normals, tangents or compute centroids on the fly.
Use the Primitive SOP when you need concise, non-destructive, per-face adjustments within a single node. It streamlines procedural workflows by combining selection and modification, reducing node count and improving readability. For specialized or algorithmic attribute work, fall back to an Attribute Wrangle or VOP network.
How can I precisely select individual faces with the Primitive SOP?
To target specific faces, the Primitive SOP exposes a Group parameter that accepts primnum lists, spatial bounds, or attribute filters. By crafting the right string, you control exactly which primitives downstream nodes affect. Below are three detailed selection techniques.
Practical selection examples: primitive index/range, spatial (bounding) selection, and attribute-based grouping
Primitive index/range
In the Group parameter, list specific primitive IDs separated by spaces or specify a closed range. For example, entering “0 3 5-8” selects faces number 0, 3, and 5 through 8. This method is ideal when you know the exact primnums from a previous print or a debug display.
Spatial (bounding) selection
Use the viewport marquee: click the Group picker icon next to the parameter and drag a box around your faces; Houdini then writes a pattern like “4-12 15” into the Group field. For procedural control, type a VEX position filter directly: @P.x > -0.5 && @P.x < 0.5 && @P.y > 1 selects primitives whose centroids lie within that region.
Attribute-based grouping
Prefix your expression with “@” to evaluate any primitive attribute. For instance, after painting a curvature attribute called “curv”, type @curv > 0.2 to target only sharper faces. Or use @region == 3 if you defined an integer attribute “region” earlier. This dynamic filter updates automatically as your mesh or attribute values change.
What is a reliable step-by-step workflow to transform, isolate and prepare faces for extrusion or deletion?
To work non-destructively with individual faces, you need a clear grouping and isolation process. By leveraging a combination of Group SOP, Delete SOP (or Blast), and Transform SOP, you can target specific primitives, adjust their pivot, then feed them into a PolyExtrude SOP or remove them entirely.
- Create a face selection with Group SOP (type: Primitives)
- Optionally promote that group to an attribute for downstream control
- Isolate faces via Delete SOP set to “Delete Non-Selected”
- Apply Transform SOP, using the group’s centroid as pivot
- Proceed to PolyExtrude SOP or use a Delete SOP to remove faces
Step 1: In the Group SOP, switch to Primitives mode and draw a selection region or use an expression (for example @Cd.r>.5). This defines your face set without affecting UVs or points outside the group.
Step 2: If you need the same selection later, promote the group to an integer primitive attribute via Attribute Promote. This preserves the face set through splits or merges in your network.
Step 3: Drop in a Delete SOP (or Blast) immediately after the Group. Enable “Delete Non-Selected” to isolate only your target faces. All other geometry stays intact for reference.
Step 4: Add a Transform SOP. In its pivot fields, reference the group’s centroid with an expression like centroid(0, “myGroup”, D_X). This ensures rotations and scales happen around the faces’ own center.
Step 5: Finally, plug into PolyExtrude SOP if you want to give thickness or bevel edges. If you intend to remove the faces, swap to a Delete SOP and enable “Delete Selected” on the same group. This modular setup lets you switch easily between extrusion and deletion.
How do you drive per-face behavior procedurally using primitive attributes and VEX with the Primitive SOP?
The Primitive SOP evaluates a VEX snippet on each face, allowing you to set or modify primitive attributes before any downstream processing. By attaching attributes like Cd, uv, or custom integers, you can control output flags, transform offsets, or visibility per-face. This workflow eliminates the need for multiple nodes or manual grouping, keeping your network procedural and scalable.
Inside the Primitive SOP, you author VEX that reads existing fields (for example, @primnum or @N) and writes new ones. Houdini’s internal looping handles each face automatically. This lets you drive variations—such as random color, selective extrusion, or UV tweak—directly at the SOP level, keeping data compact and computation fast.
Common primitive attributes and concise VEX/snippet examples for per-face control
- @primnum: Unique face index.
if(@primnum % 2 == 0) @Cd = {1,0,0};
- @N: Face normal vector.
@P += normalize(@N) * chf(“offset”);
- @uv: Surface UV coordinate.
if(@uv.x > 0.5) @group_right = 1;
- i@myID: Custom integer attribute.
i@myID = int(rand(@primnum)*10);
- f@extrude: Float for extrusion scale.
f@extrude = fit01(rand(@primnum), chf(“min”), chf(“max”));
Which performance and topology pitfalls should you avoid when manipulating many faces?
On dense meshes, naïve face-by-face operations can cripple frame rates. Houdini excels when you leverage vectorized VEX and built-in SOPs, but certain workflows introduce hidden overhead or invalid geometry. Recognizing these pitfalls early preserves both speed and mesh integrity.
- Explicit nested loops: Using nested forprims or point loops inside a Primitive Wrangle forces serial execution. Instead, apply per-primitive VEX functions like primuv() or setprimgroup() to benefit from Houdini’s multi-threaded solver.
- Dynamic group modifications: Continuously expanding or removing groups at runtime triggers full group membership recalculation. Predefine groups with a Group SOP or use static bitmask attributes to tag faces without costly updates.
- Non-manifold edges: Splitting, merging, or extruding faces can create edges shared by more than two faces. Run the Clean SOP or PolyDoctor early in your chain to auto-fix T-junctions and enforce manifold topology.
- Zero-area primitives: Collapsed vertices yield degenerate polygons that break downstream tools. In a Primitive Wrangle, compute face area via area(@P[0], @P[1], @P[2]) and delete faces below a threshold to maintain robustness.
- On-the-fly triangulation: Real-time quad-to-tri conversion each frame forces Houdini to retriangulate constantly. Pre-triangulate once in SOPs, cache the result, and only update attributes—avoiding repeated topology reconstruction.
By avoiding these common traps and embracing Houdini’s procedural strengths—static groups, cached topology, and vectorized VEX—you ensure high performance and clean meshes even when manipulating thousands or millions of faces.
What practical recipes use the Primitive SOP for real tasks (paneling, damage, UV-friendly edits)?
Using the Primitive SOP you can isolate and manipulate individual faces to solve common production challenges. Here are three concrete recipes—procedural paneling, controlled damage and UV-friendly face edits—each relying on face-level selection and procedural workflows.
Procedural Paneling:
To add uniform panels on a hard-surface asset, first compute per-face normals with a Normal SOP. In the Primitive SOP’s Group Expression, use something like @N.z>0.9 to select top faces. Feed that group into a PolyExtrude, set Inset Type to “By Group,” then drive the inset offset with a float ramp or attribute to vary panel thickness. Finally, use a second Primitive SOP to isolate border faces for beveling in a PolyBevel node—this maintains crisp edges.
Controlled Damage:
Create non-destructive damage by randomizing a primitive attribute (e.g. “dmg”) via an Attribute Randomize SOP. In a Primitive SOP, group primitives using an expression like @dmg>0.8, then feed that group into a Voronoi Fracture SOP or a Mountain SOP for noise displacement. For chipped edges, use the same Primitive group to drive a tiny PolyExtrude inward. This keeps your base geometry intact while driving both shape breaks and surface disruption procedurally.
UV-Friendly Face Edits:
When inserting new geometry without UV distortion, first select the target faces in a Primitive SOP (for example via @uvIsland==2). Use that group to drive a UV Texture SOP in “Clip” mode, projecting a fresh island only onto those faces. Then relax UVs on the selection with a UV Flatten SOP—set “Pin Selected Faces” to off so unmodified regions hold their mapping. This workflow lets you inset or subdivide faces without creating stretched UVs.