Fix T77109: Cycles viewport render crash after object add and undo
This commit is contained in:
@@ -168,9 +168,13 @@ void BlenderSession::create_session()
|
|||||||
|
|
||||||
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
|
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
|
||||||
{
|
{
|
||||||
|
/* Update data, scene and depsgraph pointers. These can change after undo. */
|
||||||
this->b_data = b_data;
|
this->b_data = b_data;
|
||||||
this->b_depsgraph = b_depsgraph;
|
this->b_depsgraph = b_depsgraph;
|
||||||
this->b_scene = b_depsgraph.scene_eval();
|
this->b_scene = b_depsgraph.scene_eval();
|
||||||
|
if (sync) {
|
||||||
|
sync->reset(this->b_data, this->b_scene);
|
||||||
|
}
|
||||||
|
|
||||||
if (preview_osl) {
|
if (preview_osl) {
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
|
@@ -78,6 +78,14 @@ BlenderSync::~BlenderSync()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
|
||||||
|
{
|
||||||
|
/* Update data and scene pointers in case they change in session reset,
|
||||||
|
* for example after undo. */
|
||||||
|
this->b_data = b_data;
|
||||||
|
this->b_scene = b_scene;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sync */
|
/* Sync */
|
||||||
|
|
||||||
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
||||||
|
@@ -61,6 +61,8 @@ class BlenderSync {
|
|||||||
Progress &progress);
|
Progress &progress);
|
||||||
~BlenderSync();
|
~BlenderSync();
|
||||||
|
|
||||||
|
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
|
||||||
|
|
||||||
/* sync */
|
/* sync */
|
||||||
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
||||||
void sync_data(BL::RenderSettings &b_render,
|
void sync_data(BL::RenderSettings &b_render,
|
||||||
|
Reference in New Issue
Block a user