Commit: 50b0448bd39d1776471526f19f57963394582810
Author: Sergey Sharybin
Date: Thu Dec 6 13:00:31 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB50b0448bd39d1776471526f19f57963394582810
Fix T58840: SHIFT+K in vertex paint doesn't update
===================================================================
M source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
index ba3bc5501e3..28a7ac38623 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
@@ -57,6 +57,15 @@ static bool vertex_weight_paint_mode_poll(bContext *C)
(me && me->totpoly && me->dvert);
}
+static void tag_object_after_update(Object *object)
+{
+ BLI_assert(object->type == OB_MESH);
+ Mesh *mesh = object->data;
+ DEG_id_tag_update(&mesh->id, DEG_TAG_COPY_ON_WRITE);
+ /* NOTE: Original mesh is used for display, so tag it directly here. */
+ BKE_mesh_batch_cache_dirty_tag(mesh, BKE_MESH_BATCH_DIRTY_ALL);
+}
+
/* -------------------------------------------------------------------- */
/** \name Set Vertex Colors Operator
* \{ */
@@ -98,7 +107,7 @@ static bool vertex_color_set(Object *ob, uint paintcol)
/* remove stale me->mcol, will be added later */
BKE_mesh_tessface_clear(me);
- DEG_id_tag_update(&me->id, 0);
+ tag_object_after_update(ob);
return true;
}
@@ -170,7 +179,7 @@ static bool vertex_paint_from_weight(Object *ob)
} while (j < mp->totloop);
}
- DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ tag_object_after_update(ob);
return true;
}
@@ -306,7 +315,7 @@ static bool vertex_color_smooth(Object *ob)
MEM_freeN(mlooptag);
- DEG_id_tag_update(&me->id, 0);
+ tag_object_after_update(ob);
return true;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs