Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_session.cpp
| Show First 20 Lines • Show All 580 Lines • ▼ Show 20 Lines | if (!b_render.use_persistent_data()) { | ||||
| delete sync; | delete sync; | ||||
| sync = nullptr; | sync = nullptr; | ||||
| session->device_free(); | session->device_free(); | ||||
| } | } | ||||
| for (string_view filename : full_buffer_files_) { | for (string_view filename : full_buffer_files_) { | ||||
| session->process_full_buffer_from_disk(filename); | session->process_full_buffer_from_disk(filename); | ||||
| if (have_session_report_and_report()) { | |||||
| break; | |||||
| } | |||||
| } | |||||
| for (string_view filename : full_buffer_files_) { | |||||
| path_remove(filename); | path_remove(filename); | ||||
| } | } | ||||
| /* clear callback */ | /* clear callback */ | ||||
| session->write_render_tile_cb = function_null; | session->write_render_tile_cb = function_null; | ||||
| session->update_render_tile_cb = function_null; | session->update_render_tile_cb = function_null; | ||||
| session->full_buffer_written_cb = function_null; | session->full_buffer_written_cb = function_null; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 430 Lines • ▼ Show 20 Lines | if (status != last_status || (!headless && (current_time - last_status_time) > 1.0)) { | ||||
| last_status = status; | last_status = status; | ||||
| last_status_time = current_time; | last_status_time = current_time; | ||||
| } | } | ||||
| if (progress != last_progress) { | if (progress != last_progress) { | ||||
| b_engine.update_progress(progress); | b_engine.update_progress(progress); | ||||
| last_progress = progress; | last_progress = progress; | ||||
| } | } | ||||
| if (session->progress.get_error()) { | have_session_report_and_report(); | ||||
| string error = session->progress.get_error_message(); | } | ||||
| bool BlenderSession::have_session_report_and_report() | |||||
| { | |||||
| if (!session->progress.get_error()) { | |||||
| return false; | |||||
| } | |||||
| const string error = session->progress.get_error_message(); | |||||
| if (error != last_error) { | if (error != last_error) { | ||||
| /* TODO(sergey): Currently C++ RNA API doesn't let us to | /* TODO(sergey): Currently C++ RNA API doesn't let us to use mnemonic name for the variable. | ||||
| * use mnemonic name for the variable. Would be nice to | * Would be nice to have this figured out. | ||||
| * have this figured out. | |||||
| * | * | ||||
| * For until then, 1 << 5 means RPT_ERROR. | * For until then, 1 << 5 means RPT_ERROR. */ | ||||
| */ | |||||
| b_engine.report(1 << 5, error.c_str()); | b_engine.report(1 << 5, error.c_str()); | ||||
| b_engine.error_set(error.c_str()); | b_engine.error_set(error.c_str()); | ||||
| last_error = error; | last_error = error; | ||||
| } | } | ||||
| } | |||||
| return true; | |||||
| } | } | ||||
| void BlenderSession::tag_update() | void BlenderSession::tag_update() | ||||
| { | { | ||||
| /* tell blender that we want to get another update callback */ | /* tell blender that we want to get another update callback */ | ||||
| b_engine.tag_update(); | b_engine.tag_update(); | ||||
| } | } | ||||
| Show All 40 Lines | |||||