[Bf-blender-cvs] [59ff3b5] missing-libs: Merge branch 'master' into missing-libs

Bastien Montagne noreply at git.blender.org
Thu Oct 15 16:21:33 CEST 2015


Commit: 59ff3b549868bfbb339c5ce9e4954d5bb307bb3d
Author: Bastien Montagne
Date:   Thu Oct 15 16:12:57 2015 +0200
Branches: missing-libs
https://developer.blender.org/rB59ff3b549868bfbb339c5ce9e4954d5bb307bb3d

Merge branch 'master' into missing-libs

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



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

diff --cc source/blender/blenloader/intern/readfile.c
index 4c8bdbd,2e79696..b3b0ee4
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9615,30 -9615,11 +9615,30 @@@ static void give_base_to_groups
  	}
  }
  
 +static ID *create_placeholder(Main *mainvar, const char *idname, const short flag)
 +{
 +	const short idcode = GS(idname);
 +	ListBase *lb = which_libbase(mainvar, idcode);
 +	ID *ph_id = BKE_libblock_alloc_notest(idcode);
 +
 +	memcpy(ph_id->name, idname, sizeof(ph_id->name));
 +	BKE_libblock_init_empty(ph_id);
 +	ph_id->lib = mainvar->curlib;
 +	ph_id->flag = flag | LIB_MISSING;
 +	ph_id->us = (flag & LIB_FAKEUSER) ? 1 : 0;
 +	ph_id->icon_id = 0;
 +
 +	BLI_addtail(lb, ph_id);
 +	id_sort_by_name(lb, ph_id);
 +
 +	return ph_id;
 +}
 +
  /* returns true if the item was found
   * but it may already have already been appended/linked */
- static ID *link_named_part(Main *mainl, FileData *fd, const char *idname, const short idcode)
+ static ID *link_named_part(Main *mainl, FileData *fd, const short idcode, const char *name)
  {
- 	BHead *bhead = find_bhead_from_code_name(fd, idcode, idname);
+ 	BHead *bhead = find_bhead_from_code_name(fd, idcode, name);
  	ID *id;
  
  	if (bhead) {
@@@ -9773,20 -9755,15 +9774,20 @@@ ID *BLO_library_link_named_part_ex
          Scene *scene, View3D *v3d)
  {
  	FileData *fd = (FileData*)(*bh);
- 	return link_named_part_ex(mainl, fd, idname, idcode, flag, scene, v3d);
+ 	return link_named_part_ex(mainl, fd, idcode, name, flag, scene, v3d);
  }
  
 -static void link_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id)
 +static void link_id_part(ReportList *reports, FileData *fd, Main *mainvar, ID *id, ID **r_id)
  {
 -	BHead *bhead = find_bhead_from_idname(fd, id->name);
 +	BHead *bhead = NULL;
 +
 +	if (fd) {
 +		bhead = find_bhead_from_idname(fd, id->name);
 +	}
 +
 +	id->flag &= ~LIB_READ;
  
  	if (bhead) {
 -		id->flag &= ~LIB_READ;
  		id->flag |= LIB_NEED_EXPAND;
  		// printf("read lib block %s\n", id->name);
  		read_libblock(fd, mainvar, bhead, id->flag, r_id);




More information about the Bf-blender-cvs mailing list