FBX IO: Fix Empty export type control also affecting armatures #104887

Merged
Thomas Barlow merged 3 commits from Mysteryem/blender-addons:fbx_fix_armature_data_export_type into main 2023-09-19 01:32:26 +02:00
2 changed files with 10 additions and 4 deletions

View File

@ -5,7 +5,7 @@
bl_info = { bl_info = {
"name": "FBX format", "name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem",
"version": (5, 7, 5), "version": (5, 7, 6),
"blender": (3, 6, 0), "blender": (3, 6, 0),
"location": "File > Import-Export", "location": "File > Import-Export",
"description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions",

View File

@ -552,14 +552,20 @@ def fbx_data_element_custom_properties(props, bid):
def fbx_data_empty_elements(root, empty, scene_data): 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] empty_key = scene_data.data_empties[empty]
null = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(empty_key)) 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")) null.add_string(fbx_name_class(empty.name.encode(), b"NodeAttribute"))
val = empty.bdata.get('fbx_type', None) bdata = empty.bdata
null.add_string(val.encode() if val and isinstance(val, str) else b"Null") 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") elem_data_single_string(null, b"TypeFlags", b"Null")