From 2a9c8da709593b5b6187002797d9bb4363440bd5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 11 Feb 2019 18:26:47 +0100 Subject: Cycles: add animation denoising test, fix operator to work with single frames. --- tests/python/CMakeLists.txt | 1 + tests/python/cycles_render_tests.py | 73 +++++++++++++------------------------ 2 files changed, 27 insertions(+), 47 deletions(-) (limited to 'tests') diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index b5cc39ae37a..46e917226e4 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -549,6 +549,7 @@ if(WITH_CYCLES) add_cycles_render_test(bake) add_cycles_render_test(bsdf) add_cycles_render_test(denoise) + add_cycles_render_test(denoise_animation) add_cycles_render_test(displacement) add_cycles_render_test(hair) add_cycles_render_test(image_data_types) diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index a01a6f74e15..1717210663a 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -14,61 +14,40 @@ def render_file(filepath, output_filepath): basedir = os.path.dirname(dirname) subject = os.path.basename(dirname) - custom_args = os.getenv('CYCLESTEST_ARGS') - custom_args = shlex.split(custom_args) if custom_args else [] + frame_filepath = output_filepath + '0001.png' + + common_args = [ + "-noaudio", + "--factory-startup", + "--enable-autoexec", + filepath, + "-E", "CYCLES", + "-o", output_filepath, + "-F", "PNG"] # OSL and GPU examples # custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True"] # custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.device = 'GPU'"] - - frame_filepath = output_filepath + '0001.png' + custom_args = os.getenv('CYCLESTEST_ARGS') + custom_args = shlex.split(custom_args) if custom_args else [] + common_args += custom_args if subject == 'opengl': - command = [ - BLENDER, - "--window-geometry", "0", "0", "1", "1", - "-noaudio", - "--factory-startup", - "--enable-autoexec", - filepath, - "-E", "CYCLES"] - command += custom_args - command += [ - "-o", output_filepath, - "-F", "PNG", - '--python', os.path.join(basedir, - "util", - "render_opengl.py")] + command = [BLENDER, "--window-geometry", "0", "0", "1", "1"] + command += common_args + command += ['--python', os.path.join(basedir, "util", "render_opengl.py")] elif subject == 'bake': - command = [ - BLENDER, - "-b", - "-noaudio", - "--factory-startup", - "--enable-autoexec", - filepath, - "-E", "CYCLES"] - command += custom_args - command += [ - "-o", output_filepath, - "-F", "PNG", - '--python', os.path.join(basedir, - "util", - "render_bake.py")] + command = [BLENDER, "--background"] + command += common_args + command += ['--python', os.path.join(basedir, "util", "render_bake.py")] + elif subject == 'denoise_animation': + command = [BLENDER, "--background"] + command += common_args + command += ['--python', os.path.join(basedir, "util", "render_denoise.py")] else: - command = [ - BLENDER, - "--background", - "-noaudio", - "--factory-startup", - "--enable-autoexec", - filepath, - "-E", "CYCLES"] - command += custom_args - command += [ - "-o", output_filepath, - "-F", "PNG", - "-f", "1"] + command = [BLENDER, "--background"] + command += common_args + command += ["-f", "1"] try: # Success -- cgit v1.2.3