carlosedubarreto / b3d_mocap_import

addon for blender to import mocap data from tools like easymocap, frankmocap and Vibe
106 stars 14 forks source link

Problem importing SMPL generated by EasyMocap #9

Closed lukecageit closed 3 years ago

lukecageit commented 3 years ago

I have this error when i'm trying to import with your plugin (my results are in: '1_output\sample\smpl' folder), what is the problem?

Python: Traceback (most recent call last):
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 356, in execute
    #bpy.data.objects[armature].select_set(True)
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 273, in load_smpl_params
    motions = load_motions(datapath)
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 258, in load_motions
    infos = read_smpl(filename)
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 230, in read_smpl
    data_pkl = read_pkl(filename+'.pkl')
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 222, in read_pkl
    with open(path_pkl, 'rb') as pk:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\MOCAP\\EasyMocap\\1_output\\sample\\smpl\\000000.pkl'

location: <unknown location>:-1
lukecageit commented 3 years ago

Ok i partially solved the problem with the help of this comment: https://github.com/zju3dv/EasyMocap/issues/25#issuecomment-842266080

But now i'm having another problem:

shape:  165 - frame: 0
Python: Traceback (most recent call last):
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 418, in execute
    #somente corpo e cabeca
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 194, in apply_trans_pose_shape
    bone = arm_ob.pose.bones[obname+'_'+part_bones['bone_%02d' % ibone]]
KeyError: 'bone_24'

location: <unknown location>:-1
carlosedubarreto commented 3 years ago

try to replace these files on your easymocap folder

path: easymocap\smplmodel\body_model.py

and apps\demo\mv1p.py

Unzip the files attached on the folders above mv1p.zip body_model.zip

I've added instructions and the files on this folder. Thanks for pointing it out.

https://github.com/carlosedubarreto/b3d_mocap_import/tree/main/replace_easymocap_files

lukecageit commented 3 years ago

try to replace these files on your easymocap folder

path: easymocap\smplmodel\body_model.py

and apps\demo\mv1p.py

Unzip the files attached on the folders above mv1p.zip body_model.zip

I've added instructions and the files on this folder. Thanks for pointing it out.

https://github.com/carlosedubarreto/b3d_mocap_import/tree/main/replace_easymocap_files

sorry i tried but same error, maybe is the FBX that i use for the Armature? (i use the "SMPL for Maya" one, "basicModel_m_lbs_10_207_0_v1.0.2.fbx")

This is the error:

Python: Traceback (most recent call last):
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 428, in execute
    arm_ob, obname, scene, cam_ob, frame)
  File "C:\Users\andrea\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\Mocap_PE_data_import\load_mocap.py", line 194, in apply_trans_pose_shape
    bone = arm_ob.pose.bones[obname+'_'+part_bones['bone_%02d' % ibone]]
KeyError: 'bone_24'

location: <unknown location>:-1
carlosedubarreto commented 3 years ago

Yeah you are right. Its the smplx model used.

Take a look at this video. It is explaining what you have to do https://youtu.be/-vvSjAyiK_g

lukecageit commented 3 years ago

Yeah you are right. Its the smplx model used.

Take a look at this video. It is explaining what you have to do https://youtu.be/-vvSjAyiK_g

Ok this solved all the problems thanks! The Addon needs to be downloaded from here and not from gitlab page, otherwise the addon will be empty without the necessary models: https://smpl-x.is.tue.mpg.de/downloads

carlosedubarreto commented 3 years ago

Thanks a lot for the input....I forgot that. I'll update the documentation.