[Bf-blender-cvs] [3ad17b9] asset-engine: Merge branch 'master' into asset-engine

Bastien Montagne noreply at git.blender.org
Mon Nov 2 19:33:16 CET 2015


Commit: 3ad17b9405c5f5c5101ebb8529eef68d72436f07
Author: Bastien Montagne
Date:   Tue Oct 27 15:05:17 2015 +0100
Branches: asset-engine
https://developer.blender.org/rB3ad17b9405c5f5c5101ebb8529eef68d72436f07

Merge branch 'master' into asset-engine

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



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

diff --cc source/blender/blenloader/intern/readfile.c
index a322e99,b112f3d..2fb125b
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9759,39 -9763,20 +9767,44 @@@ ID *BLO_library_link_named_part_ex
          Scene *scene, View3D *v3d)
  {
  	FileData *fd = (FileData*)(*bh);
 -	return link_named_part_ex(mainl, fd, idcode, name, flag, scene, v3d);
 +	return link_named_part_ex(mainl, fd, NULL, idcode, name, NULL, flag, scene, v3d);
 +}
 +
 +/**
 + * Link a named datablock from an external blend file, using given asset engine & asset UUID.
 + * Optionally instantiate the object/group in the scene when the flags are set.
 + *
 + * \param mainl The main database to link from (not the active one).
 + * \param bh The blender file handle.
 + * \param aet The asset engine type (NULL when no asset engine is used).
 + * \param idcode The kind of datablock to link.
 + * \param name The name of the datablock (without the 2 char ID prefix).
 + * \param uuid The asset engine's UUID of this datablock (NULL when no asset engine is used).
 + * \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).
 + * \return the linked ID when found.
 + */
 +struct ID *BLO_library_link_named_part_asset(
 +        Main *mainl, BlendHandle **bh, const AssetEngineType *aet,
 +        const short idcode, const char *name, const AssetUUID *uuid, const short flag,
 +        Scene *scene, View3D *v3d)
 +{
 +	FileData *fd = (FileData*)(*bh);
 +	return link_named_part_ex(mainl, fd, aet, idcode, name, uuid, 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