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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-09-30 17:34:48 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-10-01 13:53:23 +0300
commite82ac9e596de98d8b0fcae0c7f10ef87fe2cdd50 (patch)
treecaeaf847377476e3e20f3b5f2c9f9ed11410af5a /source/blender/blenkernel/intern/editlattice.c
parentc9b9803a772ccb7539a71785e121b049620d00d7 (diff)
Fix T70376: Lattice point looses state on modeswitch when shape keys are
present Selection state of lattice points as well as their weight were not kept when going in and out of editmode, code would just copy positions. Now copy the whole BPoint instead. Reviewers: campbellbarton Maniphest Tasks: T70376 Differential Revision: https://developer.blender.org/D5948
Diffstat (limited to 'source/blender/blenkernel/intern/editlattice.c')
-rw-r--r--source/blender/blenkernel/intern/editlattice.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/editlattice.c b/source/blender/blenkernel/intern/editlattice.c
index 12e737bbaa8..2d71b847b5b 100644
--- a/source/blender/blenkernel/intern/editlattice.c
+++ b/source/blender/blenkernel/intern/editlattice.c
@@ -92,6 +92,21 @@ void BKE_editlattice_load(Object *obedit)
lt = obedit->data;
editlt = lt->editlatt->latt;
+ MEM_freeN(lt->def);
+
+ lt->def = MEM_dupallocN(editlt->def);
+
+ lt->flag = editlt->flag;
+
+ lt->pntsu = editlt->pntsu;
+ lt->pntsv = editlt->pntsv;
+ lt->pntsw = editlt->pntsw;
+
+ lt->typeu = editlt->typeu;
+ lt->typev = editlt->typev;
+ lt->typew = editlt->typew;
+ lt->actbp = editlt->actbp;
+
if (lt->editlatt->shapenr) {
actkey = BLI_findlink(&lt->key->block, lt->editlatt->shapenr - 1);
@@ -112,22 +127,6 @@ void BKE_editlattice_load(Object *obedit)
bp++;
}
}
- else {
- MEM_freeN(lt->def);
-
- lt->def = MEM_dupallocN(editlt->def);
-
- lt->flag = editlt->flag;
-
- lt->pntsu = editlt->pntsu;
- lt->pntsv = editlt->pntsv;
- lt->pntsw = editlt->pntsw;
-
- lt->typeu = editlt->typeu;
- lt->typev = editlt->typev;
- lt->typew = editlt->typew;
- lt->actbp = editlt->actbp;
- }
if (lt->dvert) {
BKE_defvert_array_free(lt->dvert, lt->pntsu * lt->pntsv * lt->pntsw);