[Bf-blender-cvs] [6ca602dd9fa] blender-v3.3-release: Fix T99761: Curves sculpt mode crash with empty curves

Hans Goudey noreply at git.blender.org
Fri Jul 29 00:39:31 CEST 2022


Commit: 6ca602dd9fa14faf75a4b21faccc8c5662b9e79e
Author: Hans Goudey
Date:   Thu Jul 28 17:39:10 2022 -0500
Branches: blender-v3.3-release
https://developer.blender.org/rB6ca602dd9fa14faf75a4b21faccc8c5662b9e79e

Fix T99761: Curves sculpt mode crash with empty curves

The virtual arrays may be null if the curves are empty,
it's simple to just skip the domain interpolation completely.

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

M	source/blender/editors/curves/intern/curves_ops.cc

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

diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc
index 740e53b59f8..eec2c5d205d 100644
--- a/source/blender/editors/curves/intern/curves_ops.cc
+++ b/source/blender/editors/curves/intern/curves_ops.cc
@@ -755,6 +755,9 @@ static int curves_set_selection_domain_exec(bContext *C, wmOperator *op)
 
     CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry);
     bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
+    if (curves.points_num() == 0) {
+      continue;
+    }
 
     if (old_domain == ATTR_DOMAIN_POINT && domain == ATTR_DOMAIN_CURVE) {
       VArray<float> curve_selection = curves.adapt_domain(



More information about the Bf-blender-cvs mailing list