diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-02-19 14:54:34 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-02-19 14:54:34 +0300 |
commit | bde215a60c16ce77a60ecb38eaf7802965d73c7f (patch) | |
tree | e1f723512eadd7a3032672401b555885b43ea2b8 /source/blender/blenkernel | |
parent | cfdb5b9a8b07bcea1c490e52570eb129c7f3ad43 (diff) |
Fix T68878: Update shapekeys during transformation
Only use the hack in `key_block_get_data` for the bmesh shapekey.
The remaining shapekeys can use the original offset values.
Differential Revision: https://developer.blender.org/D6516
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 6bc494ae3ee..22c05b53780 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -820,7 +820,7 @@ static void key_evaluate_relative(const int start, KeyBlock *refb; float weight, *weights = per_keyblock_weights ? per_keyblock_weights[keyblock_index] : NULL; - char *freefrom = NULL, *freereffrom = NULL; + char *freefrom = NULL; /* reference now can be any block */ refb = BLI_findlink(&key->block, kb->relative); @@ -830,7 +830,10 @@ static void key_evaluate_relative(const int start, poin = basispoin; from = key_block_get_data(key, actkb, kb, &freefrom); - reffrom = key_block_get_data(key, actkb, refb, &freereffrom); + + /* For meshes, use the original values instead of the bmesh values to + * maintain a constant offset. */ + reffrom = refb->data; poin += start * poinsize; reffrom += key->elemsize * start; // key elemsize yes! @@ -876,9 +879,6 @@ static void key_evaluate_relative(const int start, if (freefrom) { MEM_freeN(freefrom); } - if (freereffrom) { - MEM_freeN(freereffrom); - } BLI_assert(!"invalid 'cp[1]'"); return; } @@ -900,9 +900,6 @@ static void key_evaluate_relative(const int start, if (freefrom) { MEM_freeN(freefrom); } - if (freereffrom) { - MEM_freeN(freereffrom); - } } } } |