[Bf-blender-cvs] [16011e34f08] master: Curves: Optimize filling all curves with a single type
Hans Goudey
noreply at git.blender.org
Wed May 4 13:55:27 CEST 2022
Commit: 16011e34f08e9a84d9685cdd2a6818c93443d873
Author: Hans Goudey
Date: Wed May 4 13:46:41 2022 +0200
Branches: master
https://developer.blender.org/rB16011e34f08e9a84d9685cdd2a6818c93443d873
Curves: Optimize filling all curves with a single type
If all curves are selected for setting the new type,
skip counting the types and just set it directly.
===================================================================
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 3ec5ee928f4..36ea7a3888f 100644
--- a/source/blender/blenkernel/intern/curves_geometry.cc
+++ b/source/blender/blenkernel/intern/curves_geometry.cc
@@ -250,6 +250,10 @@ void CurvesGeometry::fill_curve_types(const CurveType type)
void CurvesGeometry::fill_curve_types(const IndexMask selection, const CurveType type)
{
+ if (selection.size() == this->curves_num()) {
+ this->fill_curve_types(type);
+ return;
+ }
/* A potential performance optimization is only counting the changed indices. */
this->curve_types_for_write().fill_indices(selection, type);
this->update_curve_types();
More information about the Bf-blender-cvs
mailing list