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:
authorRamil Roosileht <Limarest>2022-05-06 13:29:51 +0300
committerJeroen Bakker <jeroen@blender.org>2022-05-06 13:30:09 +0300
commit90042b7d796608cf680620041785bfa432975d48 (patch)
treea0385717af307f2410e0c665808c15f70d1184c9 /source/blender/editors/sculpt_paint/sculpt_ops.c
parent84756b68e68c8a25b820a8c3dda01ec7f0a59353 (diff)
Switch viewport shading for color tools in solid mode
This patch implements T97613, switching viewport shading when using Color Filter and Mask By Color ALSO, this patch makes it so viewport shading color switches only when SOLID mode is chosen, to prevent color switching when using other shading modes, without user noticing it. {F13049889} Reviewed By: JulienKaspar, joeedh, jbakker Maniphest Tasks: T97613 Differential Revision: https://developer.blender.org/D14765
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_ops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c b/source/blender/editors/sculpt_paint/sculpt_ops.c
index 2b5a20205bd..5aa1dbef74c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_ops.c
+++ b/source/blender/editors/sculpt_paint/sculpt_ops.c
@@ -1043,6 +1043,10 @@ static int sculpt_mask_by_color_invoke(bContext *C, wmOperator *op, const wmEven
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
+ View3D *v3d = CTX_wm_view3d(C);
+ if (v3d->shading.type == OB_SOLID) {
+ v3d->shading.color_type = V3D_SHADING_VERTEX_COLOR;
+ }
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);