[Bf-blender-cvs] [4ea9ef1] lib-link-rework-temp: Merge branch 'master' into lib-link-rework-temp
Bastien Montagne
noreply at git.blender.org
Mon Oct 12 15:26:45 CEST 2015
Commit: 4ea9ef1844f915db9d09bbd928bb3f3067b82c48
Author: Bastien Montagne
Date: Mon Oct 12 14:39:05 2015 +0200
Branches: lib-link-rework-temp
https://developer.blender.org/rB4ea9ef1844f915db9d09bbd928bb3f3067b82c48
Merge branch 'master' into lib-link-rework-temp
===================================================================
===================================================================
diff --cc source/blender/blenloader/BLO_readfile.h
index f417df7,eda76ec..c203f65
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@@ -195,72 -92,14 +93,15 @@@ 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_link_begin(
- struct Main *mainvar, BlendHandle **bh,
- const char *filepath);
-
-
- /**
- * 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.
- */
- struct ID *BLO_library_link_named_part(
- struct Main *mainl, BlendHandle **bh,
- const char *idname, const int idcode);
-
- /**
- * 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 instancing.
- * \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 instanced objects & groups, can be NULL).
- * \return the appended ID when found.
- */
+ 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(
- const struct bContext *C, struct Main *mainl, BlendHandle **bh,
- const char *idname, const int idcode, const short flag);
-void BLO_library_link_end(const struct bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag);
+ struct Main *mainl, BlendHandle **bh,
+ const char *idname, const int idcode, const short flag,
+ struct Scene *scene, struct View3D *v3d);
-
- /**
- * Finalize linking from a given .blend file (library).
- * Optionally instance the indirect 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 (WARNING! may be freed by this function!).
- * \param flag Options for linking, used for instancing.
- * \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 instanced objects & groups, can be NULL).
- */
+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 198c5ae,721878d..c965012
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9702,12 -9752,24 +9747,25 @@@ ID *BLO_library_link_named_part(Main *m
return link_named_part(mainl, fd, idname, idcode);
}
+ /**
+ * Link a named datablock from an external blend file.
- * Optionally instantiate the object/group in the scene when the flags are set.
++ * optionally instantiate the object/group in the scene when the flags are set.
+ *
- * \param C The context, when NULL instantiating 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 instantiating.
++ * \param flag Options for linking, used for instancing.
++ * \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 instanced objects & groups, can be NULL).
+ * \return the appended ID when found.
+ */
ID *BLO_library_link_named_part_ex(
- const bContext *C, Main *mainl, BlendHandle **bh,
- const char *idname, const int idcode, const short flag)
+ Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag,
+ Scene *scene, View3D *v3d)
{
FileData *fd = (FileData*)(*bh);
- return link_named_part_ex(C, mainl, fd, idname, idcode, flag);
+ return link_named_part_ex(mainl, fd, idname, idcode, flag, scene, v3d);
}
static void link_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id)
@@@ -9814,10 -9897,20 +9880,21 @@@ static void library_link_end(Main *main
}
}
+ /**
- * Finalize the linking process (among other things, ensures remaining needed intantiation is done).
++ * Finalize linking from a given .blend file (library).
++ * Optionally instance the indirect object/group in the scene when the flags are set.
+ * \note Do not use \a bh after calling this function, it may frees it.
+ *
- * \param C The context, when NULL instantiating 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 idcode The kind of datablock that has been linked.
- * \param flag Options for for instantiating.
++ * \param bh The blender file handle (WARNING! may be freed by this function!).
++ * \param flag Options for linking, used for instancing.
++ * \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).
+ */
-void BLO_library_link_end(const bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag)
+void BLO_library_link_end(Main *mainl, BlendHandle **bh, short flag, Scene *scene, View3D *v3d)
{
FileData *fd = (FileData*)(*bh);
- library_link_end(C, mainl, &fd, idcode, flag);
+ library_link_end(mainl, &fd, flag, scene, v3d);
*bh = (BlendHandle*)fd;
}
More information about the Bf-blender-cvs
mailing list