DeepMotionEditing / deep-motion-editing

An end-to-end library for editing and rendering motion of 3D characters with deep learning [SIGGRAPH 2020]
BSD 2-Clause "Simplified" License
1.57k stars 257 forks source link

How to convert the .fbx file into .bvh file format? #25

Closed ANYMS-A closed 4 years ago

ANYMS-A commented 4 years ago

Hi, I was recently attracted by your fancy project and tried to train my custom model. However, I met a problem when preprocessing the data:

The animation data obtained from the Mixamo is in a .fbx format. But based on your source code, I think you use the .bvh data as the raw input. So could you please give me some suggestions about how to convert the .fbx data into a .bvh format!

Many Thanks!

HuntleyZ commented 4 years ago

MotionBuilder may solve your problem. @crissallan

kfiraberman commented 4 years ago

We provide a blender script for that operation here. You can specify within the file the desired data_path (a directory that contains directories of fbx files), then simply run : blender -b -P fbx2bvh.py the resulting bvh will appear next to their source fbx files.

ANYMS-A commented 4 years ago

We provide a blender script for that operation here. You can specify within the file the desired data_path (a directory that contains directories of fbx files), then simply run : blender -b -P fbx2bvh.py the resulting bvh will appear next to their source fbx files.

Thank you !

chuangchuang-wang commented 1 year ago

Who can help me when run blender -b -P fbx2bvh.py caused memory leak

sammedhi commented 1 year ago

Hello ! As I try to convert some fbx to bvh I end up with this error : bpy.ops.export_anim.bvh(filepath=dumppath, File "C:\Program Files\Blender Foundation\Blender 3.4\3.4\scripts\modules\bpy\ops.py", line 113, in __call__ ret = _op_call(self.idname_py(), None, kw) TypeError: Converting py args to operator properties: EXPORT_ANIM_OT_bvh.frame_start expected an int type, not float

Does someone have any idea on how to fix this ? Thanks !

tshrjn commented 1 year ago

I think this fbx2bvh.py script only works for animated fbx objects and not for static ones ie as in T-Pose. Since for static fbx, I get the following error:

Color management: using fallback mode for management
Color management: Error could not find role data role.
Blender 3.0.1
Color management: scene view "Filmic" not found, setting default "Standard".
FBX version: 7400
Traceback (most recent call last):
  File "/home/ubuntu/projects/text2motion/Retarget-Motion/deep-motion-editing/blender_rendering/utils/fbx2bvh.py", line 79, in <module>
    fbx2bvh(data_path, file)
  File "/home/ubuntu/projects/text2motion/Retarget-Motion/deep-motion-editing/blender_rendering/utils/fbx2bvh.py", line 55, in fbx2bvh
    action = bpy.data.actions[-1]
IndexError: bpy_prop_collection[-1]: out of range.

Blender quit
chrisdukey commented 1 year ago

Hello ! As I try to convert some fbx to bvh I end up with this error : bpy.ops.export_anim.bvh(filepath=dumppath, File "C:\Program Files\Blender Foundation\Blender 3.4\3.4\scripts\modules\bpy\ops.py", line 113, in __call__ ret = _op_call(self.idname_py(), None, kw) TypeError: Converting py args to operator properties: EXPORT_ANIM_OT_bvh.frame_start expected an int type, not float

Does someone have any idea on how to fix this ? Thanks !

@sammedhi This error is because EXPORT_ANIM_OT_bvh is expecting an integer for the starting frame. You just need to cast your frame_start and frame_end to an int

if action.frame_range[1] > frame_end: frame_end = int(action.frame_range[1]) if action.frame_range[0] < frame_start: frame_start = int(action.frame_range[0])