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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-02-17 22:03:55 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-02-17 22:03:55 +0300
commit322b1d3187fc5b3e82ebf8b13a675e3132059ef4 (patch)
tree50a7091fc310cd503e3878a9b9f7a4734f9fcdc7 /source/blender/editors/curve/editcurve.c
parentcb36dbe606d9e5bef32a756a60b1d77a92dccfa8 (diff)
parent6f1493f68fe01a8e951cf6c4e50103e20b85d513 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/editors/animation/anim_draw.c
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r--source/blender/editors/curve/editcurve.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 6b5a5d81d32..276cfb373c2 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1196,6 +1196,11 @@ void ED_curve_editnurb_load(Object *obedit)
remap_hooks_and_vertex_parents(obedit);
+ /* We have to apply shapekeys *before* copying nurbs into newnurb, otherwise the reset to
+ * refkey/original curve data that has to be done when editing non-refkey shapekey would be useless,
+ * only affecting editnurb and not ob->data. */
+ calc_shapeKeys(obedit);
+
for (nu = editnurb->first; nu; nu = nu->next) {
newnu = BKE_nurb_duplicate(nu);
BLI_addtail(&newnurb, newnu);
@@ -1207,7 +1212,6 @@ void ED_curve_editnurb_load(Object *obedit)
cu->nurb = newnurb;
- calc_shapeKeys(obedit);
ED_curve_updateAnimPaths(obedit->data);
BKE_nurbList_free(&oldnurb);
@@ -1228,7 +1232,6 @@ void ED_curve_editnurb_make(Object *obedit)
if (actkey) {
// XXX strcpy(G.editModeTitleExtra, "(Key) ");
undo_editmode_clear();
- BKE_keyblock_convert_to_curve(actkey, cu, &cu->nurb);
}
if (editnurb) {
@@ -1249,12 +1252,16 @@ void ED_curve_editnurb_make(Object *obedit)
nu = nu->next;
}
- if (actkey)
- editnurb->shapenr = obedit->shapenr;
-
/* animation could be added in editmode even if there was no animdata in
* object mode hence we always need CVs index be created */
init_editNurb_keyIndex(editnurb, &cu->nurb);
+
+ if (actkey) {
+ editnurb->shapenr = obedit->shapenr;
+ /* Apply shapekey to new nurbs of editnurb, not those of original curve (and *after* we generated keyIndex),
+ * else we do not have valid 'original' data to properly restore curve when leaving editmode. */
+ BKE_keyblock_convert_to_curve(actkey, cu, &editnurb->nurbs);
+ }
}
}