[Bf-blender-cvs] [9c1a5b06410] greasepencil-object: Fix error reading materials

Antonio Vazquez noreply at git.blender.org
Thu Apr 26 12:35:42 CEST 2018


Commit: 9c1a5b06410dcb0cadce5fae3a642475aac5f177
Author: Antonio Vazquez
Date:   Tue Apr 24 15:46:44 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB9c1a5b06410dcb0cadce5fae3a642475aac5f177

Fix error reading materials

The link materials section was missing.

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

M	source/blender/blenloader/intern/readfile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d9736015f07..7688e2450cd 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6371,6 +6371,11 @@ static void lib_link_gpencil(FileData *fd, Main *main)
 			IDP_LibLinkProperty(gpd->id.properties, fd);
 			lib_link_animdata(fd, &gpd->id, gpd->adt);
 
+			/* materials */
+			for (int a = 0; a < gpd->totcol; a++) {
+				gpd->mat[a] = newlibadr_us(fd, gpd->id.lib, gpd->mat[a]);
+			}
+
 			gpd->id.tag &= ~LIB_TAG_NEED_LINK;
 		}
 	}



More information about the Bf-blender-cvs mailing list