WIP: FBX: Preventing import of duplicate shape keys #104939
@ -1931,7 +1931,10 @@ def blen_read_shapes(fbx_tmpl, fbx_data, objects, me, scene):
|
|||||||
# will be clamped, and we'll print a warning message to the console.
|
# will be clamped, and we'll print a warning message to the console.
|
||||||
shape_key_values_in_range = True
|
shape_key_values_in_range = True
|
||||||
bc_uuid_to_keyblocks = {}
|
bc_uuid_to_keyblocks = {}
|
||||||
for bc_uuid, fbx_sdata, fbx_bcdata in fbx_data:
|
for k, v in fbx_data.items():
|
||||||
|
bc_uuid = k[0]
|
||||||
|
fbx_sdata, fbx_bcdata = v
|
||||||
|
|
||||||
elem_name_utf8 = elem_name_ensure_class(fbx_sdata, b'Geometry')
|
elem_name_utf8 = elem_name_ensure_class(fbx_sdata, b'Geometry')
|
||||||
indices = elem_prop_first(elem_find_first(fbx_sdata, b'Indexes'))
|
indices = elem_prop_first(elem_find_first(fbx_sdata, b'Indexes'))
|
||||||
dvcos = elem_prop_first(elem_find_first(fbx_sdata, b'Vertices'))
|
dvcos = elem_prop_first(elem_find_first(fbx_sdata, b'Vertices'))
|
||||||
@ -3506,11 +3509,12 @@ def load(operator, context, filepath="",
|
|||||||
node = fbx_helper_nodes[o_uuid]
|
node = fbx_helper_nodes[o_uuid]
|
||||||
if node:
|
if node:
|
||||||
objects.append(node)
|
objects.append(node)
|
||||||
shapes_list = []
|
shapes = {}
|
||||||
mesh_to_shapes[bl_mdata] = (objects, shapes_list)
|
mesh_to_shapes[bl_mdata] = (objects, shapes)
|
||||||
else:
|
else:
|
||||||
shapes_list = mesh_to_shapes[bl_mdata][1]
|
shapes = mesh_to_shapes[bl_mdata][1]
|
||||||
shapes_list.append((bc_uuid, fbx_sdata, fbx_bcdata))
|
# Dict to avoid duplicates
|
||||||
|
shapes[(bc_uuid, id(fbx_sdata), id(fbx_bcdata))] = (fbx_sdata, fbx_bcdata)
|
||||||
# BlendShape deformers are only here to connect BlendShapeChannels to meshes, nothing else to do.
|
# BlendShape deformers are only here to connect BlendShapeChannels to meshes, nothing else to do.
|
||||||
|
|
||||||
# Iterate through each mesh and create its shape keys
|
# Iterate through each mesh and create its shape keys
|
||||||
|
Loading…
Reference in New Issue
Block a user