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:
-rw-r--r--source/blender/blenkernel/intern/mesh.c10
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h9
-rw-r--r--source/blender/modifiers/intern/MOD_datatransfer.c48
-rw-r--r--source/blender/modifiers/intern/MOD_normal_edit.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvwarp.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weighted_normal.c3
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c2
10 files changed, 55 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index fccc4380fec..2a16d0eb0f8 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -95,7 +95,15 @@ static void mesh_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int
/* This is a direct copy of a main mesh, so for now it has the same topology. */
mesh_dst->runtime.deformed_only = true;
}
- /* XXX WHAT? Why? Comment, please! And pretty sure this is not valid for regular Mesh copying? */
+ /* This option is set for run-time meshes that have been copied from the current objects mode.
+ * Currently this is used for edit-mesh although it could be used for sculpt or other
+ * kinds of data specific to an objects mode.
+ *
+ * The flag signals that the mesh hasn't been modified from the data that generated it,
+ * allowing us to use the object-mode data for drawing.
+ *
+ * While this could be the callers responsibility, keep here since it's
+ * highly unlikely we want to create a duplicate and not use it for drawing. */
mesh_dst->runtime.is_original = false;
/* Only do tessface if we have no polys. */
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 3816cee0cf8..a6aef5b08ad 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -109,9 +109,12 @@ typedef struct Mesh_Runtime {
/** Set by modifier stack if only deformed from original. */
char deformed_only;
/**
- * Copied from edit-mesh (hint, draw with editmesh data).
- * In the future we may leave the mesh-data empty
- * since its not needed if we can use edit-mesh data. */
+ * Copied from edit-mesh (hint, draw with edit-mesh data when true).
+ *
+ * Modifiers that edit the mesh data in-place must set this to false
+ * (most #eModifierTypeType_NonGeometrical modifiers). Otherwise the edit-mesh
+ * data will be used for drawing, missing changes from modifiers. See T79517.
+ */
char is_original;
/** #eMeshWrapperType and others. */
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index 031b82fa89e..c8f49694a2f 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -204,29 +204,31 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
BKE_reports_init(&reports, RPT_STORE);
/* Note: no islands precision for now here. */
- BKE_object_data_transfer_ex(ctx->depsgraph,
- scene,
- ob_source,
- ctx->object,
- result,
- dtmd->data_types,
- false,
- dtmd->vmap_mode,
- dtmd->emap_mode,
- dtmd->lmap_mode,
- dtmd->pmap_mode,
- space_transform,
- false,
- max_dist,
- dtmd->map_ray_radius,
- 0.0f,
- dtmd->layers_select_src,
- dtmd->layers_select_dst,
- dtmd->mix_mode,
- dtmd->mix_factor,
- dtmd->defgrp_name,
- invert_vgroup,
- &reports);
+ if (BKE_object_data_transfer_ex(ctx->depsgraph,
+ scene,
+ ob_source,
+ ctx->object,
+ result,
+ dtmd->data_types,
+ false,
+ dtmd->vmap_mode,
+ dtmd->emap_mode,
+ dtmd->lmap_mode,
+ dtmd->pmap_mode,
+ space_transform,
+ false,
+ max_dist,
+ dtmd->map_ray_radius,
+ 0.0f,
+ dtmd->layers_select_src,
+ dtmd->layers_select_dst,
+ dtmd->mix_mode,
+ dtmd->mix_factor,
+ dtmd->defgrp_name,
+ invert_vgroup,
+ &reports)) {
+ result->runtime.is_original = false;
+ }
if (BKE_reports_contain(&reports, RPT_ERROR)) {
const char *report_str = BKE_reports_string(&reports, RPT_ERROR);
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index 66ab6b9e4db..f22ece11726 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -637,6 +637,8 @@ static Mesh *normalEditModifier_do(NormalEditModifierData *enmd,
CustomData_free_layers(pdata, CD_NORMAL, num_polys);
MEM_SAFE_FREE(loopnors);
+ result->runtime.is_original = false;
+
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 6f261f9f67a..361c778bb95 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -308,6 +308,8 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
}
+ mesh->runtime.is_original = false;
+
/* Mark tessellated CD layers as dirty. */
mesh->runtime.cd_dirty_vert |= CD_MASK_TESSLOOPNORMAL;
diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c
index adc89f1b954..05224e1ffaa 100644
--- a/source/blender/modifiers/intern/MOD_uvwarp.c
+++ b/source/blender/modifiers/intern/MOD_uvwarp.c
@@ -235,6 +235,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
/* XXX TODO is this still needed? */
// me_eval->dirty |= DM_DIRTY_TESS_CDLAYERS;
+ mesh->runtime.is_original = false;
+
return mesh;
}
diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c
index f174b6d5aa4..744bab02c56 100644
--- a/source/blender/modifiers/intern/MOD_weighted_normal.c
+++ b/source/blender/modifiers/intern/MOD_weighted_normal.c
@@ -677,6 +677,9 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
/* Currently Modifier stack assumes there is no poly normal data passed around... */
CustomData_free_layers(pdata, CD_NORMAL, numPolys);
+
+ result->runtime.is_original = false;
+
return result;
}
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 6bb4f3dc1b5..4f67fd88d4e 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -312,6 +312,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
MEM_freeN(new_w);
MEM_freeN(dw);
+ mesh->runtime.is_original = false;
+
/* Return the vgroup-modified mesh. */
return mesh;
}
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 9821ead2340..649481a7023 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -455,6 +455,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
MEM_freeN(dw2);
MEM_SAFE_FREE(indices);
+ mesh->runtime.is_original = false;
+
/* Return the vgroup-modified mesh. */
return mesh;
}
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 0668a7a086f..b23eb997f61 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -637,6 +637,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
TIMEIT_END(perf);
#endif
+ mesh->runtime.is_original = false;
+
/* Return the vgroup-modified mesh. */
return mesh;
}