vchoutas / smplify-x

Expressive Body Capture: 3D Hands, Face, and Body from a Single Image
https://smpl-x.is.tue.mpg.de/
Other
1.73k stars 335 forks source link

Exported FBX model from Blender with SMPLX plugin does not match the initially created UPD: Solved with applying Shape Keys #156

Open MrJimm opened 2 years ago

MrJimm commented 2 years ago

Hi! I try to export FBX mesh of SMPLX, generated with official plugin in Blender (tested in 2.9), and found out, that after reimporting it back the shape does not match with the initially generated one. No pose was changed, only shape parameters. изображение

Moreover, if I go from Object mode to Edit mode in Blender for the same generated SMPLX object - the mesh seems to go to some default form, that differs from the shape in the Object mode. изображение изображение

Please, tell me, how can I export mesh in FBX with vertices in exact coordinates I see in Object mode?

MrJimm commented 2 years ago

UPD: Solved I have found the solution myself, in case you need mesh itself, without further ability to manipulate it with SMPLX plugin. I found out that SMPLX morphing is implemented with "Shape keys" system in Blender. In order to obtain the mesh of the final form, you need to "apply" all shape keys. One can do it using for example this script (note: 'ob' is the reference to the mesh, not a parent armature):

def apply_shape_keys(ob):
    if not hasattr(ob.data, "shape_keys"):
        return
    ob.shape_key_add(name='CombinedKeys', from_mix=True)
    if ob.data.shape_keys:
        for shapeKey in ob.data.shape_keys.key_blocks:
            ob.shape_key_remove(shapeKey)

Also, if you have some issues with armature reimport, you can then unparent mesh from armature and apply armature modifier.