From 34e30baedf7eee625deeba3ab1209be7efbaaf04 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 30 Aug 2022 12:20:37 +0200 Subject: 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. --- source/blender/editors/sculpt_paint/curves_sculpt_slide.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender') 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; -- cgit v1.2.3