Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2022-04-21 09:38:55 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-04-21 09:38:55 +0300
commit6f190f7f43bb6c4a2c9dc52fdaae2dacf10f1d24 (patch)
treeea336d6d0c4a807d0da24ff6f1c7d19885ee221d /source/blender/editors/sculpt_paint/sculpt_filter_color.c
parent575ade22d4de472ccf9e7d2dc1ffca37416c58f6 (diff)
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_color.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_filter_color.c6
1 files changed, 2 insertions, 4 deletions
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;
}