Blender V2.61 - r43446
|
external readfile function prototypes. More...
Go to the source code of this file.
Classes | |
struct | BlendFileData |
Defines | |
#define | GROUP_MAX 32 |
Typedefs | |
typedef struct BlendHandle | BlendHandle |
typedef enum BlenFileType | BlenFileType |
typedef struct BlendFileData | BlendFileData |
Enumerations | |
enum | BlenFileType { BLENFILETYPE_BLEND = 1, BLENFILETYPE_PUB = 2, BLENFILETYPE_RUNTIME = 3 } |
Functions | |
BlendFileData * | BLO_read_from_file (const char *filepath, struct ReportList *reports) |
BlendFileData * | BLO_read_from_memory (void *mem, int memsize, struct ReportList *reports) |
BlendFileData * | BLO_read_from_memfile (struct Main *oldmain, const char *filename, struct MemFile *memfile, struct ReportList *reports) |
void | BLO_blendfiledata_free (BlendFileData *bfd) |
BlendHandle * | BLO_blendhandle_from_file (char *file, struct ReportList *reports) |
BlendHandle * | BLO_blendhandle_from_memory (void *mem, int memsize) |
struct LinkNode * | BLO_blendhandle_get_datablock_names (BlendHandle *bh, int ofblocktype, int *tot_names) |
struct LinkNode * | BLO_blendhandle_get_previews (BlendHandle *bh, int ofblocktype, int *tot_prev) |
struct LinkNode * | BLO_blendhandle_get_linkable_groups (BlendHandle *bh) |
void | BLO_blendhandle_close (BlendHandle *bh) |
int | BLO_has_bfile_extension (const char *str) |
int | BLO_is_a_library (const char *path, char *dir, char *group) |
struct Main * | BLO_library_append_begin (struct Main *mainvar, BlendHandle **bh, const char *filepath) |
struct ID * | BLO_library_append_named_part (struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode) |
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) |
BlendFileData * | blo_read_blendafterruntime (int file, const char *name, int actualsize, struct ReportList *reports) |
external readfile function prototypes.
Definition in file BLO_readfile.h.
#define GROUP_MAX 32 |
Definition at line 202 of file BLO_readfile.h.
Referenced by BLO_is_a_library(), and wm_link_append_exec().
typedef struct BlendFileData BlendFileData |
typedef struct BlendHandle BlendHandle |
Definition at line 52 of file BLO_readfile.h.
typedef enum BlenFileType BlenFileType |
enum BlenFileType |
Definition at line 54 of file BLO_readfile.h.
void BLO_blendfiledata_free | ( | BlendFileData * | bfd | ) |
Free's a BlendFileData structure and _all_ the data associated with it (the userdef data, and the main libblock data).
bfd | The structure to free. |
Definition at line 334 of file readblenentry.c.
References free_main(), BlendFileData::main, MEM_freeN(), and BlendFileData::user.
Referenced by main(), and StartKetsjiShell().
void BLO_blendhandle_close | ( | BlendHandle * | bh | ) |
Close and free a blendhandle. The handle becomes invalid after this call.
bh | The handle to close. |
Definition at line 243 of file readblenentry.c.
References blo_freefiledata().
Referenced by bpy_lib_exit(), filelist_freelib(), filelist_from_library(), KX_BlenderSceneConverter::LinkBlendFile(), and wm_link_append_exec().
BlendHandle* BLO_blendhandle_from_file | ( | char * | file, |
struct ReportList * | reports | ||
) |
Open a blendhandle from a file path.
file | The file path to open. |
reports | Report errors in opening the file (can be NULL). |
Definition at line 76 of file readblenentry.c.
References blo_openblenderfile().
Referenced by bpy_lib_enter(), filelist_from_library(), KX_BlenderSceneConverter::LinkBlendFilePath(), and wm_link_append_exec().
BlendHandle* BLO_blendhandle_from_memory | ( | void * | mem, |
int | memsize | ||
) |
Open a blendhandle from memory.
mem | The data to load from. |
memsize | The size of the data. |
Definition at line 85 of file readblenentry.c.
References blo_openblendermemory(), and NULL.
Referenced by KX_BlenderSceneConverter::LinkBlendFileMemory().
struct LinkNode* BLO_blendhandle_get_datablock_names | ( | BlendHandle * | bh, |
int | ofblocktype, | ||
int * | tot_names | ||
) | [read] |
Gets the names of all the datablocks in a file of a certain type (ie. All the scene names in a file).
bh | The blendhandle to access. |
ofblocktype | The type of names to get. |
tot_names | The length of the returned list. |
Definition at line 124 of file readblenentry.c.
References bhead_id_name(), BLI_linklist_prepend(), blo_firstbhead(), blo_nextbhead(), BHead::code, ENDB, names, and NULL.
Referenced by _bpy_names(), filelist_from_library(), and KX_BlenderSceneConverter::LinkBlendFile().
struct LinkNode* BLO_blendhandle_get_linkable_groups | ( | BlendHandle * | bh | ) | [read] |
Gets the names of all the datablock groups in a file. (ie. file contains Scene, Mesh, and Lamp datablocks).
bh | The blendhandle to access. |
Definition at line 216 of file readblenentry.c.
References BKE_idcode_is_linkable(), BKE_idcode_is_valid(), BKE_idcode_to_name(), BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_linklist_prepend(), blo_firstbhead(), blo_nextbhead(), BHead::code, ENDB, names, NULL, and str.
Referenced by filelist_from_library().
struct LinkNode* BLO_blendhandle_get_previews | ( | BlendHandle * | bh, |
int | ofblocktype, | ||
int * | tot_prev | ||
) | [read] |
Gets the previews of all the datablocks in a file of a certain type (ie. All the scene names in a file).
bh | The blendhandle to access. |
ofblocktype | The type of names to get. |
tot_prev | The length of the returned list. |
Definition at line 145 of file readblenentry.c.
References bhead_id_name(), BLI_linklist_prepend(), blo_firstbhead(), BLO_library_read_struct(), blo_nextbhead(), BHead::code, DATA, DNA_struct_find_nr(), ENDB, FileData::filesdna, GS, PreviewImage::h, ID_IM, ID_LA, ID_MA, ID_TE, ID_WO, BHead::len, MEM_callocN(), MEM_freeN(), NULL, PreviewImage::rect, BHead::SDNAnr, and PreviewImage::w.
Referenced by filelist_from_library().
int BLO_has_bfile_extension | ( | const char * | str | ) |
Definition at line 1089 of file readfile.c.
References BLI_testextensie().
Referenced by blend_save_check(), BLO_is_a_library(), file_extension_type(), and filelist_read_library().
int BLO_is_a_library | ( | const char * | path, |
char * | dir, | ||
char * | group | ||
) |
Definition at line 1094 of file readfile.c.
References BLI_last_slash(), BLI_strncpy(), BLO_has_bfile_extension(), GROUP_MAX, len(), NULL, and strlen().
Referenced by filelist_islibrary(), is_filtered_lib(), and wm_link_append_exec().
struct Main* BLO_library_append_begin | ( | struct Main * | mainvar, |
BlendHandle ** | bh, | ||
const char * | filepath | ||
) | [read] |
Initialize the BlendHandle for appending or linking library data.
mainvar | The current main database eg G.main or CTX_data_main(C). |
bh | A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. |
filepath | Used for relative linking, copied to the lib->name |
Definition at line 14352 of file readfile.c.
References library_append_begin().
Referenced by bpy_lib_exit(), KX_BlenderSceneConverter::LinkBlendFile(), and wm_link_append_exec().
void BLO_library_append_end | ( | const struct bContext * | C, |
struct Main * | mainl, | ||
BlendHandle ** | bh, | ||
int | idcode, | ||
short | flag | ||
) |
Referenced by bpy_lib_exit(), KX_BlenderSceneConverter::LinkBlendFile(), and wm_link_append_exec().
struct ID* BLO_library_append_named_part | ( | struct Main * | mainl, |
BlendHandle ** | bh, | ||
const char * | idname, | ||
const int | idcode | ||
) | [read] |
Link/Append a named datablock from an external blend file.
mainl | The main database to link from (not the active one). |
bh | The blender file handle. |
idname | The name of the datablock (without the 2 char ID prefix) |
idcode | The kind of datablock to link. |
Definition at line 14301 of file readfile.c.
References append_named_part().
Referenced by bpy_lib_exit(), and KX_BlenderSceneConverter::LinkBlendFile().
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 | ||
) | [read] |
Link/Append a named datablock from an external blend file. optionally instance the object in the scene when the flags are set.
C | The context, when NULL instancing object in the scene isnt done. |
mainl | The main database to link from (not the active one). |
bh | The blender file handle. |
idname | The name of the datablock (without the 2 char ID prefix) |
idcode | The kind of datablock to link. |
flag | Options for linking, used for instancing. |
Referenced by wm_link_append_exec().
Definition at line 14430 of file readfile.c.
References read_struct().
Referenced by BLO_blendhandle_get_previews().
BlendFileData* blo_read_blendafterruntime | ( | int | file, |
const char * | name, | ||
int | actualsize, | ||
struct ReportList * | reports | ||
) |
Definition at line 14614 of file readfile.c.
References BLI_strncpy(), blo_decode_and_check(), blo_freefiledata(), blo_read_file_internal(), FileData::buffersize, fd_read_from_file(), filedata_new(), FileData::filedes, NULL, FileData::read, FileData::relabase, and FileData::reports.
Referenced by BLO_read_runtime().
BlendFileData* BLO_read_from_file | ( | const char * | filepath, |
struct ReportList * | reports | ||
) |
Open a blender file from a pathname. The function returns NULL and sets a report in the list if it cannot open the file.
filepath | The path of the file to open. |
reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 252 of file readblenentry.c.
References blo_freefiledata(), blo_openblenderfile(), blo_read_file_internal(), NULL, and FileData::reports.
Referenced by BKE_read_file(), load_game_data(), and GPC_Engine::Start().
BlendFileData* BLO_read_from_memfile | ( | struct Main * | oldmain, |
const char * | filename, | ||
struct MemFile * | memfile, | ||
struct ReportList * | reports | ||
) |
oldmain is old main, from which we will keep libraries, images, .. file name is current file, only for retrieving library data
Definition at line 282 of file readblenentry.c.
References BLI_addhead(), BLI_remlink(), BLI_strncpy(), blo_add_library_pointer_map(), blo_clear_proxy_pointers_from_lib(), blo_end_image_pointer_map(), blo_end_movieclip_pointer_map(), blo_freefiledata(), blo_join_main(), blo_make_image_pointer_map(), blo_make_movieclip_pointer_map(), blo_openblendermemfile(), blo_read_file_internal(), blo_split_main(), ListBase::first, ListBase::last, Main::library, BlendFileData::main, NULL, FileData::relabase, and FileData::reports.
Referenced by BKE_read_file_from_memfile(), and BKE_undo_get_main().
BlendFileData* BLO_read_from_memory | ( | void * | mem, |
int | memsize, | ||
struct ReportList * | reports | ||
) |
Open a blender file from memory. The function returns NULL and sets a report in the list if it cannot open the file.
mem | The file data. |
memsize | The length of mem. |
reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 267 of file readblenentry.c.
References blo_freefiledata(), blo_openblendermemory(), blo_read_file_internal(), NULL, and FileData::reports.
Referenced by BKE_read_file_from_memory(), ED_preview_init_dbase(), and GPC_Engine::Start().