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>2018-04-04 12:56:35 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-04-04 12:59:16 +0300
commit677d699645be41acb96f256a1e2088aa21e5e72b (patch)
tree474712f197cf06b20867705cf4e6d32fbbddf150 /source/blender/blenloader
parentc1287389269cd4b70711d2b55bfeb3b87d695c9a (diff)
Tweak ID->tag reset on file load (no visible change expected!).
Issue was, *some* IDs (like infamous nodetrees from materials etc.) would not go through the 'main' read_libblock() func, so their tags were never reset. So now, we ensure direct_link_id() always clear the tags, and move setting them in read_libblock() after the call to direct_link_id(). Needed for depsgraph, but general healthier fix actually.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c35e49b801f..2b053b3fb45 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2235,6 +2235,10 @@ static void direct_link_id(FileData *fd, ID *id)
IDP_DirectLinkGroup_OrFree(&id->properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
}
id->py_instance = NULL;
+
+ /* That way datablock reading not going through main read_libblock() function are still in a clear tag state.
+ * (glowering at certain nodetree fake datablock here...). */
+ id->tag = 0;
}
/* ************ READ CurveMapping *************** */
@@ -8238,7 +8242,6 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short
if (!id)
return blo_nextbhead(fd, bhead);
- id->tag = tag | LIB_TAG_NEED_LINK;
id->lib = main->curlib;
id->us = ID_FAKE_USERS(id);
id->icon_id = 0;
@@ -8247,12 +8250,12 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short
/* this case cannot be direct_linked: it's just the ID part */
if (bhead->code == ID_ID) {
+ /* That way, we know which datablock needs do_versions (required currently for linking). */
+ id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW;
+
return blo_nextbhead(fd, bhead);
}
- /* That way, we know which datablock needs do_versions (required currently for linking). */
- id->tag |= LIB_TAG_NEW;
-
/* need a name for the mallocN, just for debugging and sane prints on leaks */
allocname = dataname(GS(id->name));
@@ -8261,7 +8264,11 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const short
/* init pointers direct data */
direct_link_id(fd, id);
-
+
+ /* That way, we know which datablock needs do_versions (required currently for linking). */
+ /* Note: doing this after driect_link_id(), which resets that field. */
+ id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW;
+
switch (GS(id->name)) {
case ID_WM:
direct_link_windowmanager(fd, (wmWindowManager *)id);