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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-12-01 12:12:18 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-12-01 12:12:35 +0300
commitbfcd25b313998d5d62e927f80a837555c5113de7 (patch)
treee463d0a971afc2f7ddf3ff1faaf33f3eee4a973e /source/blender/blenkernel/intern/DerivedMesh.c
parent32d46f7de6f0cf9c80dde8147ddeecd3ca2e576b (diff)
Texture Paint: avoid rebuilding evaluated mesh on first stroke.
Ensure all relevant CustomDataMask bits are set during normal evaluation.
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 992771d368d..a34d9642a90 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2007,6 +2007,11 @@ static void mesh_build_data(
BKE_object_free_derived_caches(ob);
BKE_object_sculpt_modifiers_changed(ob);
+ if (need_mapping) {
+ /* Also add the flag so that it is recorded in lastDataMask. */
+ dataMask |= CD_MASK_ORIGINDEX;
+ }
+
mesh_calc_modifiers(
depsgraph, scene, ob, NULL, 1, need_mapping, dataMask, -1, true, build_shapekey_layers,
&ob->runtime.mesh_deform_eval, &ob->runtime.mesh_eval);
@@ -2078,7 +2083,7 @@ static CustomDataMask object_get_datamask(const Depsgraph *depsgraph, Object *ob
}
if (DEG_get_original_object(ob) == actob) {
- bool editing = BKE_paint_select_face_test(ob);
+ bool editing = BKE_paint_select_face_test(actob);
/* weight paint and face select need original indices because of selection buffer drawing */
if (r_need_mapping) {
@@ -2087,7 +2092,7 @@ static CustomDataMask object_get_datamask(const Depsgraph *depsgraph, Object *ob
/* check if we need tfaces & mcols due to face select or texture paint */
if ((ob->mode & OB_MODE_TEXTURE_PAINT) || editing) {
- mask |= CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL;
+ mask |= CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTFACE;
}
/* check if we need mcols due to vertex paint or weightpaint */
@@ -2156,7 +2161,7 @@ Mesh *mesh_get_eval_final(
if (!ob->runtime.mesh_eval ||
((dataMask & ob->lastDataMask) != dataMask) ||
- (need_mapping != ob->lastNeedMapping))
+ (need_mapping && !ob->lastNeedMapping))
{
mesh_build_data(depsgraph, scene, ob, dataMask, false, need_mapping);
}