From 6f190f7f43bb6c4a2c9dc52fdaae2dacf10f1d24 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Wed, 20 Apr 2022 23:38:55 -0700 Subject: Fix T97469: Sculpt colors crash in multiresolution or dynamic topology modes. Sculpt paint tools now pop up an error message if dynamic topology or multires are enabled. Implementation notes: * SCULPT_vertex_colors_poll is now a static function in sculpt_ops.c. It is now used solely by the legacy color attribute conversion operators (SCULPT_OT_vertex_to_loop_colors and SCULPT_OT_loop_to_vertex_colors) and should be deleted when they are. * There is a new method, SCULPT_handles_colors_report, that returns true if the sculpt session can handle color attributes; otherwise it returns false and displays an error message to the user. --- source/blender/editors/sculpt_paint/sculpt_filter_color.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_color.c') diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c index 5d4a2c54832..a705f6aa8a8 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c @@ -24,6 +24,7 @@ #include "BKE_object.h" #include "BKE_paint.h" #include "BKE_pbvh.h" +#include "BKE_report.h" #include "BKE_scene.h" #include "IMB_colormanagement.h" @@ -342,10 +343,7 @@ static int sculpt_color_filter_invoke(bContext *C, wmOperator *op, const wmEvent } /* Disable for multires and dyntopo for now */ - if (!ss->pbvh) { - return OPERATOR_CANCELLED; - } - if (BKE_pbvh_type(pbvh) != PBVH_FACES) { + if (!ss->pbvh || !SCULPT_handles_colors_report(ss, op->reports)) { return OPERATOR_CANCELLED; } -- cgit v1.2.3