diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-10-02 20:42:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-10-02 20:42:12 +0400 |
commit | 8cb17690f128132ac30eefe7e8917ee8d5333004 (patch) | |
tree | 5377bdf7e3d72db4b696042893d00419f7b5a9e0 /source | |
parent | 9e72351c9621e7a03b634c15dca1f0d30c66ed37 (diff) |
Fix #23785: in the game engine, if an object had an armature modifier + another
modifier, it would apply the armature deformation twice.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 13 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_ModifierDeformer.cpp | 9 |
2 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 5fbce3af95f..01b02653a51 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1671,8 +1671,19 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos int numVerts = me->totvert; int required_mode; int isPrevDeform= FALSE; + int skipVirtualArmature = (useDeform < 0); - md = firstmd = (useDeform<0) ? ob->modifiers.first : modifiers_getVirtualModifierList(ob); + if(!skipVirtualArmature) { + firstmd = modifiers_getVirtualModifierList(ob); + } + else { + /* game engine exception */ + firstmd = ob->modifiers.first; + if(firstmd && firstmd->type == eModifierType_Armature) + firstmd = firstmd->next; + } + + md = firstmd; modifiers_clearErrors(ob); diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index f1f30938577..7bf83315d65 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -127,11 +127,10 @@ bool BL_ModifierDeformer::HasArmatureDeformer(Object *ob) if (!ob->modifiers.first) return false; - ModifierData* md; - for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) { - if (md->type == eModifierType_Armature ) - return true; - } + ModifierData* md = (ModifierData*)ob->modifiers.first; + if(md->type == eModifierType_Armature ) + return true; + return false; } |