Fix T77109: Cycles viewport render crash after object add and undo

This commit is contained in:
Brecht Van Lommel 2020-05-27 18:00:59 +02:00
parent 735119dd0f
commit 79e529c5ec
Notes: blender-bot 2023-02-13 23:39:48 +01:00
Referenced by issue #77208, Tablet - Huion : pen pressure working for texture paint but not working for scult mode
Referenced by issue #77109, Blender 2.83 Crash on Undo
3 changed files with 14 additions and 0 deletions

View File

@ -168,9 +168,13 @@ void BlenderSession::create_session()
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_depsgraph = b_depsgraph;
this->b_scene = b_depsgraph.scene_eval();
if (sync) {
sync->reset(this->b_data, this->b_scene);
}
if (preview_osl) {
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");

View File

@ -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 */
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)

View File

@ -61,6 +61,8 @@ class BlenderSync {
Progress &progress);
~BlenderSync();
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
/* sync */
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
void sync_data(BL::RenderSettings &b_render,