From 2679a78b034ec9c593a6400290f1a454f81cc4b5 Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Fri, 15 Sep 2023 00:23:12 +0100 Subject: [PATCH 1/2] FBX IO: Fix custom property control of armature NodeAttribute export type The NodeAttribute for Empty Objects can be controlled using a custom property called 'fbx_type' on the Object. This feature was also being applied to Armature Objects because they use the same function for exporting their NodeAttribute. A check has now been added such that the exported type can only be changed when the Object is an Empty. --- io_scene_fbx/export_fbx_bin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 2b2a393f5..0feeefda8 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -552,14 +552,20 @@ def fbx_data_element_custom_properties(props, bid): def fbx_data_empty_elements(root, empty, scene_data): """ - Write the Empty data block (you can control its FBX datatype with the 'fbx_type' string custom property). + Write the Empty data block (you can control its FBX datatype with the 'fbx_type' string custom property) or Armature + NodeAttribute. """ empty_key = scene_data.data_empties[empty] null = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(empty_key)) null.add_string(fbx_name_class(empty.name.encode(), b"NodeAttribute")) - val = empty.bdata.get('fbx_type', None) - null.add_string(val.encode() if val and isinstance(val, str) else b"Null") + bdata = empty.bdata + if bdata.type == 'EMPTY': + val = bdata.get('fbx_type', None) + fbx_type = val.encode() if val and isinstance(val, str) else b"Null" + else: + fbx_type = b"Null" + null.add_string(fbx_type) elem_data_single_string(null, b"TypeFlags", b"Null") -- 2.30.2 From e968b0b62a82411810f1aa8bacd17529ac949a0a Mon Sep 17 00:00:00 2001 From: Thomas Barlow Date: Tue, 19 Sep 2023 00:28:26 +0100 Subject: [PATCH 2/2] Increase FBX IO version --- io_scene_fbx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 690282da1..5cc0aa5f4 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -5,7 +5,7 @@ bl_info = { "name": "FBX format", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem", - "version": (5, 7, 5), + "version": (5, 7, 6), "blender": (3, 6, 0), "location": "File > Import-Export", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions", -- 2.30.2