"Geometry to Instance" with a "group by attribute" parameter
Suggestion:
A variation of the Geometry to Instance node; an "Attribute Group to Instance" node, which creates instances of the provided geometry by grouping geometry with the same attribute value into the an instance.
The node would accept a single geometry input (of any type or combination) and an attribute name , and would output as many instances as there are unique values within the attribute domain.
Use case:
At present, the Geometry to Instance node accepts multiple geometries, each being realized as its own instance. However, inputs need to be chained manually, and as such, it is not possible to create a graph where an variable number of inputs are realized as instances.
Take for example the following graph which creates a variable number of randomly distorted cubes, which are then returned as instances by the proposed Attribute Group to Instances node. This could then be used by the Instance on Points node with "Pick Instances" enabled.
At present, this can only be accomplished by Delete Geometry or Separate Geometry and manually setting the Selection to each possible value.
Considerations
- Integers and strings would be the most useful mechanism to group geometries. Floats less so.
- If the attribute does not exist on the geometry, it should inherit down, i.e. control points inherit from splines, edges from faces, etc.
- This node might delete geometry as necessary, i.e. if grouping by a value that exists on control points but not a spline, then this would break the spline into multiple parts.
2 Comments
We have discussed this before. However, this treats instances more like a generic list of geometry, which is problematic because they're meant to be multiple uses of the same geometry.
It might be better to wait for this feature until we have proper lists.
Discussed by the developers. It's not for anyone to do yet