diff options
author | Jacques Lucke <jacques@blender.org> | 2022-07-28 12:37:35 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-07-28 12:37:35 +0300 |
commit | aa7d13034701b6e4e9eada24cb96a7ec78171a0a (patch) | |
tree | 314b98801ba342d2d012a24c09c5711eaf885b2c /source/blender/editors/sculpt_paint/curves_sculpt_density.cc | |
parent | 397731d4df44197cf9cf359d9da38156ad86904e (diff) |
Curves: improve handling of empty surface meshes
Diffstat (limited to 'source/blender/editors/sculpt_paint/curves_sculpt_density.cc')
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_density.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc index e1ac941eb2b..2e03e907e34 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc @@ -115,12 +115,20 @@ struct DensityAddOperationExecutor { surface_ob_orig_ = curves_id_orig_->surface; surface_orig_ = static_cast<Mesh *>(surface_ob_orig_->data); + if (surface_orig_->totpoly == 0) { + report_empty_original_surface(stroke_extension.reports); + return; + } surface_ob_eval_ = DEG_get_evaluated_object(ctx_.depsgraph, surface_ob_orig_); if (surface_ob_eval_ == nullptr) { return; } surface_eval_ = BKE_object_get_evaluated_mesh(surface_ob_eval_); + if (surface_eval_->totpoly == 0) { + report_empty_evaluated_surface(stroke_extension.reports); + return; + } BKE_bvhtree_from_mesh_get(&surface_bvh_eval_, surface_eval_, BVHTREE_FROM_LOOPTRI, 2); BLI_SCOPED_DEFER([&]() { free_bvhtree_from_mesh(&surface_bvh_eval_); }); |