[Bf-blender-cvs] [383fef9f104] master: Fix T63616: applying armature modifier with another modifier under it doesnt apply right.

Bastien Montagne noreply at git.blender.org
Mon Apr 29 10:09:23 CEST 2019


Commit: 383fef9f10481d1dd5b8bf92a33b8d0995b136d4
Author: Bastien Montagne
Date:   Mon Apr 29 09:34:20 2019 +0200
Branches: master
https://developer.blender.org/rB383fef9f10481d1dd5b8bf92a33b8d0995b136d4

Fix T63616: applying armature modifier with another modifier under it doesnt apply right.

Some deform modifiers (like armature) use passed Mesh parameter to
retrieve some extra data (vgroups in our case), and default to obdata
when it is not available.

This should be fine in theory in the 'apply modifier to obdata' case,
since this is always the first modifier, but here upper-level code
passes **evaluated** object, not orig one, so ob->data is not orig
anymore, and might miss some stuff...

Note that am quiet unsure whether the way evaluated data is passed
around in that apply modifier operator code is actually OK, but for now
it seems to work at least...

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

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

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

diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 0402524e03d..3f4e504867c 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -1265,8 +1265,8 @@ Mesh *BKE_mesh_create_derived_for_modifier(struct Depsgraph *depsgraph,
     int numVerts;
     float(*deformedVerts)[3] = BKE_mesh_vertexCos_get(me, &numVerts);
 
-    mti->deformVerts(md_eval, &mectx, NULL, deformedVerts, numVerts);
     BKE_id_copy_ex(NULL, &me->id, (ID **)&result, LIB_ID_COPY_LOCALIZE);
+    mti->deformVerts(md_eval, &mectx, result, deformedVerts, numVerts);
     BKE_mesh_apply_vert_coords(result, deformedVerts);
 
     if (build_shapekey_layers) {



More information about the Bf-blender-cvs mailing list