[Bf-blender-cvs] [b8b240b3293] geometry-nodes: Geometry Nodes: do not reference custom data layers when copying mesh

Jacques Lucke noreply at git.blender.org
Thu Oct 29 15:47:49 CET 2020


Commit: b8b240b3293604c8032431c3426ca2da8bdb676e
Author: Jacques Lucke
Date:   Thu Oct 29 15:47:19 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rBb8b240b3293604c8032431c3426ca2da8bdb676e

Geometry Nodes: do not reference custom data layers when copying mesh

We can't use that for now, because the original mesh might be freed
before the new copied mesh. When the original mesh is freed, the shared
layers will be freed as well.

This can probably be improved in the future, so that we can actually
share attribute arrays between meshes. An approach similar to how
geometries and components are shared should work as well.

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

M	source/blender/blenkernel/intern/geometry.cc

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

diff --git a/source/blender/blenkernel/intern/geometry.cc b/source/blender/blenkernel/intern/geometry.cc
index 569acab4642..aa58ce17f5b 100644
--- a/source/blender/blenkernel/intern/geometry.cc
+++ b/source/blender/blenkernel/intern/geometry.cc
@@ -237,8 +237,7 @@ GeometryComponent *MeshComponent::copy() const
 {
   MeshComponent *new_component = new MeshComponent();
   if (mesh_ != nullptr) {
-    /* Individual custom data layers might still be shared. */
-    new_component->mesh_ = BKE_mesh_copy_for_eval(mesh_, true);
+    new_component->mesh_ = BKE_mesh_copy_for_eval(mesh_, false);
     new_component->owned_ = true;
   }
   return new_component;
@@ -309,8 +308,7 @@ GeometryComponent *PointCloudComponent::copy() const
 {
   PointCloudComponent *new_component = new PointCloudComponent();
   if (pointcloud_ != nullptr) {
-    /* Individual custom data layers might still be shared. */
-    new_component->pointcloud_ = BKE_pointcloud_copy_for_eval(pointcloud_, true);
+    new_component->pointcloud_ = BKE_pointcloud_copy_for_eval(pointcloud_, false);
     new_component->owned_ = true;
   }
   return new_component;



More information about the Bf-blender-cvs mailing list