diff options
Diffstat (limited to 'source/blender/blenloader/BLO_readfile.h')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 22083eda1c8..85d4b936c51 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -49,6 +49,8 @@ struct SpaceFile; struct SpaceImaSel; struct UserDef; struct bContext; +struct BHead; +struct FileData; typedef struct BlendHandle BlendHandle; @@ -79,12 +81,12 @@ typedef struct BlendFileData { * returns NULL and sets a report in the list if * it cannot open the file. * - * @param file The path of the file to open. + * @param filepath The path of the file to open. * @param reports If the return value is NULL, errors * indicating the cause of the failure. * @return The data of the file. */ -BlendFileData* BLO_read_from_file(const char *file, struct ReportList *reports); +BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *reports); /** * Open a blender file from memory. The function @@ -209,22 +211,38 @@ int BLO_has_bfile_extension(char *str); */ int BLO_is_a_library(const char *path, char *dir, char *group); -struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, char *dir); +struct Main* BLO_library_append_begin(const struct bContext *C, 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 *mainl, BlendHandle** bh, const char *idname, const int idcode); + +/** + * 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 isnt done. * @param mainl The main database to link from (not the active one). * @param bh The blender file handle. - * @param name The name of the datablock (without the 2 char ID prefix) + * @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 Boolean, 0 when the datablock could not be found. + * @return the appended ID when found. */ -int BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *name, int idcode, short flag); +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); + void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag); +void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname); + /* deprecated */ #if 1 void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, int idcode, short flag, struct Main *mainvar, struct Scene *scene, struct ReportList *reports); |