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:
authorCampbell Barton <ideasman42@gmail.com>2020-06-13 06:14:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-13 06:19:34 +0300
commit9f5833798caf9581c2d781f4e2f8b95acb1560e0 (patch)
tree2c216f13fb90244a2160959faa754f0e327836d7 /source/blender/modifiers/intern/MOD_lattice.c
parenta35de34eb78aba5e08938066c0ecdcb05f677a8f (diff)
Modifier: skip edit-mesh conversion for armature, curve & lattice
This is an improvement over 2.7x which converted edit-mesh to mesh (CDDM) for all 3 modifiers. Overall this increases performance in edit-mode by around 15-20%.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_lattice.c')
-rw-r--r--source/blender/modifiers/intern/MOD_lattice.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c
index a6eaf7e78aa..574ea969be4 100644
--- a/source/blender/modifiers/intern/MOD_lattice.c
+++ b/source/blender/modifiers/intern/MOD_lattice.c
@@ -130,23 +130,16 @@ static void deformVerts(ModifierData *md,
static void deformVertsEM(ModifierData *md,
const ModifierEvalContext *ctx,
struct BMEditMesh *em,
- struct Mesh *mesh,
+ struct Mesh *UNUSED(mesh),
float (*vertexCos)[3],
int numVerts)
{
- struct Mesh *mesh_src = MOD_deform_mesh_eval_get(
- ctx->object, em, mesh, NULL, numVerts, false, false);
-
- /* TODO(Campbell): use edit-mode data only (remove this line). */
- if (mesh_src != NULL) {
- BKE_mesh_wrapper_ensure_mdata(mesh_src);
- }
+ LatticeModifierData *lmd = (LatticeModifierData *)md;
- deformVerts(md, ctx, mesh_src, vertexCos, numVerts);
+ MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */
- if (!ELEM(mesh_src, NULL, mesh)) {
- BKE_id_free(NULL, mesh_src);
- }
+ BKE_lattice_deform_coords_with_editmesh(
+ lmd->object, ctx->object, vertexCos, numVerts, lmd->flag, lmd->name, lmd->strength, em);
}
static void panel_draw(const bContext *C, Panel *panel)