diff options
author | Jacques Lucke <jacques@blender.org> | 2022-08-30 13:20:37 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-08-30 13:20:37 +0300 |
commit | 34e30baedf7eee625deeba3ab1209be7efbaaf04 (patch) | |
tree | bb359db94b4ffc1772f3d3b72d6fbc2e7c36fb66 /source/blender | |
parent | a97ae83a09e0a67168f1d3cdcbafd5b1ff16e3c9 (diff) |
Fix T100673: crash when using slide brush without attachment info
The slide brush requires attachment information on the curves.
Now a warning is shown instead of crashing Blender. The attachment
information can be generated by executing the
`Curves > Snap to Nearest Surface` operator.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_slide.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc index ebdff8a6c4b..007bff0b170 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc @@ -149,6 +149,12 @@ struct SlideOperationExecutor { report_missing_uv_map_on_original_surface(stroke_extension.reports); return; } + if (curves_orig_->surface_uv_coords().is_empty()) { + BKE_report(stroke_extension.reports, + RPT_WARNING, + TIP_("Curves do not have surface attachment information")); + return; + } const StringRefNull uv_map_name = curves_id_orig_->surface_uv_map; curves_sculpt_ = ctx_.scene->toolsettings->curves_sculpt; |