FBX IO: Speed up animation import using NumPy #104856
@ -686,10 +686,11 @@ def blen_read_invalid_animation_curve(key_times, key_values):
|
|||||||
# Unsure if this can be vectorized with numpy, so using iteration for now.
|
# Unsure if this can be vectorized with numpy, so using iteration for now.
|
||||||
def index_gen():
|
def index_gen():
|
||||||
idx = 0
|
idx = 0
|
||||||
|
key_times_data = key_times.data
|
||||||
key_times_len = len(key_times)
|
key_times_len = len(key_times)
|
||||||
# Iterating .data, the memoryview of the array, is faster than iterating the array directly.
|
# Iterating .data, the memoryview of the array, is faster than iterating the array directly.
|
||||||
for curr_fbxktime in sorted_unique_times.data:
|
for curr_fbxktime in sorted_unique_times.data:
|
||||||
if key_times[idx] < curr_fbxktime:
|
if key_times_data[idx] < curr_fbxktime:
|
||||||
if idx >= 0:
|
if idx >= 0:
|
||||||
idx += 1
|
idx += 1
|
||||||
if idx >= key_times_len:
|
if idx >= key_times_len:
|
||||||
|
Loading…
Reference in New Issue
Block a user