diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-26 20:50:39 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-26 20:50:39 +0300 |
commit | 9fa304bf13e402405351a2c9bc14903c08b557e5 (patch) | |
tree | 1e3f3a918924b46360f657dc6a87ae9c537ae84f /source/blender/modifiers | |
parent | b6d2bee28f3a232f47de19b26051054e7c863269 (diff) |
Geometry Nodes: Only create instance IDs when they exist
Instance IDs serve no purpose for rendering when they aren't stable from
one frame to the next, and if the index is used in the end anyway, there
is no point in storing a vector of IDs and copying it around.
This commit exposes the `id` attribute on the instances component,
makes it optional-- only generated by default with the distribute points
on faces node.
Since the string to curves node only added the index as each instance's
ID, I removed it. This means that it would be necessary to add the ID
data manually if the initial index actually helps (when deleting only
certain characters, for example).
Differential Revision: https://developer.blender.org/D12980
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index e6cc7663c58..292ba04490c 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -917,6 +917,10 @@ static void store_output_value_in_geometry(GeometrySet &geometry_set, CurveComponent &component = geometry_set.get_component_for_write<CurveComponent>(); store_field_on_geometry_component(component, attribute_name, domain, field); } + if (geometry_set.has_instances()) { + InstancesComponent &component = geometry_set.get_component_for_write<InstancesComponent>(); + store_field_on_geometry_component(component, attribute_name, domain, field); + } } /** |