Blender Geometry Nodes Sample Index Node Explained
The Sample Index node in Blender Geometry Nodes allows you to retrieve data from a specific element of a geometry using its index number. By querying a specific point, edge, face, face corner, or spline by its numerical position in the geometry's data array, this node enables precise data transfer, dynamic referencing, and complex procedural calculations across different parts of a node tree.
Core Functionality
In Blender, every geometry component (such as a vertex, edge, or face) is assigned a unique index starting from zero. The Sample Index node reads a specific attribute from one of these components without altering the original geometry.
The node requires three key components to function:
- Geometry: The target geometry you want to read information from.
- Value: The data or attribute (Float, Integer, Vector, Color, Boolean, Rotation, or Matrix) you want to extract.
- Index: The specific integer index of the element you want to query.
Key Settings and Options
- Data Type: A dropdown that sets the type of data to be sampled (e.g., Vector for positions, Float for weights or distances).
- Domain: Defines the component category to sample from, including Point, Edge, Face, Face Corner, Spline, or Instance.
- Clamp: When enabled, this checkbox ensures that if an index value is requested that falls outside the valid range of the geometry (e.g., requesting index 100 on a mesh with only 50 points), the node will clamp the query to the nearest valid index (0 or the maximum available index) rather than returning a default or empty value.
Common Use Cases
- Accessing Specific Vertices: You can sample the exact position of a specific vertex (like index 0) to use as an anchor or target for other procedural elements, such as pointing an object toward a specific point on a moving mesh.
- Building Procedural Curves: By sampling points in
sequence (e.g., point
Indexand pointIndex + 1), you can generate lines, curves, or bridges connecting specific geometric elements. - Reading Data Across Domains: It allows you to query face data from a point context, or point data from a curve context, facilitating structured data transfer across different component types without relying on spatial proximity.
Sample Index vs. Sample Nearest
Unlike the Sample Nearest node, which looks up geometry elements based on spatial proximity in 3D space, the Sample Index node looks up data based strictly on list order. This makes it ideal for structured data retrieval where the spatial position of the target element is irrelevant or continuously changing.