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

Bastien Montagne noreply at git.blender.org
Thu Oct 15 14:29:58 CEST 2015


Commit: a2aafbe6568d75f0f192a52b64a06c5c0a9ee365
Author: Bastien Montagne
Date:   Thu Oct 15 14:12:08 2015 +0200
Branches: asset-engine
https://developer.blender.org/rBa2aafbe6568d75f0f192a52b64a06c5c0a9ee365

Merge branch 'master' into asset-engine

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



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

diff --cc source/blender/blenloader/BLO_readfile.h
index 94aa4ce,c203f65..d121697
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@@ -196,79 -93,17 +95,21 @@@ void BLO_blendhandle_close(BlendHandle 
  #define BLO_GROUP_MAX 32
  
  bool BLO_has_bfile_extension(const char *str);
- 
- /**
-  * \param path the full path to explode.
-  * \param r_dir the string that'll contain path up to blend file itself ('library' path).
-  * \param r_group the string that'll contain 'group' part of the path, if any. May be NULL.
-  * \param r_name the string that'll contain data's name part of the path, if any. May be NULL.
-  * \return true if path contains a blend file.
-  */
  bool BLO_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name);
  
- 
- /**
-  * Initialize the BlendHandle for appending or linking library data.
-  *
-  * \param mainvar The current main database eg G.main or CTX_data_main(C).
-  * \param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory.
-  * \param filepath Used for relative linking, copied to the lib->name
-  * \return the library Main, to be passed to BLO_library_append_named_part as mainl.
-  */
- struct Main *BLO_library_append_begin(
-         struct Main *mainvar, BlendHandle **bh,
-         const char *filepath);
- 
- 
- /**
-  * Link/Append a named datablock from an external blend file.
-  *
-  * \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.
-  */
- struct ID *BLO_library_append_named_part(
+ 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_ex(
          struct Main *mainl, BlendHandle **bh,
-         const char *idname, const int idcode);
+         const char *idname, const int idcode, const short flag,
+         struct Scene *scene, struct View3D *v3d);
++struct ID *BLO_library_link_named_part_asset(
++        struct Main *mainl, BlendHandle **bh, const struct AssetEngineType *aet,
++        const char *idname, const int idcode, const struct AssetUUID *uuid, const short flag,
++        struct Scene *scene, struct View3D *v3d);
+ void BLO_library_link_end(struct Main *mainl, BlendHandle **bh, short flag, struct Scene *scene, struct View3D *v3d);
  
- /**
-  * Link/Append a named datablock from an external blend file.
-  * optionally instance the object in the scene when the flags are set.
-  *
-  * \param C The context, when NULL instancing object in the scene isn't done.
-  * \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.
-  * \param flag Options for linking, used for instancing.
-  * \return the appended ID when found.
-  */
- struct ID *BLO_library_append_named_part_ex(
-         const struct bContext *C, struct Main *mainl, BlendHandle **bh,
-         const char *idname, const int idcode, const short flag);
- /**
-  * Link/Append a named datablock from an external blend file.
-  * optionally instance the object in the scene when the flags are set.
-  *
-  * \param C The context, when NULL instancing object in the scene isn't done.
-  * \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 idname The name of the datablock (without the 2 char ID prefix)
-  * \param idcode The kind of datablock to link.
-  * \param uuid The asset engine's UUID of this datablock (NULL when no asset engine is used).
-  * \param flag Options for linking, used for instancing.
-  * \return the appended ID when found.
-  */
- struct ID *BLO_library_append_named_part_asset(
-         const struct bContext *C, struct Main *mainl, BlendHandle **bh, const struct AssetEngineType *aet,
-         const char *idname, const int idcode, const struct AssetUUID *uuid, const int flag);
- 
- void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag);
- 
- void BLO_library_append_all(struct Main *mainl, BlendHandle *bh);
+ void BLO_library_link_all(struct Main *mainl, BlendHandle *bh);
  
  void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
  
