FBX IO: Speed up animation import using NumPy #104856
@ -575,9 +575,24 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset, glo
|
||||
from itertools import chain
|
||||
|
||||
fbx_curves = []
|
||||
used_channels = set()
|
||||
warn_multiple_curves_per_channel = False
|
||||
for curves, fbxprop in cnodes.values():
|
||||
for (fbx_acdata, _blen_data), channel in curves.values():
|
||||
fbx_curves.append((fbxprop, channel, fbx_acdata))
|
||||
channel_id = (fbxprop, channel)
|
||||
if channel_id in used_channels:
|
||||
# The FBX animation system's default implementation only uses the first curve assigned to a channel.
|
||||
# Additional curves per channel are allowed by the FBX specification, but the handling of these curves
|
||||
# is considered the responsibility of the application that created them. Note that each curve node is
|
||||
# expected to have a unique set of channels, so these additional curves with the same channel would have
|
||||
# to belong to separate curve nodes. See the FBX SDK documentation for FbxAnimCurveNode.
|
||||
warn_multiple_curves_per_channel = True
|
||||
else:
|
||||
used_channels.add(channel_id)
|
||||
fbx_curves.append((fbxprop, channel, fbx_acdata))
|
||||
if warn_multiple_curves_per_channel:
|
||||
print("WARNING: Multiple animation curves per animated property channel were found for %s. All but the first"
|
||||
"curve for each property channel has been discarded." % action.name)
|
||||
|
||||
# Leave if no curves are attached (if a blender curve is attached to scale but without keys it defaults to 0).
|
||||
if len(fbx_curves) == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user