[Bf-blender-cvs] [08c1fe7d2c2] draw-deferred-compilation-experiment: Fix: Assert when sculpting empty curves
Hans Goudey
noreply at git.blender.org
Thu Apr 21 11:14:07 CEST 2022
Commit: 08c1fe7d2c2ffc336cf2ef9a471fb338e2376296
Author: Hans Goudey
Date: Tue Apr 19 12:09:09 2022 -0500
Branches: draw-deferred-compilation-experiment
https://developer.blender.org/rB08c1fe7d2c2ffc336cf2ef9a471fb338e2376296
Fix: Assert when sculpting empty curves
===================================================================
M source/blender/editors/sculpt_paint/curves_sculpt_comb.cc
M source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc
M source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc
===================================================================
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_comb.cc b/source/blender/editors/sculpt_paint/curves_sculpt_comb.cc
index 6a47f90d4ac..232d632aa3f 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_comb.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_comb.cc
@@ -136,6 +136,9 @@ struct CombOperationExecutor {
curves_id_ = static_cast<Curves *>(object_->data);
curves_ = &CurvesGeometry::wrap(curves_id_->geometry);
+ if (curves_->curves_num() == 0) {
+ return;
+ }
brush_pos_prev_re_ = self_->brush_pos_last_re_;
brush_pos_re_ = stroke_extension.mouse_position;
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc
index 7cc5e524c30..6228a643a76 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc
@@ -311,6 +311,9 @@ struct CurvesEffectOperationExecutor {
curves_id_ = static_cast<Curves *>(object_->data);
curves_ = &CurvesGeometry::wrap(curves_id_->geometry);
+ if (curves_->curves_num() == 0) {
+ return;
+ }
CurvesSculpt &curves_sculpt = *scene_->toolsettings->curves_sculpt;
brush_ = BKE_paint_brush(&curves_sculpt.paint);
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc b/source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc
index b367c5bb6ec..6d930d35f04 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_snake_hook.cc
@@ -116,6 +116,9 @@ struct SnakeHookOperatorExecutor {
curves_id_ = static_cast<Curves *>(object_->data);
curves_ = &CurvesGeometry::wrap(curves_id_->geometry);
+ if (curves_->curves_num() == 0) {
+ return;
+ }
brush_pos_prev_re_ = self.last_mouse_position_re_;
brush_pos_re_ = stroke_extension.mouse_position;
More information about the Bf-blender-cvs
mailing list