[Bf-blender-cvs] [9a97965] id-remap: Fix broken ID placeholder code (from recent merges).
Bastien Montagne
noreply at git.blender.org
Thu Oct 15 15:34:12 CEST 2015
Commit: 9a9796564a272c976798851ff0d6a2ee559420df
Author: Bastien Montagne
Date: Thu Oct 15 15:33:24 2015 +0200
Branches: id-remap
https://developer.blender.org/rB9a9796564a272c976798851ff0d6a2ee559420df
Fix broken ID placeholder code (from recent merges).
Here we need a bit different handling than in missing-lib branch...
===================================================================
M source/blender/blenloader/intern/readfile.c
===================================================================
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index eb03ef7..b19a1c5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9620,7 +9620,8 @@ static ID *create_placeholder(Main *mainvar, const short idcode, const char *idn
ListBase *lb = which_libbase(mainvar, idcode);
ID *ph_id = BKE_libblock_alloc_notest(idcode);
- memcpy(ph_id->name, idname, sizeof(ph_id->name));
+ *((short *)ph_id->name) = idcode;
+ BLI_strncpy(ph_id->name + 2, idname, sizeof(ph_id->name) - 2);
BKE_libblock_init_empty(ph_id);
ph_id->lib = mainvar->curlib;
ph_id->flag = flag | LIB_MISSING;
@@ -9809,7 +9810,7 @@ static void link_id_part(ReportList *reports, FileData *fd, Main *mainvar, ID *i
/* Generate a placeholder for this ID (simplified version of read_libblock actually...). */
if (r_id) {
- *r_id = create_placeholder(mainvar, GS(id->name), id->name, id->flag);
+ *r_id = create_placeholder(mainvar, GS(id->name), id->name + 2, id->flag);
}
}
}
More information about the Bf-blender-cvs
mailing list