diff options
-rw-r--r-- | tests/performance/tests/animation.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/performance/tests/animation.py b/tests/performance/tests/animation.py index 1a92f1a9718..c1a5c77860f 100644 --- a/tests/performance/tests/animation.py +++ b/tests/performance/tests/animation.py @@ -9,14 +9,20 @@ def _run(args): import time start_time = time.time() + elapsed_time = 0.0 + num_frames = 0 - scene = bpy.context.scene - for i in range(scene.frame_start, scene.frame_end): - scene.frame_set(scene.frame_start) + while elapsed_time < 10.0: + scene = bpy.context.scene + for i in range(scene.frame_start, scene.frame_end + 1): + scene.frame_set(i) - elapsed_time = time.time() - start_time + num_frames += scene.frame_end + 1 - scene.frame_start + elapsed_time = time.time() - start_time - result = {'time': elapsed_time} + time_per_frame = elapsed_time / num_frames + + result = {'time': time_per_frame} return result @@ -32,10 +38,10 @@ class AnimationTest(api.Test): def run(self, env, device_id): args = {} - result, _ = env.run_in_blender(_run, args) + result, _ = env.run_in_blender(_run, args, [self.filepath]) return result def generate(env): - filepaths = env.find_blend_files('animation') + filepaths = env.find_blend_files('animation/*') return [AnimationTest(filepath) for filepath in filepaths] |