Compositor: Explicitly set device in test scripts

This patch explicitly sets the compositing device in the compositor test
scripts. This is done to make the tests more robust, since a developer
might accordantly save a file with a different device.
This commit is contained in:
Omar Emara
2024-05-14 19:02:00 +03:00
parent 9512daee2d
commit 3d1c8a3ff3
2 changed files with 7 additions and 4 deletions

View File

@@ -15,6 +15,9 @@ try:
except ImportError:
inside_blender = False
SET_COMPOSITOR_DEVICE_SCRIPT = "import bpy; " \
"bpy.data.scenes[0].render.compositor_device = 'CPU'"
def get_arguments(filepath, output_filepath):
return [
@@ -24,8 +27,8 @@ def get_arguments(filepath, output_filepath):
"--debug-memory",
"--debug-exit-on-error",
filepath,
"-P",
os.path.realpath(__file__),
"-P", os.path.realpath(__file__),
"--python-expr", SET_COMPOSITOR_DEVICE_SCRIPT,
"-o", output_filepath,
"-F", "PNG",
"-f", "1"]

View File

@@ -15,7 +15,7 @@ try:
except ImportError:
inside_blender = False
ENABLE_REALTIME_COMPOSITOR_SCRIPT = "import bpy; " \
SET_COMPOSITOR_DEVICE_SCRIPT = "import bpy; " \
"bpy.data.scenes[0].render.compositor_device = 'GPU'"
@@ -28,7 +28,7 @@ def get_arguments(filepath, output_filepath):
"--debug-exit-on-error",
filepath,
"-P", os.path.realpath(__file__),
"--python-expr", ENABLE_REALTIME_COMPOSITOR_SCRIPT,
"--python-expr", SET_COMPOSITOR_DEVICE_SCRIPT,
"-o", output_filepath,
"-F", "PNG",
"-f", "1"