[Bf-blender-cvs] [d046c8c9d75] master: Fix T101926: Curves: Remove type-specific attributes when deleting

Hans Goudey noreply at git.blender.org
Wed Oct 19 20:44:50 CEST 2022


Commit: d046c8c9d756d5a22ed9aa5a8d0bf0b69d9deba6
Author: Hans Goudey
Date:   Wed Oct 19 13:39:23 2022 -0500
Branches: master
https://developer.blender.org/rBd046c8c9d756d5a22ed9aa5a8d0bf0b69d9deba6

Fix T101926: Curves: Remove type-specific attributes when deleting

Remove NURBS or Bezier specific attributes after removing points or
curves. In theory we could avoid copying those attributes in the
first place, but that doesn't seem worth the extra complexity here,
since we don't necessarily know the result curve type counts before
copying attributes.

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

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

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

diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc
index d65c31139fc..7c338480c71 100644
--- a/source/blender/blenkernel/intern/curves_geometry.cc
+++ b/source/blender/blenkernel/intern/curves_geometry.cc
@@ -1224,6 +1224,10 @@ static CurvesGeometry copy_with_removed_points(const CurvesGeometry &curves,
     attribute.dst.finish();
   }
 
+  if (new_curves.curves_num() != curves.curves_num()) {
+    new_curves.remove_attributes_based_on_types();
+  }
+
   return new_curves;
 }
 
@@ -1329,6 +1333,8 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves,
     attribute.dst.finish();
   }
 
+  new_curves.remove_attributes_based_on_types();
+
   return new_curves;
 }



More information about the Bf-blender-cvs mailing list