Depsgraph: Tag relations for update when making datablocks single user
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 12 Aug 2016 11:58:48 +0000 (13:58 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 12 Aug 2016 11:58:48 +0000 (13:58 +0200)
This is mainly required for the new dependency graph where non-object
datablocks are a part of dependency graph.

This solves issue when making mesh shared by multiple objects a single
user one.

source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_relations.c

index 241da5decc6277e5ad0d8fd75e5f35bccd562194..50dd219b53c2b9ddf65c93596a2fcd0d024ef5dc 100644 (file)
@@ -326,7 +326,9 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
                                }
                                else {
                                        if (id) {
+                                               Main *bmain = CTX_data_main(C);
                                                id_single_user(C, id, &template->ptr, template->prop);
+                                               DAG_relations_tag_update(bmain);
                                        }
                                }
                        }
index d5c7632765fd8de16b9a0e35782017dfa0b6992f..067a5ad2b4910c1bdb131ca117ba6967d3f95bda 100644 (file)
@@ -2106,6 +2106,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
        }
 
        BKE_main_id_clear_newpoins(bmain);
+       DAG_relations_tag_update(bmain);
 }
 
 /******************************* Make Local ***********************************/