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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-12-06 15:00:31 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-12-06 15:00:31 +0300
commit50b0448bd39d1776471526f19f57963394582810 (patch)
treefaf335852a17e37fc3805f72936a97b992e6daf3 /source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
parent4c336f034e35ad9661e3ceb4da50c673a2e6690b (diff)
Fix T58840: SHIFT+K in vertex paint doesn't update
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex_color_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_color_ops.c15
1 files changed, 12 insertions, 3 deletions
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;
}