diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-04 13:42:15 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-04 13:43:31 +0300 |
commit | 4bfa256ea48e51643f848e8dfdaeab615f7b1a88 (patch) | |
tree | 996d59300eeff16f1063a6be8887aaa3cfcb4299 /source/blender/makesrna/intern | |
parent | 4e597a5cff6bb4195b8fc9c8102bfbdc4958b31f (diff) |
Refactor ID make local to use a single flag parameter.
Instead of using anonymous booleans flags, also allows to keep the same
behavior in all cases, without needing special handling from calling
code for our beloved oddballs object proxies...
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index b1c20bcd8f2..bf2c162a179 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -582,13 +582,8 @@ static void rna_ID_user_remap(ID *id, Main *bmain, ID *new_id) static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool clear_proxy) { - /* Special case, as we can't rely on BKE_lib_id_make_local(); it clears proxies. */ - if (!clear_proxy && GS(self->name) == ID_OB) { - BKE_object_make_local_ex(bmain, (Object *)self, false, clear_proxy); - } - else { - BKE_lib_id_make_local(bmain, self, false, false); - } + BKE_lib_id_make_local( + bmain, self, false, clear_proxy ? 0 : LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING); ID *ret_id = self->newid ? self->newid : self; BKE_id_clear_newpoin(self); |