FBX IO: Fix animation import when the newer opt-in FBX_KTIME is used #105019

Merged
Thomas Barlow merged 3 commits from Mysteryem/blender-addons:fbx_new_ktime into main 2023-12-01 01:00:26 +01:00
Member

FBX 2019.5 (file version 7700) introduced a new number of "ktimes" per
second to more accurately support some animation frame rates. The new
value is an opt-in until FBX version 8000, where it should then become
the default.

The importer will now look for new the header version and flag
specifying to opt in to the new FBX_KTIME value.

The exporter is unaffected because it always writes an FBX version 7400
binary.


The FBX SDK documentation lists the "ktimes" per second change in the new FBX 2019.5 features: https://help.autodesk.com/view/FBX/2020/ENU/?guid=FBX_Developer_Help_welcome_to_the_fbx_sdk_what_new_fbx_sdk_2019_html

While I have not yet encountered a version 7700 or newer .fbx file that uses the opt-in (only those which opt-out), the timecode to opt-in, FBXSDK_TC_STANDARD_DEFINITION, is 0 according to the FBX SDK documentation.

Note that FBX version 8000 does not exist yet, so I'm assuming that the documentation, that says version 8000 will use the new "ktimes" per second by default, will be correct in the future.


Attached is an animated cube .fbx exported from Blender and a version that I edited to use version 7700 and the opt-in (converting the times of each animation frame to the new "ktimes" so that the resulting animation is the same).

Both of these .fbx should be identical when imported, but without this patch FBXAnimTCTest0 will import with the wrong frame times.

FBX 2019.5 (file version 7700) introduced a new number of "ktimes" per second to more accurately support some animation frame rates. The new value is an opt-in until FBX version 8000, where it should then become the default. The importer will now look for new the header version and flag specifying to opt in to the new FBX_KTIME value. The exporter is unaffected because it always writes an FBX version 7400 binary. --- The FBX SDK documentation lists the "ktimes" per second change in the new FBX 2019.5 features: https://help.autodesk.com/view/FBX/2020/ENU/?guid=FBX_Developer_Help_welcome_to_the_fbx_sdk_what_new_fbx_sdk_2019_html While I have not yet encountered a version 7700 or newer .fbx file that uses the opt-in (only those which opt-out), the timecode to opt-in, `FBXSDK_TC_STANDARD_DEFINITION`, is `0` according to the FBX SDK documentation. Note that FBX version 8000 does not exist yet, so I'm assuming that the documentation, that says version 8000 will use the new "ktimes" per second by default, will be correct in the future. --- Attached is an animated cube .fbx exported from Blender and a version that I edited to use version 7700 and the opt-in (converting the times of each animation frame to the new "ktimes" so that the resulting animation is the same). Both of these .fbx should be identical when imported, but without this patch `FBXAnimTCTest0` will import with the wrong frame times.
Thomas Barlow added 1 commit 2023-11-22 02:43:07 +01:00
FBX 2019.5 (file version 7700) introduced a new number of "ktimes" per
second to more accurately support some animation frame rates. The new
value is an opt-in until FBX version 8000, where it should then become
the default.

The importer will now look for new the header version and flag
specifying to opt in to the new FBX_KTIME value.

The exporter is unaffected because it always writes an FBX version 7400
binary.
Thomas Barlow requested review from Bastien Montagne 2023-11-22 04:04:19 +01:00
Bastien Montagne approved these changes 2023-11-27 12:20:33 +01:00
Bastien Montagne left a comment
Owner

LGTM, thanks.

LGTM, thanks.
Thomas Barlow added 2 commits 2023-12-01 00:57:50 +01:00
Thomas Barlow merged commit a850ed1e38 into main 2023-12-01 01:00:26 +01:00
Thomas Barlow deleted branch fbx_new_ktime 2023-12-01 01:00:26 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#105019
No description provided.