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>2013-01-03 10:47:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-03 10:47:44 +0400
commitd8d24bdebd4544825c57e86a47bf796fe8ead64b (patch)
treef4b5d790e7cf31c581be0b3be29b7f712cf0ba3a /source/blender/modifiers
parentdf3e2448871990fb96d6e2149d672e6a6ce43a92 (diff)
fix [#33682] Animation not updated when the active shape index isnt set
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_shapekey.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c
index 7fe8dc69790..697ccdc49a4 100644
--- a/source/blender/modifiers/intern/MOD_shapekey.c
+++ b/source/blender/modifiers/intern/MOD_shapekey.c
@@ -54,13 +54,16 @@ static void deformVerts(ModifierData *md, Object *ob,
int numVerts,
ModifierApplyFlag UNUSED(flag))
{
- KeyBlock *kb = BKE_keyblock_from_object(ob);
+ Key *key = BKE_key_from_object(ob);
float (*deformedVerts)[3];
- if (kb && kb->totelem == numVerts) {
- deformedVerts = (float(*)[3])do_ob_key(md->scene, ob);
+ if (key && key->block.first) {
+ int deformedVerts_tot;
+ deformedVerts = (float(*)[3])BKE_key_evaluate_object(md->scene, ob, &deformedVerts_tot);
if (deformedVerts) {
- memcpy(vertexCos, deformedVerts, sizeof(float) * 3 * numVerts);
+ if (numVerts == deformedVerts_tot) {
+ memcpy(vertexCos, deformedVerts, sizeof(float) * 3 * numVerts);
+ }
MEM_freeN(deformedVerts);
}
}