Fix #122096: Crash after editing multi-user mesh with two scenes
In this case there are two dependency graphs, each with a separate object containing the original mesh. Leaving edit mode modifies the original mesh by deleting the edit mesh data. The active dependency graph's object was tagged for that change, but the other dependency graph didn't know about the change because its object wasn't tagged. The solution is to tag the original mesh which will cause any dependency graph using it to properly reevaluate. Pull Request: https://projects.blender.org/blender/blender/pulls/128192
This commit is contained in:
@@ -716,6 +716,8 @@ bool editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int flag)
|
||||
obedit->mode &= ~OB_MODE_EDIT;
|
||||
/* Also happens when mesh is shared across multiple objects. #69834. */
|
||||
DEG_id_tag_update(&obedit->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
||||
/* Leaving edit mode may modify the original object data; tag that as well. */
|
||||
DEG_id_tag_update(static_cast<ID *>(obedit->data), ID_RECALC_GEOMETRY);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -738,6 +740,8 @@ bool editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int flag)
|
||||
|
||||
/* also flush ob recalc, doesn't take much overhead, but used for particles */
|
||||
DEG_id_tag_update(&obedit->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
||||
/* Leaving edit mode may modify the original object data; tag that as well. */
|
||||
DEG_id_tag_update(static_cast<ID *>(obedit->data), ID_RECALC_GEOMETRY);
|
||||
|
||||
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_MODE_OBJECT, scene);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user