Fix #104773: FBX import fails when custom property name matches an expected non-custom property #104821

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:fbx_find_props_ignore_custom_pr into main 2023-08-08 16:14:44 +02:00

View File

@ -168,6 +168,7 @@ def elem_prop_first(elem, default=None):
# ---- # ----
# Support for # Support for
# Properties70: { ... P: # Properties70: { ... P:
# Custom properties ("user properties" in FBX) are ignored here and get handled separately (see #104773).
def elem_props_find_first(elem, elem_prop_id): def elem_props_find_first(elem, elem_prop_id):
if elem is None: if elem is None:
# When properties are not found... Should never happen, but happens - as usual. # When properties are not found... Should never happen, but happens - as usual.
@ -184,7 +185,8 @@ def elem_props_find_first(elem, elem_prop_id):
for subelem in elem.elems: for subelem in elem.elems:
assert(subelem.id == b'P') assert(subelem.id == b'P')
if subelem.props[0] == elem_prop_id: # 'U' flag indicates that the property has been defined by the user.
if subelem.props[0] == elem_prop_id and b'U' not in subelem.props[3]:
return subelem return subelem
return None return None