[Bf-blender-cvs] [93a68f2a903] master: Curves: Fix overallocation for curve attributes when deleting curves

Hans Goudey noreply at git.blender.org
Sun Jun 5 20:00:12 CEST 2022


Commit: 93a68f2a9032fe2d977ffb9b483b0ddd04d03ad9
Author: Hans Goudey
Date:   Sun Jun 5 19:59:57 2022 +0200
Branches: master
https://developer.blender.org/rB93a68f2a9032fe2d977ffb9b483b0ddd04d03ad9

Curves: Fix overallocation for curve attributes when deleting curves

Curve attributes were allocated to the size of the point domain, which
wouldn't cause bad behavior, just potentially worse performance.

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

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 2fa31bd4100..eb9b201c5b5 100644
--- a/source/blender/blenkernel/intern/curves_geometry.cc
+++ b/source/blender/blenkernel/intern/curves_geometry.cc
@@ -1195,7 +1195,7 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves,
 
           const void *src_buffer = old_layer.data;
           void *dst_buffer = ensure_customdata_layer(
-              new_curve_data, old_layer.name, data_type, new_tot_points);
+              new_curve_data, old_layer.name, data_type, new_tot_curves);
 
           threading::parallel_for(
               old_curve_ranges.index_range(), 128, [&](const IndexRange ranges_range) {



More information about the Bf-blender-cvs mailing list