Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-11-30 17:25:54 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-11-30 17:27:59 +0300
commitdf63195d2a7bc374398b0b6dfa389db3b40f5a70 (patch)
tree46ebb08ce49ff609125f696467c4696abcae46b9 /source/blender/blenkernel/intern/object.c
parent2f6f75613fc0845604b205a85203134cca3b1034 (diff)
Cleanup id->newid usage, initial work.
This aims at always ensuring that ID.newid (and relevant LIB_TAG_NEW) stay in clean (i.e. cleared) state by default. To achieve this, instead of clearing after all id copy call (would be horribly noisy, and bad for performances), we try to completely remove the setting of id->newid by default when copying a new ID. This implies that areas actually needing that info (mainly, object editing area (make single user...) and make local area) have to ensure they set it themselves as needed. This is far from simple change, many complex code paths to consider, so will need some serious testing. :/
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 4489ca907f6..c6666ec5ced 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1215,6 +1215,9 @@ void BKE_object_make_local_ex(Main *bmain, Object *ob, const bool lib_local, con
ob_new->id.us = 0;
ob_new->proxy = ob_new->proxy_from = ob_new->proxy_group = NULL;
+ /* setting newid is mandatory for complex make_lib_local logic... */
+ ID_NEW_SET(ob, ob_new);
+
if (!lib_local) {
BKE_libblock_remap(bmain, ob, ob_new, ID_REMAP_SKIP_INDIRECT_USAGE);
}