FBX IO: Speed up animation import using NumPy #104856
@ -559,7 +559,12 @@ def _transformation_curves_gen(item, values_arrays, channel_keys):
|
||||
# Create a setter into transform_data for each values array. e.g. a values array for 'Lcl Scaling' with channel == 2
|
||||
# would set transform_data.sca[2].
|
||||
|
||||
setters = [partial(setitem, transform_prop_to_attr[fbx_prop], channel) for fbx_prop, channel in channel_keys]
|
||||
frame_values_it = zip(*(iter(arr.data) for arr in values_arrays))
|
||||
# Create an iterator that gets one value from each array. Each iterated tuple will be all the imported
|
||||
# Lcl Translation/Lcl Rotation/Lcl Scaling values for a single frame, in that order.
|
||||
# Note that an FBX animation does not have to animate all the channels, so only the animated channels of each
|
||||
# property will be present.
|
||||
# .data, the memoryview of an np.ndarray, is faster to iterate than the ndarray itself.
|
||||
frame_values_it = zip(*(arr.data for arr in values_arrays))
|
||||
|
||||
# Pre-get/calculate these to slightly reduce the work done inside the loop.
|
||||
anim_compensation_matrix = item.anim_compensation_matrix
|
||||
|
Loading…
Reference in New Issue
Block a user
transform_data.scale[2]
I believe?In this case
.sca
is correct, theFBXTransformData
namedtuple uses rather short attribute names.