# Geometry Nodes: Instance Component 2.0 ## Currently Geometry Nodes Instances have small interface for interaction: 1. Attrbutes access only for root points. 2. Only Transform instances nodes can change deep instaces values. 3. Realization can compress all nested instance-transformations / attributes into the deeper one (All the whole instantiated geometry, or root new points (for [Geometry Nodes: Add selection and depth options to realize instances](https://projects.blender.org/blender/blender/pulls/104832)). ### Things that are hidden for user interaction for now: 1. Instances hierarchy, dirrected root-base tree topology. 2. Hierarchy-base transformation is local. This means, some attribute of hidden instace-points in all nested layers are local. This could be usrefull for user made tree structure. **Flush evaluating**. - Accumulate Field can be used in the same way, but only for + or - operations. The Tree topology-base order of update allow to do this with topology optimization via caching result of shallow points. | With instance-tree topology | Without | | -- | -- | | ![](https://hackmd.io/_uploads/r1ShSgx0n.png) | ![](https://hackmd.io/_uploads/rkkp8ggA3.png) | *Parrent Instance attribute input node could be used for this.* 3. Custom topology changes: - User can trim this trees to get 2-level trees with only root and leaves points. - Tessellation can be done to change topology by replacing selected branches by something other. - Flush evaluating also will be allow to change deepre values of instance-tree points to that the final attributes of the geometry on the render can depend on the value of the its, which are now hidden and do not allow attributes to be overwritten. ## New Instance geometry structre ```cpp enum eAttrDomain { ATTR_DOMAIN_TREE, // New domain type } class Instance { Array<GeometrySet> leaves_; CustomDataAttributes attrbutes_; int totla_points; int total_tree; int total_instances; // optionally // OffsetIndices<int> points_by_level; } ``` ### Structure mean: 1. `leaves_` is an array of all geometry, instantiated on render by this geometry. 2. `attrbutes_` support two attribute domains: `ATTR_DOMAIN_POINT` and new one `ATTR_DOMAIN_TREE`. 3. `totla_points` is a size of whole `ATTR_DOMAIN_POINT` domain and of all roots + leaves + nested points. 4. `total_tree` number of root vertices in a front of `ATTR_DOMAIN_POINT` domain. Also size of all the `ATTR_DOMAIN_TREE` domain. 5. `total_instances` number of leaves points in a back side of `ATTR_DOMAIN_POINT` domain. Also size of `leaves_`. 6. Built-in attrbute: `parent`. Integer attrbute index to a parent point. Root points are pointing to itself.