- attached Capoeira.fbx
[PR] - Add direct FBX (Mixamo, etc...) import to BVH Retargeter
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:
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)
-
reporter -
reporter - attached Capoeira.fbx
<div class="preview-container wiki-content"><!-- loaded via ajax --></div> <div class="mask"></div> </div>
</div> </form>
-
reporter Just for kicks, I found another take on this which appears to also support .dae :)
https://github.com/Dene33/dae_fbx_to_bvh/blob/master/dae_fbx_to_bvh.py
Didn’t try that just yet, but good to reference.
-
- changed status to open
-
repo owner Good idea! Implemented in latest commit.
-
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.
-
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).
-
- changed status to resolved
- Log in to comment
</div> </form>