[Bf-blender-cvs] [37c3aa8eabb] soc-2019-npr: LANPR: fix readfile pointer address.

YimingWu noreply at git.blender.org
Fri Jun 28 14:00:19 CEST 2019


Commit: 37c3aa8eabbb3ba5f5718070744c0c60b67f0f21
Author: YimingWu
Date:   Fri Jun 28 19:59:19 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB37c3aa8eabbb3ba5f5718070744c0c60b67f0f21

LANPR: fix readfile pointer address.

===================================================================

M	source/blender/blenloader/intern/readfile.c
M	source/blender/draw/engines/lanpr/lanpr_access.c
M	source/blender/makesrna/RNA_access.h

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b22286b978d..be18ee36913 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6250,6 +6250,8 @@ static void lib_link_collection_data(FileData *fd, Library *lib, Collection *col
     child->collection = newlibadr_us(fd, lib, child->collection);
   }
 
+  collection->lanpr.target = newlibadr_us(fd, lib, collection->lanpr.target);
+
   BKE_collection_parent_relations_rebuild(collection);
 }
 
@@ -10277,6 +10279,8 @@ static void expand_collection(FileData *fd, Main *mainvar, Collection *collectio
     expand_doit(fd, mainvar, child->collection);
   }
 
+  expand_doit(fd, mainvar, collection->lanpr.target);
+
 #ifdef USE_COLLECTION_COMPAT_28
   if (collection->collection != NULL) {
     expand_scene_collection(fd, mainvar, collection->collection);
diff --git a/source/blender/draw/engines/lanpr/lanpr_access.c b/source/blender/draw/engines/lanpr/lanpr_access.c
index bc82ae7d40d..59e60fec076 100644
--- a/source/blender/draw/engines/lanpr/lanpr_access.c
+++ b/source/blender/draw/engines/lanpr/lanpr_access.c
@@ -91,7 +91,7 @@ void lanpr_generate_gpencil_from_chain(Depsgraph *depsgraph,
     if (ob && &ob->id != rlc->object_ref->id.orig_id) {
       continue;
     }
-    if (col) {
+    if (col && rlc->object_ref) {
       if (!BKE_collection_has_object_recursive(col, (Object *)rlc->object_ref->id.orig_id)) {
         continue;
       }
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index c8285782652..f893aca1a20 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -109,6 +109,7 @@ extern StructRNA RNA_CloudsTexture;
 extern StructRNA RNA_Collection;
 extern StructRNA RNA_CollectionEngineSettings;
 extern StructRNA RNA_CollectionProperty;
+extern StructRNA RNA_CollectionLANPR;
 extern StructRNA RNA_CollisionModifier;
 extern StructRNA RNA_CollisionSensor;
 extern StructRNA RNA_CollisionSettings;
@@ -452,6 +453,7 @@ extern StructRNA RNA_NormalEditModifier;
 extern StructRNA RNA_Object;
 extern StructRNA RNA_ObjectBase;
 extern StructRNA RNA_ObjectDisplay;
+extern StructRNA RNA_ObjectLANPR;
 extern StructRNA RNA_ObstacleFluidSettings;
 extern StructRNA RNA_OceanModifier;
 extern StructRNA RNA_OceanTexData;



More information about the Bf-blender-cvs mailing list