Fix #104684: json2fbx.py script creates invalid FBX v7500+ files #104913

Merged
Thomas Barlow merged 3 commits from Mysteryem/blender-addons:fbx_fix_v7500_json2fbx into main 2023-09-26 03:57:19 +02:00

3 Commits

Author SHA1 Message Date
ba77b59317 Increase FBX IO version 2023-09-26 02:47:13 +01:00
26eb851787 Merge branch 'main' into fbx_fix_v7500_json2fbx 2023-09-26 02:46:39 +01:00
10028be6ce Fix #104684: json2fbx.py script creates invalid FBX v7500+ files
As of FBX version 7500, the element metadata values are 64-bit as
opposed to being 32-bit in earlier versions.

FBX exported by Blender are currently always FBX version 7400, so the
fbx binary writing code was only set up to handle writing version 7400
files and earlier.

The json2fbx.py script however, can create FBX files with whatever
version is defined in the .json. Because the script uses the same code
as exporting an FBX with Blender, it would create invalid FBX version
7500+ files with 32-bit metadata values. Attempting to read one of these
files with Blender or external software would cause errors.

This patch sets global variables based on the version of the file being
exported and then uses those global variables when exporting to export
with the correct metadata values for the file version being exported.
This process is very similar to what is already done in parse_fbx.py
when importing FBX files.

There are no expected changes to FBX files exported by Blender with this
patch, only the json2fbx.py script should be affected.
2023-09-25 02:25:09 +01:00