From f87603662d03bf908094ed7a7f002a07bf13be38 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 14 Jul 2016 13:03:22 +0200 Subject: Add option to id_make_local to force localization of datablock, even if not used locally. Will be used by link/append code. --- source/blender/blenkernel/intern/node.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/node.c') diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 296a00388c4..1058b22f96e 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1951,11 +1951,11 @@ bNodeTree *ntreeFromID(ID *id) } } -void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, bool id_in_mainlist) +void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, bool id_in_mainlist, const bool force_local) { bool is_lib = false, is_local = false; - /* - only lib users: do nothing + /* - only lib users: do nothing (unless force_local is set) * - only local users: set flag * - mixed: make copy */ @@ -1966,7 +1966,7 @@ void ntreeMakeLocal(Main *bmain, bNodeTree *ntree, bool id_in_mainlist) BKE_library_ID_test_usages(bmain, ntree, &is_local, &is_lib); - if (is_local) { + if (force_local || is_local) { if (!is_lib) { id_clear_lib_data_ex(bmain, (ID *)ntree, id_in_mainlist); BKE_id_expand_local(&ntree->id); -- cgit v1.2.3