Fix #105045: Error importing FBX custom properties on placeholder PoseBones #105053

Closed
Thomas Barlow wants to merge 1 commits from Mysteryem/blender-addons:fbx_4_0_placeholder_custom_prop_backport into blender-v4.0-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 8 additions and 2 deletions
Showing only changes of commit bb90c4fbcf - Show all commits

View File

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

View File

@ -2742,7 +2742,13 @@ class FbxImportHelperNode:
pose_bone = arm.bl_obj.pose.bones[self.bl_bone]
pose_bone.matrix_basis = self.get_bind_matrix().inverted_safe() @ self.get_matrix()
if settings.use_custom_props:
# `self.fbx_elem` can be `None` in cases where the imported hierarchy contains a mix of bone and non-bone FBX
# Nodes parented to one another, e.g. "bone1"->"mesh1"->"bone2". In Blender, an Armature can only consist of
# bones, so to maintain the imported hierarchy, a placeholder bone with the same name as "mesh1" is inserted
# into the Armature and then the imported "mesh1" Object is parented to the placeholder bone. The placeholder
# bone won't have a `self.fbx_elem` because it belongs to the "mesh1" Object instead.
# See FbxImportHelperNode.find_fake_bones().
if settings.use_custom_props and self.fbx_elem:
blen_read_custom_properties(self.fbx_elem, pose_bone, settings)
for child in self.children: