diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-04-21 09:38:55 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-04-21 09:38:55 +0300 |
commit | 6f190f7f43bb6c4a2c9dc52fdaae2dacf10f1d24 (patch) | |
tree | ea336d6d0c4a807d0da24ff6f1c7d19885ee221d /source/blender/editors/sculpt_paint/sculpt_intern.h | |
parent | 575ade22d4de472ccf9e7d2dc1ffca37416c58f6 (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_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index bd95bb4666b..f13f1c79a7a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -782,7 +782,17 @@ bool SCULPT_mode_poll_view3d(struct bContext *C); bool SCULPT_poll(struct bContext *C); bool SCULPT_poll_view3d(struct bContext *C); -bool SCULPT_vertex_colors_poll(struct bContext *C); +/** + * Returns true if sculpt session can handle color attributes + * (BKE_pbvh_type(ss->pbvh) == PBVH_FACES). If false an error + * message will be shown to the user. Operators should return + * OPERATOR_CANCELLED in this case. + * + * NOTE: Does not check if a color attribute actually exists. + * Calling code must handle this itself; in most cases a call to + * BKE_sculpt_color_layer_create_if_needed() is sufficient. + */ +bool SCULPT_handles_colors_report(struct SculptSession *ss, struct ReportList *reports); /** \} */ |