[Bf-blender-cvs] [aa4ff9e5d37] temp-lanpr-review: LANPR: Fixing CollectionLANRP file r/w.
YimingWu
noreply at git.blender.org
Wed Nov 27 15:09:59 CET 2019
Commit: aa4ff9e5d37fd5bbd3b3e1a653f0701135bb9e25
Author: YimingWu
Date: Wed Nov 27 22:09:35 2019 +0800
Branches: temp-lanpr-review
https://developer.blender.org/rBaa4ff9e5d37fd5bbd3b3e1a653f0701135bb9e25
LANPR: Fixing CollectionLANRP file r/w.
===================================================================
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/writefile.c
===================================================================
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e6675dd7f60..fbc25e80c94 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6260,6 +6260,8 @@ static void direct_link_collection(FileData *fd, Collection *collection)
direct_link_view_layer(fd, collection->view_layer);
}
#endif
+
+ collection->lanpr = newdataadr(fd, collection->lanpr);
}
static void lib_link_collection_data(FileData *fd, Library *lib, Collection *collection)
@@ -6277,7 +6279,6 @@ static void lib_link_collection_data(FileData *fd, Library *lib, Collection *col
child->collection = newlibadr_us(fd, lib, child->collection);
}
- collection->lanpr = newdataadr(fd,collection->lanpr);
if(collection->lanpr){
collection->lanpr->target = newlibadr_us(fd, lib, collection->lanpr->target);
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 84c2220958d..47c565213be 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2384,7 +2384,7 @@ static void write_collection_nolib(WriteData *wd, Collection *collection)
writestruct(wd, DATA, CollectionChild, 1, child);
}
- if(collection->flag & COLLECTION_CONFIGURED_FOR_LANPR){
+ if((collection->flag & COLLECTION_CONFIGURED_FOR_LANPR) && (collection->lanpr!=NULL)){
writestruct(wd, DATA, CollectionLANPR, 1, collection->lanpr);
}
}
More information about the Bf-blender-cvs
mailing list