diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-15 22:20:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-15 22:20:53 +0300 |
commit | 19bab2a5360708242a5f6ea11b6e2ff03568a679 (patch) | |
tree | 50c4a4862ed08ca62809b462e273a3925649c9d8 /source/blender/blenkernel/intern/geometry_set_instances.cc | |
parent | 76f386a37a9cf14ac729be048230f81a0a397fc8 (diff) |
Geometry Nodes: Object info node optional instance output
The object info node output an instance as a performance optimization.
Before that optimization was (almost) invisible to the user, but now
that we aren't automatically realizing instances, it isn't intuitive
for a single object to become an instance.
I refactored the transform node so its ability to translate/transform
an entire geometry set was more usable from elsewhere and exposed the
function to get a geometry set from an object.
Differential Revision: https://developer.blender.org/D12833
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_set_instances.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_set_instances.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index 77348c3d22c..d92df386575 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -56,7 +56,7 @@ static void add_final_mesh_as_geometry_component(const Object &object, GeometryS /** * \note This doesn't extract instances from the "dupli" system for non-geometry-nodes instances. */ -static GeometrySet object_get_geometry_set_for_read(const Object &object) +GeometrySet object_get_evaluated_geometry_set(const Object &object) { if (object.type == OB_MESH && object.mode == OB_MODE_EDIT) { GeometrySet geometry_set; @@ -100,7 +100,7 @@ static void geometry_set_collect_recursive_object(const Object &object, const float4x4 &transform, Vector<GeometryInstanceGroup> &r_sets) { - GeometrySet instance_geometry_set = object_get_geometry_set_for_read(object); + GeometrySet instance_geometry_set = object_get_evaluated_geometry_set(object); geometry_set_collect_recursive(instance_geometry_set, transform, r_sets); if (object.type == OB_EMPTY) { @@ -628,14 +628,14 @@ void InstancesComponent::foreach_referenced_geometry( switch (reference.type()) { case InstanceReference::Type::Object: { const Object &object = reference.object(); - const GeometrySet object_geometry_set = object_get_geometry_set_for_read(object); + const GeometrySet object_geometry_set = object_get_evaluated_geometry_set(object); callback(object_geometry_set); break; } case InstanceReference::Type::Collection: { Collection &collection = reference.collection(); FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (&collection, object) { - const GeometrySet object_geometry_set = object_get_geometry_set_for_read(*object); + const GeometrySet object_geometry_set = object_get_evaluated_geometry_set(*object); callback(object_geometry_set); } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; @@ -676,7 +676,7 @@ void InstancesComponent::ensure_geometry_instances() /* Create a new reference that contains the geometry set of the object. We may want to * treat e.g. lamps and similar object types separately here. */ const Object &object = reference.object(); - GeometrySet object_geometry_set = object_get_geometry_set_for_read(object); + GeometrySet object_geometry_set = object_get_evaluated_geometry_set(object); if (object_geometry_set.has_instances()) { InstancesComponent &component = object_geometry_set.get_component_for_write<InstancesComponent>(); |