From 3d8fc6ba9d13f9e24d10af928e9754dea10e690c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 7 Jun 2025 12:37:12 +1000 Subject: [PATCH] PlayAnim: use the same GPU backend as Blender Since the animation player doesn't read the user preferences, pass the GPU backend as an argument. --- .../startup/bl_operators/screen_play_rendered_anim.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/startup/bl_operators/screen_play_rendered_anim.py b/scripts/startup/bl_operators/screen_play_rendered_anim.py index 228e077635a..3f324ab5b80 100644 --- a/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -140,6 +140,15 @@ class PlayRenderedAnim(Operator): frame_start = scene.frame_start frame_end = scene.frame_end if preset == 'INTERNAL': + # Use the current GPU backend for the player. + import gpu + gpu_backend = gpu.platform.backend_type_get() + if gpu_backend not in {'NONE', 'UNKNOWN'}: + cmd.extend([ + "--gpu-backend", gpu_backend.lower(), + ]) + del gpu, gpu_backend + opts = [ "-a", "-f", str(rd.fps), str(rd.fps_base),