Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-09 18:04:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-09 19:53:02 +0300
commitcbbf991f62b7f1546771a71b3b9f14a46d1b6b61 (patch)
treec528c8c46adfc9172ff37a07990225b7dc15a31e
parent1ed31bef1a4e4512b2adfe282ccebf4c607bac3f (diff)
Cycles: Add name field to scene
Doesn't mean much for Cycles itself, but allows to have nice logs and progress reports without access of original scene.
-rw-r--r--intern/cycles/blender/blender_session.cpp11
-rw-r--r--intern/cycles/render/scene.cpp5
-rw-r--r--intern/cycles/render/scene.h3
3 files changed, 13 insertions, 6 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index 39f297d6be5..28b0f4faf63 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -140,6 +140,7 @@ void BlenderSession::create_session()
/* create scene */
scene = new Scene(scene_params, session->device);
+ scene->name = b_scene.name();
/* setup callbacks for builtin image support */
scene->image_manager->builtin_image_info_cb = function_bind(&BlenderSession::builtin_image_info, this, _1, _2, _3);
@@ -950,7 +951,7 @@ void BlenderSession::update_bake_progress()
void BlenderSession::update_status_progress()
{
string timestatus, status, substatus;
- string scene = "";
+ string scene_status = "";
float progress;
double total_time, remaining_time = 0, render_time;
char time_str[128];
@@ -964,12 +965,12 @@ void BlenderSession::update_status_progress()
remaining_time = (1.0 - (double)progress) * (render_time / (double)progress);
if(background) {
- scene += " | " + b_scene.name();
+ scene_status += " | " + scene->name;
if(b_rlay_name != "")
- scene += ", " + b_rlay_name;
+ scene_status += ", " + b_rlay_name;
if(b_rview_name != "")
- scene += ", " + b_rview_name;
+ scene_status += ", " + b_rview_name;
if(remaining_time > 0) {
BLI_timecode_string_from_time_simple(time_str, sizeof(time_str), remaining_time);
@@ -988,7 +989,7 @@ void BlenderSession::update_status_progress()
/* When rendering in a window, redraw the status at least once per second to keep the elapsed and remaining time up-to-date.
* For headless rendering, only report when something significant changes to keep the console output readable. */
if(status != last_status || (!headless && (current_time - last_status_time) > 1.0)) {
- b_engine.update_stats("", (timestatus + scene + status).c_str());
+ b_engine.update_stats("", (timestatus + scene_status + status).c_str());
b_engine.update_memory_stats(mem_used, mem_peak);
last_status = status;
last_status_time = current_time;
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp
index ccaca8707c8..2241d8d9c69 100644
--- a/intern/cycles/render/scene.cpp
+++ b/intern/cycles/render/scene.cpp
@@ -83,7 +83,10 @@ DeviceScene::DeviceScene(Device *device)
}
Scene::Scene(const SceneParams& params_, Device *device)
-: device(device), dscene(device), params(params_)
+ : name("Scene"),
+ device(device),
+ dscene(device),
+ params(params_)
{
memset((void *)&dscene.data, 0, sizeof(dscene.data));
diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h
index 57ea1d471e8..69cbfe9a324 100644
--- a/intern/cycles/render/scene.h
+++ b/intern/cycles/render/scene.h
@@ -196,6 +196,9 @@ public:
class Scene {
public:
+ /* Optional name. Is used for logging and reporting. */
+ string name;
+
/* data */
Camera *camera;
Camera *dicing_camera;