[Bf-blender-cvs] [e82ac9e596d] master: Fix T70376: Lattice point looses state on modeswitch when shape keys are present

Philipp Oeser noreply at git.blender.org
Tue Oct 1 12:54:26 CEST 2019


Commit: e82ac9e596de98d8b0fcae0c7f10ef87fe2cdd50
Author: Philipp Oeser
Date:   Mon Sep 30 16:34:48 2019 +0200
Branches: master
https://developer.blender.org/rBe82ac9e596de98d8b0fcae0c7f10ef87fe2cdd50

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

===================================================================

M	source/blender/blenkernel/intern/editlattice.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list