Blender V2.61 - r43446
|
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
#include "BKE_main.h"
#include "BKE_library.h"
#include "BKE_idcode.h"
#include "BKE_report.h"
#include "BKE_utildefines.h"
#include "BLO_readfile.h"
#include "BLO_undofile.h"
#include "readfile.h"
#include "BLO_sys_types.h"
Go to the source code of this file.
Functions | |
void | BLO_blendhandle_print_sizes (BlendHandle *, void *) |
BlendHandle * | BLO_blendhandle_from_file (char *file, ReportList *reports) |
BlendHandle * | BLO_blendhandle_from_memory (void *mem, int memsize) |
LinkNode * | BLO_blendhandle_get_datablock_names (BlendHandle *bh, int ofblocktype, int *tot_names) |
LinkNode * | BLO_blendhandle_get_previews (BlendHandle *bh, int ofblocktype, int *tot_prev) |
LinkNode * | BLO_blendhandle_get_linkable_groups (BlendHandle *bh) |
void | BLO_blendhandle_close (BlendHandle *bh) |
BlendFileData * | BLO_read_from_file (const char *filepath, ReportList *reports) |
BlendFileData * | BLO_read_from_memory (void *mem, int memsize, ReportList *reports) |
BlendFileData * | BLO_read_from_memfile (Main *oldmain, const char *filename, MemFile *memfile, ReportList *reports) |
void | BLO_blendfiledata_free (BlendFileData *bfd) |
Definition in file readblenentry.c.
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().
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().
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().
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().
void BLO_blendhandle_print_sizes | ( | BlendHandle * | bh, |
void * | fp | ||
) |
Definition at line 94 of file readblenentry.c.
References blo_firstbhead(), blo_nextbhead(), BHead::code, ENDB, FileData::filesdna, BHead::len, Image::name, BHead::nr, BHead::SDNAnr, SDNA::structs, and SDNA::types.
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().