[Bf-blender-cvs] [371720cb6d5] geometry-nodes-curve-support: Geometry nodes curves: Support instancing on control points

Hans Goudey noreply at git.blender.org
Thu Apr 15 19:13:26 CEST 2021


Commit: 371720cb6d5c1e59c00b745d7cae99b5cb2ad5d4
Author: Hans Goudey
Date:   Thu Apr 15 11:47:22 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rB371720cb6d5c1e59c00b745d7cae99b5cb2ad5d4

Geometry nodes curves: Support instancing on control points

===================================================================

M	source/blender/blenkernel/intern/geometry_component_instances.cc
M	source/blender/nodes/geometry/nodes/node_geo_point_instance.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc
index 11526eda762..feb30e8575a 100644
--- a/source/blender/blenkernel/intern/geometry_component_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_component_instances.cc
@@ -44,6 +44,7 @@ GeometryComponent *InstancesComponent::copy() const
   InstancesComponent *new_component = new InstancesComponent();
   new_component->transforms_ = transforms_;
   new_component->instanced_data_ = instanced_data_;
+  new_component->ids_ = ids_;
   return new_component;
 }
 
@@ -51,6 +52,7 @@ void InstancesComponent::clear()
 {
   instanced_data_.clear();
   transforms_.clear();
+  ids_.clear();
 }
 
 void InstancesComponent::add_instance(Object *object, float4x4 transform, const int id)
diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc b/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
index 20022e8d29d..53f731979d1 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
@@ -208,6 +208,10 @@ static void geo_node_point_instance_exec(GeoNodeExecParams params)
     add_instances_from_geometry_component(
         instances, *geometry_set.get_component_for_read<PointCloudComponent>(), params);
   }
+  if (geometry_set.has<CurveComponent>()) {
+    add_instances_from_geometry_component(
+        instances, *geometry_set.get_component_for_read<CurveComponent>(), params);
+  }
 
   params.set_output("Geometry", std::move(geometry_set_out));
 }



More information about the Bf-blender-cvs mailing list