From 394d0b3c7f1051654ab1725c87265e78d88f6e75 Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Thu, 8 Jun 2023 22:12:47 +0100 Subject: [PATCH] Fix #104672: FBX Byte type unsupported The Byte type "Z" was missing from the supported FBX types, which would result in an error attempting to parse an FBX containing Byte properties during import or conversion with fbx2json. The new variables for the Byte type refer to it as "int8", to reduce the chance of mixing it up with the existing "bytes" attributes and functions. The importer and exporter neither read nor write any Byte properties, so no changes are made to import or export. --- io_scene_fbx/data_types.py | 1 + io_scene_fbx/encode_bin.py | 7 +++++++ io_scene_fbx/fbx2json.py | 3 +++ io_scene_fbx/fbx_utils.py | 4 ++++ io_scene_fbx/json2fbx.py | 3 +++ io_scene_fbx/parse_fbx.py | 1 + 6 files changed, 19 insertions(+) diff --git a/io_scene_fbx/data_types.py b/io_scene_fbx/data_types.py index 38d3fec4d..cf612b8e6 100644 --- a/io_scene_fbx/data_types.py +++ b/io_scene_fbx/data_types.py @@ -4,6 +4,7 @@ # Script copyright (C) 2013 Blender Foundation BOOL = b'C'[0] +INT8 = b'Z'[0] INT16 = b'Y'[0] INT32 = b'I'[0] INT64 = b'L'[0] diff --git a/io_scene_fbx/encode_bin.py b/io_scene_fbx/encode_bin.py index 8433134a7..1666c0e43 100644 --- a/io_scene_fbx/encode_bin.py +++ b/io_scene_fbx/encode_bin.py @@ -56,6 +56,13 @@ class FBXElem: self.props_type.append(data_types.BOOL) self.props.append(data) + def add_int8(self, data): + assert(isinstance(data, int)) + data = pack('