Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/app/cycles_standalone.cpp
| Show All 30 Lines | |||||
| #include "util_time.h" | #include "util_time.h" | ||||
| #include "util_transform.h" | #include "util_transform.h" | ||||
| #ifdef WITH_CYCLES_STANDALONE_GUI | #ifdef WITH_CYCLES_STANDALONE_GUI | ||||
| #include "util_view.h" | #include "util_view.h" | ||||
| #endif | #endif | ||||
| #include "cycles_xml.h" | #include "cycles_xml.h" | ||||
| #include "cycles_json.h" | |||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| struct Options { | struct Options { | ||||
| Session *session; | Session *session; | ||||
| Scene *scene; | Scene *scene; | ||||
| string filepath; | string filepath; | ||||
| int width, height; | int width, height; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | #endif | ||||
| options.scene = NULL; | options.scene = NULL; | ||||
| } | } | ||||
| static void scene_init() | static void scene_init() | ||||
| { | { | ||||
| options.scene = new Scene(options.scene_params, options.session_params.device); | options.scene = new Scene(options.scene_params, options.session_params.device); | ||||
| #if 0 | |||||
| /* Read XML */ | /* Read XML */ | ||||
| xml_read_file(options.scene, options.filepath.c_str()); | xml_read_file(options.scene, options.filepath.c_str()); | ||||
| #else | |||||
| json_read_file(options.scene, options.filepath.c_str()); | |||||
| #endif | |||||
| /* Camera width/height override? */ | /* Camera width/height override? */ | ||||
| if (!(options.width == 0 || options.height == 0)) { | if (!(options.width == 0 || options.height == 0)) { | ||||
| options.scene->camera->width = options.width; | options.scene->camera->width = options.width; | ||||
| options.scene->camera->height = options.height; | options.scene->camera->height = options.height; | ||||
| } | } | ||||
| else { | else { | ||||
| options.width = options.scene->camera->width; | options.width = options.scene->camera->width; | ||||
| ▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines | |||||