Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Matthews <guitargeek>2021-06-16 06:31:57 +0300
committerHans Goudey <h.goudey@me.com>2021-06-16 06:31:57 +0300
commited4b2ba75a47a01543b0e28d911a78a124775423 (patch)
tree2c4f24e362a1bde576de0e5bb1b87e96c927219e /source/blender/blenkernel/intern/geometry_set_instances.cc
parent2209321f7817f349874cd03003c184408a286511 (diff)
Geometry Nodes: Separate Components Node
Implementation of T86970. This node takes a geometry input with multiple components and outputs them by component type. Meshes, Curves, and Point Clouds support combining multiple input instances, while volumes will only output the first volume component input until suitable instance realization for multiple volumes is finished. When direct geometry instancing is implemented it will be possible to avoid realizing instances in this node. Differential Revision: https://developer.blender.org/D11577
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_set_instances.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_set_instances.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc
index 847df75c8cb..97801c52cc9 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -650,9 +650,16 @@ static void join_instance_groups_pointcloud(Span<GeometryInstanceGroup> set_grou
static void join_instance_groups_volume(Span<GeometryInstanceGroup> set_groups,
GeometrySet &result)
{
- /* Not yet supported. Joining volume grids with the same name requires resampling of at least
- * one of the grids. The cell size of the resulting volume has to be determined somehow. */
- UNUSED_VARS(set_groups, result);
+ /* Not yet supported; for now only return the first volume. Joining volume grids with the same
+ * name requires resampling of at least one of the grids. The cell size of the resulting volume
+ * has to be determined somehow. */
+ for (const GeometryInstanceGroup &set_group : set_groups) {
+ const GeometrySet &set = set_group.geometry_set;
+ if (set.has<VolumeComponent>()) {
+ result.add(*set.get_component_for_read<VolumeComponent>());
+ return;
+ }
+ }
}
static void join_instance_groups_curve(Span<GeometryInstanceGroup> set_groups, GeometrySet &result)