test_bvh_to_fbx: read Hips travel past the importer's late take end

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-24 20:51:16 +02:00
commit 13ca0df731

View file

@ -35,10 +35,10 @@ if action is not None:
def world(name, frame):
scene.frame_set(frame)
return (arm.matrix_world @ arm.pose.bones[name].matrix).translation.copy()
out["frame_range"] = [first, last]
out["hips_by_frame"] = {f: round((world("Hips", f) - world("Hips", first)).length, 4) for f in (first, first + 1, last - 1, last, last + 1)}
out["hips_travel"] = (world("Hips", last) - world("Hips", first)).length
out["root_wander"] = max((world("Root", f) - world("Root", first)).length for f in range(first, last + 1))
# The importer starts the take a frame late, so its range ends before the last key: read two frames past it.
frames = range(first, last + 3)
out["hips_travel"] = max((world("Hips", f) - world("Hips", first)).length for f in frames)
out["root_wander"] = max((world("Root", f) - world("Root", first)).length for f in frames)
print("INSPECT " + json.dumps(out))
'''