diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-08 17:20:21 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-08 19:11:20 +0300 |
commit | d1a4ae3f395a6dbb6487c5885d2327129d9b4532 (patch) | |
tree | 7602507455f9be0963087904b379c44ec8f3c772 /source/blender/blenkernel/intern/library.c | |
parent | f3fe1f9c44b08de6d18cad27d8751585568b7e8e (diff) |
Refactor/enhance BKE_object_make_local().
Now using modern features from libquery/libremap areas.
Also, it should handle much better cases where localized ID was also indirectly used by non-refcounting users
(typical case: object used as modifier/constraint/whatever target from another linked object, previous
code would not take those into account and just localize original object instead of making a local copy.
Would result in local object used by linked one, which would be partially 'undone' on next file reload... Crappy behavior).
And it fixes some obvious errors too (nullifying all proxy pointers unconditionnaly,
some missing refcounted usages cases in extern_local_object(), etc.).
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 374afa64ca4..132dd1217b0 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -253,7 +253,7 @@ void id_fake_user_clear(ID *id) /* calls the appropriate make_local method for the block, unless test. Returns true * if the block can be made local. */ -bool id_make_local(Main *UNUSED(bmain), ID *id, bool test) +bool id_make_local(Main *bmain, ID *id, bool test) { if (id->tag & LIB_TAG_INDIRECT) return false; @@ -264,7 +264,7 @@ bool id_make_local(Main *UNUSED(bmain), ID *id, bool test) case ID_LI: return false; /* can't be linked */ case ID_OB: - if (!test) BKE_object_make_local((Object *)id); + if (!test) BKE_object_make_local(bmain, (Object *)id); return true; case ID_ME: if (!test) { |