Fix T51777: Separating objects by selected vertices in Eevee causes crash

I considered just copying the evaluated data from the LayerCollection.
However we need to run the evaluation so Depsgraph can handle overrides.

I will double-check with Sergey Sharybin.
This commit is contained in:
Dalai Felinto 2017-06-12 18:10:37 +02:00
parent 193a1df8fa
commit 47b9d0d040
Notes: blender-bot 2023-02-14 06:53:23 +01:00
Referenced by commit 6ea6c51670, Better Fix for T51777: Separating objects by selected vertices
Referenced by issue #51777, Sparating objects by selected vertices in Eevee causes crash
1 changed files with 3 additions and 0 deletions

View File

@ -2064,6 +2064,9 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, SceneLayer
obn = ID_NEW_SET(ob, BKE_object_copy(bmain, ob));
DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
/* TODO(sergey): Use proper flag for tagging here. */
DEG_id_tag_update(&scene->id, 0);
BKE_collection_object_add_from(scene, ob, obn);
basen = BKE_scene_layer_base_find(sl, obn);