FBX IO: Add support for armature data custom properties #104888

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

View File

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

View File

@ -573,7 +573,10 @@ def fbx_data_empty_elements(root, empty, scene_data):
props = elem_properties(null)
elem_props_template_finalize(tmpl, props)
# No custom properties, already saved with object (Model).
# Empty/Armature Object custom properties have already been saved with the Model.
# Only Armature data custom properties need to be saved here with the NodeAttribute.
if bdata.type == 'ARMATURE':
fbx_data_element_custom_properties(props, bdata.data)
def fbx_data_light_elements(root, lamp, scene_data):

View File

@ -2826,8 +2826,13 @@ class FbxImportHelperNode:
elem_find_first(fbx_tmpl, b'Properties70', fbx_elem_nil))
if settings.use_custom_props:
# Read Armature Object custom props from the Node
blen_read_custom_properties(self.fbx_elem, arm, settings)
if self.fbx_data_elem:
# Read Armature Data custom props from the NodeAttribute
blen_read_custom_properties(self.fbx_data_elem, arm_data, settings)
# instance in scene
view_layer.active_layer_collection.collection.objects.link(arm)
arm.select_set(True)