A-Ribeiro / CustomBlenderFBXExporter

103 stars 8 forks source link

animation with out bake #4

Closed YuriKruglov closed 6 months ago

YuriKruglov commented 8 months ago

The only way to export animation in fbx format is to export baked animation. There is no options to export objects with animation keys, that were set in exact frames in exact transformation channels. There is always some sort of interpolation accure with adding extra keys while baking animation. Simplification option removes necessary keys and there is no way to keep them. In game dev industry piplelines very often it is very important to share models via fbx with original animation keys. By the way, the option to export animation with out baking implemented in 3ds max and Maya and works well. For example I rotate cub in X axis, set 5 keys, in graph mode "empty" keys in Y and Z channel were deleted. After export with three simplification settings 0, 0,5 and 1 I got keys that didnt match initial animation keys. Dear @A-Ribeiro, is it possible to tweak blender fbx exporter so it doesn’t bake the animation but keep keys as they were set?

2_fbx_baked_keys 1_initial_animation_keys 3dsmax_fbx_exporter

A-Ribeiro commented 6 months ago

Hi,

I taken a look at the code.

The current exporter doesn't has an exporter for the animations without being baked.

You can check it at the file: export_fbx_bin.py line: 2875 .

    if settings.bake_anim:
        # From objects & bones only for a start.
        # Kind of hack, we need a temp scene_data for object's space handling to bake animations...
        tmp_scdata = FBXExportData(
            None, None, None,
            settings, scene, depsgraph, objects, None, None, 0.0, 0.0,
            data_empties, data_lights, data_cameras, data_meshes, None,
            data_bones, data_leaf_bones, data_deformers_skin, data_deformers_shape,
            data_world, data_materials, data_textures, data_videos,
        )
        animations, animated, frame_start, frame_end = fbx_animations(tmp_scdata)

This implementation doesn't has the else part. If you uncheck the bake animation, it will export a FBX file without any animation on it.

I think it is possible to implement this feature, but it will take longer time to search on blender's api doc and come up with the code to deal with this issue. I suggest you, if it is a critical feature to your work, to contract a developer to do that or search for another exporter.

YuriKruglov commented 5 months ago

Hi,

I taken a look at the code.

The current exporter doesn't has an exporter for the animations without being baked.

You can check it at the file: export_fbx_bin.py line: 2875 .

    if settings.bake_anim:
        # From objects & bones only for a start.
        # Kind of hack, we need a temp scene_data for object's space handling to bake animations...
        tmp_scdata = FBXExportData(
            None, None, None,
            settings, scene, depsgraph, objects, None, None, 0.0, 0.0,
            data_empties, data_lights, data_cameras, data_meshes, None,
            data_bones, data_leaf_bones, data_deformers_skin, data_deformers_shape,
            data_world, data_materials, data_textures, data_videos,
        )
        animations, animated, frame_start, frame_end = fbx_animations(tmp_scdata)

This implementation doesn't has the else part. If you uncheck the bake animation, it will export a FBX file without any animation on it.

I think it is possible to implement this feature, but it will take longer time to search on blender's api doc and come up with the code to deal with this issue. I suggest you, if it is a critical feature to your work, to contract a developer to do that or search for another exporter.

Thanks a lot!