diff --cc source/blender/blenloader/intern/readfile.c
index 6cc0593,470d45f..49796ca
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9630,15 -9678,13 +9681,14 @@@ void BLO_library_link_all(Main *mainl, 
  	}
  }
  
- 
- static ID *append_named_part_ex(
-         const bContext *C, Main *mainl, FileData *fd, const AssetEngineType *aet,
-         const char *idname, const int idcode, const AssetUUID *uuid, const int flag)
+ static ID *link_named_part_ex(
 -        Main *mainl, FileData *fd, const char *idname, const int idcode, const int flag,
++        Main *mainl, FileData *fd, const AssetEngineType *aet,
++        const char *idname, const int idcode, const AssetUUID *uuid, const int flag,
+ 		Scene *scene, View3D *v3d)
  {
- 	ID *id= append_named_part(mainl, fd, idname, idcode);
+ 	ID *id = link_named_part(mainl, fd, idname, idcode);
  
  	if (id && (GS(id->name) == ID_OB)) {	/* loose object: give a base */
- 		Scene *scene = CTX_data_scene(C); /* can be NULL */
  		if (scene) {
  			Base *base;
  			Object *ob;
@@@ -9675,27 -9721,43 +9725,67 @@@
  	return id;
  }
  
- ID *BLO_library_append_named_part(Main *mainl, BlendHandle **bh, const char *idname, const int idcode)
+ /**
+  * Link a named datablock from an external blend file.
+  *
+  * \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.
+  */
+ ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const char *idname, const int idcode)
  {
  	FileData *fd = (FileData*)(*bh);
- 	return append_named_part(mainl, fd, idname, idcode);
+ 	return link_named_part(mainl, fd, idname, idcode);
  }
  
- ID *BLO_library_append_named_part_ex(const bContext *C, Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag)
+ /**
+  * Link a named datablock from an external blend file.
+  * 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 idname The name of the datablock (without the 2 char ID prefix).
+  * \param idcode The kind of datablock to link.
+  * \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 appended ID when found.
+  */
+ ID *BLO_library_link_named_part_ex(
+         Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag,
+         Scene *scene, View3D *v3d)
  {
  	FileData *fd = (FileData*)(*bh);
- 	return append_named_part_ex(C, mainl, fd, NULL, idname, idcode, NULL, flag);
 -	return link_named_part_ex(mainl, fd, idname, idcode, flag, scene, v3d);
++	return link_named_part_ex(mainl, fd, NULL, idname, idcode, NULL, flag, scene, v3d);
 +}
 +
- ID *BLO_library_append_named_part_asset(
-         const bContext *C, Main *mainl, BlendHandle **bh, const AssetEngineType *aet,
-         const char *idname, const int idcode, const AssetUUID *uuid, const int flag)
++/**
++ * 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 idname The name of the datablock (without the 2 char ID prefix).
++ * \param idcode The kind of datablock to link.
++ * \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 char *idname, const int idcode, const AssetUUID *uuid, const short flag,
++        Scene *scene, View3D *v3d)
 +{
 +	FileData *fd = (FileData*)(*bh);
- 	return append_named_part_ex(C, mainl, fd, aet, idname, idcode, uuid, flag);
++	return link_named_part_ex(mainl, fd, aet, idname, idcode, uuid, flag, scene, v3d);
  }
  
- static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id)
+ static void link_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id)
  {
  	BHead *bhead = find_bhead_from_idname(fd, id->name);
  
diff --cc source/blender/windowmanager/intern/wm_operators.c
index 6c79e12,1245430..513bbde
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@@ -2620,109 -2626,133 +2647,137 @@@ static short wm_link_append_flag(wmOper
  	return flag;
  }
  
- /* Helper.
-  *     if `name` is non-NULL, we assume a single-item link/append.
-  *     else if `*todo_libraries` is NULL we assume first-run.
-  */
- static vo

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list