Fix T62929: Linked To Scene Object cannot be made single user.

Code was still 2.7x one here, Object's IDtemplate in properties editor
is now based on current view layer's collection of objects, not scene's
one anymore.
This commit is contained in:
Bastien Montagne 2019-03-26 14:30:45 +01:00
parent 8754ad4dc1
commit 6f7392312c
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #62929, Linked To Scene Object cannot be made single user
1 changed files with 2 additions and 3 deletions

View File

@ -501,15 +501,14 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
if (id) {
const bool do_scene_obj = (
(GS(id->name) == ID_OB) &&
(template_ui->ptr.type == &RNA_SceneObjects));
(template_ui->ptr.type == &RNA_LayerObjects));
/* make copy */
if (do_scene_obj) {
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ED_object_single_user(bmain, scene, (struct Object *)id);
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
WM_event_add_notifier(C, NC_WINDOW, NULL);
DEG_relations_tag_update(bmain);
}
else {