[Bf-blender-cvs] [6da735e] id-remap: Merge branch 'missing-libs' into id-remap

Bastien Montagne noreply at git.blender.org
Thu Oct 15 17:04:36 CEST 2015


Commit: 6da735e81c19e57af5cbd1aa304349f4d1023615
Author: Bastien Montagne
Date:   Thu Oct 15 16:55:43 2015 +0200
Branches: id-remap
https://developer.blender.org/rB6da735e81c19e57af5cbd1aa304349f4d1023615

Merge branch 'missing-libs' into id-remap

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



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

diff --cc source/blender/blenkernel/intern/image.c
index 12b3bbf,875347b..4808443
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@@ -346,11 -345,8 +341,11 @@@ void BKE_image_free(Image *ima
  		}
  	}
  
- 	image_free_views(ima);
+ 	BKE_image_free_views(ima);
 -	MEM_freeN(ima->stereo3d_format);
 +	MEM_SAFE_FREE(ima->stereo3d_format);
 +
 +	BKE_icon_id_delete(&ima->id);
 +	BKE_previewimg_free(&ima->preview);
  }
  
  /* only image block itself */
diff --cc source/blender/blenloader/BLO_readfile.h
index c38a691,51b016a..0d13302
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@@ -96,12 -96,11 +96,12 @@@ bool BLO_has_bfile_extension(const cha
  bool BLO_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name);
  
  struct Main *BLO_library_link_begin(struct Main *mainvar, BlendHandle **bh, const char *filepath);
- struct ID *BLO_library_link_named_part(struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode);
+ struct ID *BLO_library_link_named_part(struct Main *mainl, BlendHandle **bh, const short idcode, const char *name);
  struct ID *BLO_library_link_named_part_ex(
          struct Main *mainl, BlendHandle **bh,
-         const char *idname, const int idcode, const short flag,
 -        const short idcode, const char *name, const short flag,
 -        struct Scene *scene, struct View3D *v3d);
++        const int idcode, const char *name, const short flag,
 +        struct Scene *scene, struct View3D *v3d,
 +        const bool use_placeholders, const bool force_indirect);
  void BLO_library_link_end(struct Main *mainl, BlendHandle **bh, short flag, struct Scene *scene, struct View3D *v3d);
  
  void BLO_library_link_all(struct Main *mainl, BlendHandle *bh);
diff --cc source/blender/blenloader/intern/readfile.c
index b19a1c5,b3b0ee4..1044d94
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9636,11 -9636,9 +9636,11 @@@ static ID *create_placeholder(Main *mai
  
  /* 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 short idcode, const char *name)
 +static ID *link_named_part(
-         Main *mainl, FileData *fd, const char *idname, const short idcode,
++        Main *mainl, FileData *fd, const short idcode, const char *name,
 +        const bool use_placeholders, const bool force_indirect)
  {
- 	BHead *bhead = find_bhead_from_code_name(fd, idcode, idname);
+ 	BHead *bhead = find_bhead_from_code_name(fd, idcode, name);
  	ID *id;
  
  	if (bhead) {
@@@ -9666,10 -9664,6 +9666,10 @@@
  			}
  		}
  	}
 +	else if (use_placeholders) {
 +		/* XXX flag part is weak! */
- 		id = create_placeholder(mainl, idcode, idname, force_indirect ? LIB_INDIRECT : LIB_EXTERN);
++		id = create_placeholder(mainl, idcode, name, force_indirect ? LIB_INDIRECT : LIB_EXTERN);
 +	}
  	else {
  		id = NULL;
  	}
@@@ -9704,10 -9698,10 +9704,10 @@@ void BLO_library_link_all(Main *mainl, 
  }
  
  static ID *link_named_part_ex(
-         Main *mainl, FileData *fd, const char *idname, const int idcode, const short flag,
 -        Main *mainl, FileData *fd, const short idcode, const char *name, const short flag,
 -		Scene *scene, View3D *v3d)
++        Main *mainl, FileData *fd, const int idcode, const char *name, const short flag,
 +		Scene *scene, View3D *v3d, const bool use_placeholders, const bool force_indirect)
  {
- 	ID *id = link_named_part(mainl, fd, idname, idcode, use_placeholders, force_indirect);
 -	ID *id = link_named_part(mainl, fd, idcode, name);
++	ID *id = link_named_part(mainl, fd, idcode, name, use_placeholders, force_indirect);
  
  	if (id && (GS(id->name) == ID_OB)) {	/* loose object: give a base */
  		if (scene) {
@@@ -9751,14 -9745,14 +9751,14 @@@
   *
   * \param mainl The main database to link from (not the active one).
   * \param bh The blender file handle.
-  * \param idname The name of the datablock (without the 2 char ID prefix).
   * \param idcode The kind of datablock to link.
-  * \return the appended ID when found.
+  * \param name The name of the datablock (without the 2 char ID prefix).
+  * \return the linked ID when found.
   */
- ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const char *idname, const int idcode)
+ ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const short idcode, const char *name)
  {
  	FileData *fd = (FileData*)(*bh);
- 	return link_named_part(mainl, fd, idname, idcode, false, false);
 -	return link_named_part(mainl, fd, idcode, name);
++	return link_named_part(mainl, fd, idcode, name, false, false);
  }
  
  /**
@@@ -9772,16 -9766,15 +9772,16 @@@
   * \param flag Options for linking, used for instantiating.
   * \param scene The scene in which to instantiate objects/groups (if NULL, no instantiation is done).
   * \param v3d The active View3D (only to define active layers for instantiated objects & groups, can be NULL).
 + * \param use_placeholders If true, generate a placeholder (empty ID) if not found in current lib file.
 + * \param force_indirect If true, force loaded ID to be tagged as LIB_INDIRECT (used in reload context only).
-  * \return the appended ID when found.
+  * \return the linked ID when found.
   */
  ID *BLO_library_link_named_part_ex(
-         Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag,
 -        Main *mainl, BlendHandle **bh,
 -        const short idcode, const char *name, const short flag,
 -        Scene *scene, View3D *v3d)
++        Main *mainl, BlendHandle **bh, const int idcode, const char *name, const short flag,
 +        Scene *scene, View3D *v3d, const bool use_placeholders, const bool force_indirect)
  {
  	FileData *fd = (FileData*)(*bh);
- 	return link_named_part_ex(mainl, fd, idname, idcode, flag, scene, v3d, use_placeholders, force_indirect);
 -	return link_named_part_ex(mainl, fd, idcode, name, flag, scene, v3d);
++	return link_named_part_ex(mainl, fd, idcode, name, flag, scene, v3d, use_placeholders, force_indirect);
  }
  
  static void link_id_part(ReportList *reports, FileData *fd, Main *mainvar, ID *id, ID **r_id)
diff --cc source/blender/windowmanager/intern/wm_operators.c
index ceadaf7,5c2e1f8..2fc89fa
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@@ -2743,8 -2742,7 +2743,9 @@@ static void wm_link_do
  				continue;
  			}
  
 -			new_id = BLO_library_link_named_part_ex(mainl, &bh, item->idcode, item->name, flag, scene, v3d);
 +			new_id = BLO_library_link_named_part_ex(
- 			             mainl, &bh, item->name, item->idcode, flag, scene, v3d, use_placeholders, force_indirect);
++			             mainl, &bh, item->idcode, item->name, flag, scene, v3d, use_placeholders, force_indirect);
++
  			if (new_id) {
  				/* If the link is sucessful, clear item's libs 'todo' flags.
  				 * This avoids trying to link same item with other libraries to come. */




More information about the Bf-blender-cvs mailing list