[Bf-blender-cvs] [e5bcd95c29] temp-cycles-denoising: Cycles Denoising: Revert all changes to Cycles Standalone
Lukas Stockner
noreply at git.blender.org
Fri Feb 10 18:11:10 CET 2017
Commit: e5bcd95c29179e162ff7422ace6c2751b2ce3ff3
Author: Lukas Stockner
Date: Fri Feb 10 03:50:06 2017 +0100
Branches: temp-cycles-denoising
https://developer.blender.org/rBe5bcd95c29179e162ff7422ace6c2751b2ce3ff3
Cycles Denoising: Revert all changes to Cycles Standalone
===================================================================
M intern/cycles/app/CMakeLists.txt
D intern/cycles/app/cycles_denoising.cpp
D intern/cycles/app/cycles_denoising.h
M intern/cycles/app/cycles_standalone.cpp
D intern/cycles/app/cycles_standalone.h
===================================================================
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index 9b78e168d4..88b46038eb 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -108,11 +108,8 @@ endmacro()
if(WITH_CYCLES_STANDALONE)
set(SRC
cycles_standalone.cpp
- cycles_standalone.h
cycles_xml.cpp
cycles_xml.h
- cycles_denoising.cpp
- cycles_denoising.h
)
add_executable(cycles ${SRC})
cycles_target_link_libraries(cycles)
diff --git a/intern/cycles/app/cycles_denoising.cpp b/intern/cycles/app/cycles_denoising.cpp
deleted file mode 100644
index a5c0130e8c..0000000000
--- a/intern/cycles/app/cycles_denoising.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2016 Blender Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "cycles_denoising.h"
-
-#include "denoising.h"
-
-#include "util_image.h"
-
-CCL_NAMESPACE_BEGIN
-
-bool cycles_denoising_session()
-{
- vector<string> frames;
- if(options.frame_range.y >= options.frame_range.x) {
- string pattern = options.filepaths[0];
- size_t pos = pattern.find("%");
- if(options.filepaths.size() != 1 || pos == string::npos || pattern.size() <= pos+3 ||!isdigit(pattern[pos+1]) || pattern[pos+2] != 'd') {
- printf("ERROR: When using the frame range option, specify the image file as a single filename including %%Xd, there X is the length of the frame numbers.");
- delete options.session;
- return false;
- }
-
- char pad_length = pattern[pos+1];
- vector<string> new_filepaths;
- for(int frame = options.frame_range.x; frame <= options.frame_range.y; frame++) {
- string name = pattern.substr(0, pos);
- name += string_printf(string_printf("%%0%cd", pad_length).c_str(), frame);
- name += pattern.substr(pos+3);
- frames.push_back(name);
- }
- }
-
- return denoise_standalone(options.session_params, frames, options.denoise_frame);
-}
-
-CCL_NAMESPACE_END
\ No newline at end of file
diff --git a/intern/cycles/app/cycles_denoising.h b/intern/cycles/app/cycles_denoising.h
deleted file mode 100644
index ef18e17555..0000000000
--- a/intern/cycles/app/cycles_denoising.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2016 Blender Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- #include "cycles_standalone.h"
-
-#ifndef __CYCLES_DENOISING_H__
-#define __CYCLES_DENOISING_H__
-
-CCL_NAMESPACE_BEGIN
-
-bool cycles_denoising_session();
-
-CCL_NAMESPACE_END
-
-#endif /* __CYCLES_DENOISING_H__ */
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp
index 0987d4b625..9816d614a7 100644
--- a/intern/cycles/app/cycles_standalone.cpp
+++ b/intern/cycles/app/cycles_standalone.cpp
@@ -38,13 +38,20 @@
#include "util_view.h"
#endif
-#include "cycles_standalone.h"
#include "cycles_xml.h"
-#include "cycles_denoising.h"
CCL_NAMESPACE_BEGIN
-Options options;
+struct Options {
+ Session *session;
+ Scene *scene;
+ string filepath;
+ int width, height;
+ SceneParams scene_params;
+ SessionParams session_params;
+ bool quiet;
+ bool show_help, interactive, pause;
+} options;
static void session_print(const string& str)
{
@@ -63,7 +70,7 @@ static void session_print(const string& str)
fflush(stdout);
}
-void session_print_status()
+static void session_print_status()
{
string status, substatus;
@@ -113,7 +120,7 @@ static void scene_init()
options.scene = new Scene(options.scene_params, options.session_params.device);
/* Read XML */
- xml_read_file(options.scene, options.filepaths[0].c_str());
+ xml_read_file(options.scene, options.filepath.c_str());
/* Camera width/height override? */
if(!(options.width == 0 || options.height == 0)) {
@@ -311,7 +318,7 @@ static void keyboard(unsigned char key)
static int files_parse(int argc, const char *argv[])
{
if(argc > 0)
- options.filepaths.push_back(string(argv[0]));
+ options.filepath = argv[0];
return 0;
}
@@ -320,11 +327,9 @@ static void options_parse(int argc, const char **argv)
{
options.width = 0;
options.height = 0;
- options.filepaths.clear();
+ options.filepath = "";
options.session = NULL;
options.quiet = false;
- options.frame_range.x = -1;
- options.frame_range.y = -2;
/* device names */
string device_names = "";
@@ -350,7 +355,7 @@ static void options_parse(int argc, const char **argv)
/* parse options */
ArgParse ap;
- bool help = false, debug = false, version = false, denoise = false;
+ bool help = false, debug = false, version = false;
int verbosity = 1;
ap.options ("Usage: cycles [options] file.xml",
@@ -361,13 +366,8 @@ static void options_parse(int argc, const char **argv)
#endif
"--background", &options.session_params.background, "Render in background, without user interface",
"--quiet", &options.quiet, "In background mode, don't print progress messages",
- "--denoise", &denoise, "Denoise the given input file instead of rendering it",
- "--half-window %d", &options.session_params.half_window, "Size of the denoising window",
- "--denoise-frame %d", &options.denoise_frame, "Which frame to denoise (together with --frame-range)",
- "--frame-range %d %d", &options.frame_range.x, &options.frame_range.y, "Frame Range that's used for denoising",
"--samples %d", &options.session_params.samples, "Number of samples to render",
"--output %s", &options.session_params.output_path, "File path to write output image",
- "--output-half", &options.session_params.output_half_float, "Write output image in half float format",
"--threads %d", &options.session_params.threads, "CPU Rendering Threads",
"--width %d", &options.width, "Window width in pixel",
"--height %d", &options.height, "Window height in pixel",
@@ -410,7 +410,7 @@ static void options_parse(int argc, const char **argv)
printf("%s\n", CYCLES_VERSION_STRING);
exit(EXIT_SUCCESS);
}
- else if(help || options.filepaths.size() == 0) {
+ else if(help || options.filepath == "") {
ap.usage();
exit(EXIT_SUCCESS);
}
@@ -447,11 +447,11 @@ static void options_parse(int argc, const char **argv)
exit(EXIT_FAILURE);
}
#ifdef WITH_OSL
- else if(!denoise && !(ssname == "osl" || ssname == "svm")) {
+ else if(!(ssname == "osl" || ssname == "svm")) {
fprintf(stderr, "Unknown shading system: %s\n", ssname.c_str());
exit(EXIT_FAILURE);
}
- else if(!denoise && (options.scene_params.shadingsystem == SHADINGSYSTEM_OSL && options.session_params.device.type != DEVICE_CPU)) {
+ else if(options.scene_params.shadingsystem == SHADINGSYSTEM_OSL && options.session_params.device.type != DEVICE_CPU) {
fprintf(stderr, "OSL shading system only works with CPU device\n");
exit(EXIT_FAILURE);
}
@@ -460,7 +460,7 @@ static void options_parse(int argc, const char **argv)
fprintf(stderr, "Invalid number of samples: %d\n", options.session_params.samples);
exit(EXIT_FAILURE);
}
- else if(options.filepaths.size() == 0) {
+ else if(options.filepath == "") {
fprintf(stderr, "No file path specified\n");
exit(EXIT_FAILURE);
}
@@ -468,11 +468,6 @@ static void options_parse(int argc, const char **argv)
/* For smoother Viewport */
options.session_params.start_resolution = 64;
- if(denoise) {
- bool success = cycles_denoising_session();
- exit(success? EXIT_SUCCESS: EXIT_FAILURE);
- }
-
/* load scene */
scene_init();
}
@@ -496,7 +491,7 @@ int main(int argc, const char **argv)
#ifdef WITH_CYCLES_STANDALONE_GUI
}
else {
- string title = "Cycles: " + path_filename(options.filepaths[0]);
+ string title = "Cycles: " + path_filename(options.filepath);
/* init/exit are callback so they run while GL is initialized */
view_main_loop(title.c_str(), options.width, options.height,
diff --git a/intern/cycles/app/cycles_standalone.h b/intern/cycles/app/cycles_standalone.h
deleted file mode 100644
index 27f9432189..0000000000
--- a/intern/cycles/app/cycles_standalone.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011-2016 Blender Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CYCLES_STANDALONE_H__
-#define __CYCLES_STANDALONE_H__
-
-#include "scene.h"
-#include "session.h"
-
-#include "util_vector.h"
-
-CCL_NAMESPACE_BEGIN
-
-struct Options {
- Session *session;
- Scene *scene;
- vector<string> filepaths;
- int width, height;
- SceneParams scene_params;
- SessionParams session_params;
- bool quiet;
- bool show_help, interactive, pause;
- int2 frame_range;
- int denoise_frame;
-};
-
-extern Options options;
-void session_print_status();
-
-CCL_NAMESPACE_END
-
-#endif /* __CYCLES_STANDALONE_H__ */
More information about the Bf-blender-cvs
mailing list