diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-06-30 09:31:08 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-06-30 09:31:08 +0300 |
commit | c39e9326317442f6751fb0b2929c49b3512309d5 (patch) | |
tree | 3b98e1257dbfc86ea1d0cde19df1bea06c7d3734 /source/blender/editors/sculpt_paint | |
parent | 21859432357a80d50eab71552350f6dd242abfb2 (diff) |
Fix T99196: sculpt_update_object calls paint updates for nonpaint tools
Specifically BKE_texpaint_slots_refresh_object was being called, which
causes cycles to reset at strange times (like moving the mouse cursor
in pose, boundary and various other tools).
This (along with some code that checks if the pbvh pixels need
to be rebuilt) is only run if is_paint_mode (which used to be
needs_colors) is true.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.cc | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index c93b0fc3aa8..6dc8375bb0d 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -1176,12 +1176,12 @@ static void vertex_paint_init_session(Depsgraph *depsgraph, BLI_assert(ob->sculpt == nullptr); ob->sculpt = (SculptSession *)MEM_callocN(sizeof(SculptSession), "sculpt session"); ob->sculpt->mode_type = object_mode; - BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false); + BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, true); } static void vwpaint_init_stroke(Depsgraph *depsgraph, Object *ob) { - BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false); + BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, true); SculptSession *ss = ob->sculpt; /* Ensure ss->cache is allocated. It will mostly be initialized in diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a3e2678aa40..906c4fd35fe 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5081,7 +5081,8 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op) /* CTX_data_ensure_evaluated_depsgraph should be used at the end to include the updates of * earlier steps modifying the data. */ Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); - BKE_sculpt_update_object_for_edit(depsgraph, ob, need_pmap, need_mask, needs_colors); + BKE_sculpt_update_object_for_edit( + depsgraph, ob, need_pmap, need_mask, SCULPT_tool_is_paint(brush->sculpt_tool)); ED_paint_tool_update_sticky_shading_color(C, ob); } |