FBX IO: Speed up animation export using NumPy #104884

Merged
Thomas Barlow merged 12 commits from Mysteryem/blender-addons:fbx_anim_export_numpy_intermediate into main 2023-09-19 01:13:25 +02:00
Showing only changes of commit 892a192b6b - Show all commits

View File

@ -2919,8 +2919,8 @@ def fbx_data_from_scene(scene, depsgraph, settings):
for _alayer_key, alayer in astack.values(): for _alayer_key, alayer in astack.values():
for _acnode_key, acnode, _acnode_name in alayer.values(): for _acnode_key, acnode, _acnode_name in alayer.values():
nbr_acnodes += 1 nbr_acnodes += 1
for _acurve_key, _dval, (acurve_keys, acurve_values), acurve_valid in acnode.values(): for _acurve_key, _dval, (keys, _values), acurve_valid in acnode.values():
if len(acurve_keys): if len(keys):
nbr_acurves += 1 nbr_acurves += 1
templates[b"AnimationStack"] = fbx_template_def_animstack(scene, settings, nbr_users=nbr_astacks) templates[b"AnimationStack"] = fbx_template_def_animstack(scene, settings, nbr_users=nbr_astacks)
@ -3054,8 +3054,8 @@ def fbx_data_from_scene(scene, depsgraph, settings):
connections.append((b"OO", acurvenode_id, alayer_id, None)) connections.append((b"OO", acurvenode_id, alayer_id, None))
# Animcurvenode -> object property. # Animcurvenode -> object property.
connections.append((b"OP", acurvenode_id, elem_id, fbx_prop.encode())) connections.append((b"OP", acurvenode_id, elem_id, fbx_prop.encode()))
for fbx_item, (acurve_key, default_value, (acurve_keys, acurve_values), acurve_valid) in acurves.items(): for fbx_item, (acurve_key, default_value, (keys, values), acurve_valid) in acurves.items():
if len(acurve_keys): if len(keys):
# Animcurve -> Animcurvenode. # Animcurve -> Animcurvenode.
connections.append((b"OP", get_fbx_uuid_from_key(acurve_key), acurvenode_id, fbx_item.encode())) connections.append((b"OP", get_fbx_uuid_from_key(acurve_key), acurvenode_id, fbx_item.encode()))