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.
This commit is contained in:
Campbell Barton
2025-06-07 12:37:12 +10:00
parent bfbc9c804c
commit 3d8fc6ba9d

View File

@@ -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),