yohanshin/WHAM

Import PKL to Blender

Closed this issue Β· 10 comments

I saw that there was another issue with the tip to get the code from VIBE, I did some rewrite to that code and put in a blend file to be easier to use.

Just need to install joblib in blender (there is a tab with the installation script) and add the SMPL fbx for male on the same folder as you have the blend file, and put the path to the pkl file.

Hope its useful
loading_WHAM_import_SMPL_FINAL.zip

I made a video showing the process on google colab and on how to use the blend file.

you can see it in youtube : https://youtu.be/7heJSFGzxAI

or on my patreon site: https://www.patreon.com/posts/wham-in-google-97760199

If you have problems understanding what I'm saying, there is closed caption available.

@carlosedubarreto you are fast man! BTW your 4d humans plugin helped a lot, but would be cool, if your plugins would support linux systems :)

@mrEuler
LOL. Took me more than a week to make it work, I consider that slow 😁
and was able to make it work only because 2 other people helped me.

Oh, about linux, that is complicated, since I do a workaround to make the process use a different python than the blender one, this way I'm sure it wont cause problems to blender versions and the heavy data that is installed is interchangeable iwth other versions of blender inside the user pc.

I could probably do some code for it to work on linux, but, to be honest I hardly have time to code for windows, that is my main system.

To be able to make for linux I would need to work full time on this, something I cannot do or else I'll starve πŸ˜….

So I'm not saying that wont be linux versions, but it will be much more difficult for me to make them.

And thanks for the words 😍

@carlosedubarreto No worries, actually I was able to put everything from your plugin and blender inside the docker container and make it working almost everywhere, where CUDA is correct.

Hey @carlosedubarreto thank you so much for the blend file :)

Just the script for the ones that dont have blender
import_WHAM_in blender.txt

@carlosedubarreto
Nice work for the blender script! Do you know how to apply the animation i.e. output from WHAM to Mixamo rig? I tried using changing the bone names, but the animation look weird...

h0han commented

@carlosedubarreto Thank you for your effort!
Based on your excellent contribution, I have further worked on the code to convert it into an FBX file format that can be imported into Unity. With this code, you no longer need to manually change the vertical axis in Blender.

pkl2fbx4unity.txt

g8392 commented

Just the script for the ones that dont have blender import_WHAM_in blender.txt

Thanks everyone for the effort, I'm trying the scripts but either the original one or the ones you shared here give me this KeyError: 'pose' or if I change the character number sometimes gets to:

    apply_trans_pose_shape(Vector(tran), pose_final, shape, obj,arm_ob, obname, scene, cam_ob, fframe)
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 68, in apply_trans_pose_shape
    mrots, bsh = rodrigues2bshapes(pose)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 59, in rodrigues2bshapes
    mat_rots = [Rodrigues(rod_rot) for rod_rot in rod_rots]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 59, in <listcomp>
    mat_rots = [Rodrigues(rod_rot) for rod_rot in rod_rots]
                ^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 44, in Rodrigues
    mat = np.asarray([[0, -r[2], r[1]],
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (3, 3) + inhomogeneous part.

I've got WHAM working on different videos but can't seem to get the data out.


I've got it working by using a 2.83 blender and numpy 1.21.1, anyone has also extracted the camera pose?

h0han commented