[PR] - Add direct FBX (Mixamo, etc...) import to BVH Retargeter

Issue #1975 resolved
GeneralProtectionFault created an issue

I have attached a modified version of the load.py file (only one relevant to this).

I adapted (stole 😅 ) this code which is meant to batch convert FBX files to BVH:

https://github.com/DeepMotionEditing/deep-motion-editing/blob/master/blender_rendering/utils/fbx2bvh.py

Basically just updated the labeling/restrictions on file extension to reflect FBX as well as BVH. A few tweaks required, like setting the scale and such. It imports the FBX using Blender’s existing ability, exports the same-named BVH file in the same folder, and also takes care of deleting the imported FBX object(s), since it’s only there to facilitate the BVH conversion.

Mixamo apparently used to offer BVH, but now only offers FBX. I didn’t test this into the ground, but I tested with the Capoeira.fbx from Mixamo and it appears to work.

If this would not cause downstream headaches, I think it would be a useful time saver on converting.

Comments (8)

  1. GeneralProtectionFault reporter
      <div class="preview-container wiki-content"><!-- loaded via ajax --></div>
      <div class="mask"></div>
    </div>
    

    </div> </form>

  2. GeneralProtectionFault reporter
      <div class="preview-container wiki-content"><!-- loaded via ajax --></div>
      <div class="mask"></div>
    </div>
    

    </div> </form>

  3. GeneralProtectionFault reporter

    Awesome, thanks! And thanks for cleaning up my code, I was excited about it LOL.

    Looking at that other repo, it seems like it would just be a few lines to handle loading a collada file too, the BVH export is basically the same once Blender imports [whatever].

    However, I actually tried and couldn’t find any free mocap files in that format, so maybe it’s not worth it 😋 .

    Only other thing I thought might be worth mentioning is (again, looking at the alternate repo’s solution) this:

    bpy.ops.import_scene.fbx(filepath = filepath, automatic_bone_orientation=True, ignore_leaf_bones=True)
    

    You’d know better than me if these are wise, I am not sure if that is a good idea or not.

  4. Thomas Larsson repo owner

    I don’t think the extra keywords help much, but they don’t seem to harm either, so I added them. I also made sure that the temporary fbx data is removed, even if something goes wrong (typically that the bvh exporter isn’t enabled).

  5. Log in to comment