[Bf-blender-cvs] [62fdf03] missing-libs: Change ID placeholder generator to not need an ID as reference (we only need type, name and flag here).

Bastien Montagne noreply at git.blender.org
Mon Sep 21 21:09:05 CEST 2015


Commit: 62fdf030c69bcc14ecf10ac857d096a706783e4c
Author: Bastien Montagne
Date:   Mon Sep 21 21:08:25 2015 +0200
Branches: missing-libs
https://developer.blender.org/rB62fdf030c69bcc14ecf10ac857d096a706783e4c

Change ID placeholder generator to not need an ID as reference (we only need type, name and flag here).

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2470adb..7325867 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9563,17 +9563,16 @@ static void give_base_to_groups(
 	}
 }
 
-static ID *create_placeholder(Main *mainvar, ID *id_ref)
+static ID *create_placeholder(Main *mainvar, const short idcode, const char *name, const short flag)
 {
-	const int idcode = GS(id_ref->name);
 	ListBase *lb = which_libbase(mainvar, idcode);
 	ID *ph_id = BKE_libblock_alloc_notest(idcode);
 
-	memcpy(ph_id->name, id_ref->name, sizeof(ph_id->name));
+	memcpy(ph_id->name, name, sizeof(ph_id->name));
 	BKE_libblock_init_empty(ph_id);
 	ph_id->lib = mainvar->curlib;
-	ph_id->flag = id_ref->flag | LIB_MISSING;
-	ph_id->us = (ph_id->flag & LIB_FAKEUSER) ? 1 : 0;
+	ph_id->flag = flag | LIB_MISSING;
+	ph_id->us = (flag & LIB_FAKEUSER) ? 1 : 0;
 	ph_id->icon_id = 0;
 
 	BLI_addtail(lb, ph_id);
@@ -9724,7 +9723,7 @@ static void link_id_part(ReportList *reports, FileData *fd, Main *mainvar, ID *i
 
 		/* Generate a placeholder for this ID (limited version of read_libblock actually...). */
 		if (r_id) {
-			*r_id = create_placeholder(mainvar, id);
+			*r_id = create_placeholder(mainvar, GS(id->name), id->name, id->flag);
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list