Blender V2.61 - r43446
|
Go to the source code of this file.
Defines | |
#define | MAX_LIBARRAY 40 |
#define | ID_FALLBACK_NAME "Untitled" |
#define | IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT)) |
Functions | |
void * | alloc_libblock (struct ListBase *lb, short type, const char *name) |
void * | copy_libblock (struct ID *id) |
void | copy_libblock_data (struct ID *id, const struct ID *id_from, const short do_action) |
void | BKE_id_lib_local_paths (struct Main *bmain, struct Library *lib, struct ID *id) |
void | id_lib_extern (struct ID *id) |
void | BKE_library_filepath_set (struct Library *lib, const char *filepath) |
void | id_us_plus (struct ID *id) |
void | id_us_min (struct ID *id) |
int | id_make_local (struct ID *id, int test) |
int | id_single_user (struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop) |
int | id_copy (struct ID *id, struct ID **newid, int test) |
int | id_unlink (struct ID *id, int test) |
int | new_id (struct ListBase *lb, struct ID *id, const char *name) |
void | id_clear_lib_data (struct Main *bmain, struct ID *id) |
struct ListBase * | which_libbase (struct Main *mainlib, short type) |
int | set_listbasepointers (struct Main *main, struct ListBase **lb) |
void | free_libblock (struct ListBase *lb, void *idv) |
void | free_libblock_us (struct ListBase *lb, void *idv) |
void | free_main (struct Main *mainvar) |
void | tag_main_idcode (struct Main *mainvar, const short type, const short tag) |
void | tag_main_lb (struct ListBase *lb, const short tag) |
void | tag_main (struct Main *mainvar, const short tag) |
void | rename_id (struct ID *id, const char *name) |
void | name_uiprefix_id (char *name, struct ID *id) |
void | test_idbutton (char *name) |
void | text_idbutton (struct ID *id, char *text) |
void | BKE_library_make_local (struct Main *bmain, struct Library *lib, int untagged_only) |
struct ID * | find_id (const char *type, const char *name) |
void | clear_id_newpoins (void) |
void | IDnames_to_pupstring (const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr) |
void | IMAnames_to_pupstring (const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr) |
void | IPOnames_to_pupstring (const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr, int blocktype) |
void | flag_listbase_ids (ListBase *lb, short flag, short value) |
void | flag_all_listbases_ids (short flag, short value) |
void | recalc_all_library_objects (struct Main *main) |
void | set_free_windowmanager_cb (void(*func)(struct bContext *, struct wmWindowManager *)) |
Definition in file BKE_library.h.
#define ID_FALLBACK_NAME "Untitled" |
Definition at line 97 of file BKE_library.h.
Referenced by new_id().
#define IS_TAGGED | ( | _id | ) | ((_id) && (((ID *)_id)->flag & LIB_DOIT)) |
Definition at line 99 of file BKE_library.h.
Referenced by convert_exec(), and KX_BlenderSceneConverter::FreeBlendFile().
#define MAX_LIBARRAY 40 |
Definition at line 67 of file BKE_library.h.
Referenced by add_main_to_main(), BKE_library_make_local(), blo_add_library_pointer_map(), blo_split_main(), bpath_traverse_main(), clear_id_newpoins(), DAG_ids_check_recalc(), DAG_ids_clear_recalc(), DAG_ids_flush_tagged(), expand_main(), flag_all_listbases_ids(), free_main(), mainvar_count_libread_blocks(), read_libraries(), tag_main(), and write_libraries().
void* alloc_libblock | ( | struct ListBase * | lb, |
short | type, | ||
const char * | name | ||
) |
Definition at line 689 of file library.c.
References alloc_libblock_notest(), BLI_addtail(), ID::name, new_id(), and NULL.
Referenced by add_armature(), add_brush(), add_camera(), add_curve(), add_empty_action(), add_empty_text(), add_group(), add_key(), add_lamp(), add_lattice(), add_material(), add_mball(), add_mesh(), add_only_object(), add_scene(), add_speaker(), add_text(), add_texture(), add_world(), blo_find_main(), copy_libblock(), ED_screen_add(), gpencil_data_addnew(), image_alloc(), load_vfont(), movieclip_alloc(), ntreeAddTree(), psys_new_settings(), sound_new_file(), and wm_add_default().
Definition at line 139 of file library.c.
References bpath_relocate_visitor(), bpath_traverse_id(), BPATH_TRAVERSE_SKIP_MULTIFILE, Library::filepath, and Main::name.
Referenced by id_clear_lib_data(), make_local_action(), make_local_armature(), make_local_brush(), make_local_camera(), make_local_curve(), make_local_image(), make_local_lamp(), make_local_lattice(), make_local_material(), make_local_mball(), make_local_mesh(), make_local_object(), make_local_particlesettings(), make_local_speaker(), make_local_texture(), and make_local_world().
void BKE_library_filepath_set | ( | struct Library * | lib, |
const char * | filepath | ||
) |
Definition at line 1500 of file library.c.
References BLI_path_abs(), BLI_strncpy(), Library::filepath, G, Library::name, and Library::parent.
Referenced by bpath_traverse_id(), and namebutton_cb().
Definition at line 1388 of file library.c.
References BLI_addtail(), BLI_remlink(), ListBase::first, ID::flag, id_clear_lib_data(), ID::lib, LIB_EXTERN, LIB_INDIRECT, lib_indirect_test_id(), LIB_NEW, LIB_PRE_EXISTING, MAX_LIBARRAY, new_id(), ID::next, NULL, set_listbasepointers(), and sort_alpha_id().
Referenced by bpy_lib_exit(), make_local_exec(), and wm_link_append_exec().
void clear_id_newpoins | ( | void | ) |
Definition at line 1291 of file library.c.
References ListBase::first, G, LIB_NEW, MAX_LIBARRAY, NULL, and set_listbasepointers().
Referenced by add_named_exec(), copy_object_set_idnew(), copy_scene(), duplicate_exec(), ED_object_add_duplicate(), ED_object_single_users(), make_local_exec(), make_single_user_exec(), and object_duplicates_make_real_exec().
void* copy_libblock | ( | struct ID * | id | ) |
Definition at line 728 of file library.c.
References alloc_libblock(), assert, copy_libblock_data(), FALSE, ID::flag, G, GS, LIB_NEW, MEM_allocN_len(), ID::name, NULL, and which_libbase().
Referenced by copy_action(), copy_armature(), copy_brush(), copy_camera(), copy_curve(), copy_key(), copy_lamp(), copy_lattice(), copy_material(), copy_mball(), copy_mesh(), copy_object(), copy_scene(), copy_speaker(), copy_text(), copy_texture(), copy_world(), localize_lamp(), localize_material(), localize_texture(), localize_world(), ntreeCopyTree(), and psys_copy_settings().
Referenced by copy_libblock(), and ntreeCopyTree().
struct ID* find_id | ( | const char * | type, |
const char * | name | ||
) | [read] |
Definition at line 947 of file library.c.
References BLI_findstring(), G, GS, and which_libbase().
Referenced by add_named_exec(), background_image_add_invoke(), drop_named_image_invoke(), drop_named_material_invoke(), node_add_file_exec(), object_select_mirror_exec(), sculpt_stroke_done(), sculpt_update_cache_invariants(), and set_scene_name().
void flag_all_listbases_ids | ( | short | flag, |
short | value | ||
) |
Definition at line 508 of file library.c.
References flag_listbase_ids(), G, MAX_LIBARRAY, and set_listbasepointers().
Referenced by bpy_lib_exit(), and wm_link_append_exec().
void flag_listbase_ids | ( | ListBase * | lb, |
short | flag, | ||
short | value | ||
) |
Definition at line 496 of file library.c.
References ListBase::first, MDeformVert::flag, ID::flag, and ID::next.
Referenced by flag_all_listbases_ids().
void free_libblock | ( | struct ListBase * | lb, |
void * | idv | ||
) |
Definition at line 792 of file library.c.
References animdata_dtar_clear_cb(), BKE_animdata_main_cb(), BLI_remlink(), BPY_id_release(), free_action(), free_armature(), free_brush(), free_camera(), free_curve(), free_gpencil_data(), free_group_objects(), free_image(), free_ipo(), free_key(), free_lamp(), free_lattice(), free_library(), free_material(), free_mball(), free_mesh(), free_movieclip(), free_object(), free_scene(), free_screen(), free_speaker(), free_text(), free_texture(), free_vfont(), free_windowmanager_cb, free_world(), G, GS, ID_AC, ID_AR, ID_BR, ID_CA, ID_CU, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LT, ID_MA, ID_MB, ID_MC, ID_ME, ID_NT, ID_OB, ID_PA, ID_SCE, ID_SCR, ID_SCRIPT, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_WM, ID_WO, IDP_FreeProperty(), MEM_freeN(), ID::name, ntreeFreeTree(), NULL, ID::properties, psys_free_settings(), and sound_free().
Referenced by BKE_image_merge(), DocumentImporter::create_camera_object(), DocumentImporter::create_lamp_object(), MeshImporter::create_mesh_object(), ED_screen_delete(), ED_screen_full_toggle(), free_libblock_us(), free_main(), id_unlink(), node_group_ungroup(), nurbs_to_mesh(), sound_new_file(), text_unlink_exec(), unlink_scene(), and wm_window_close().
void free_libblock_us | ( | struct ListBase * | lb, |
void * | idv | ||
) |
Definition at line 907 of file library.c.
References free_libblock(), GS, ID_OB, ID::lib, ID::name, Library::name, unlink_object(), and ID::us.
Referenced by ED_base_object_free_and_unlink(), ED_object_shape_key_remove(), and DocumentImporter::finish().
void free_main | ( | struct Main * | mainvar | ) |
Definition at line 925 of file library.c.
References ListBase::first, free_libblock(), MAX_LIBARRAY, MEM_freeN(), and set_listbasepointers().
Referenced by BKE_read_file(), BLO_blendfiledata_free(), clear_global(), ED_preview_free_dbase(), free_blender(), KX_BlenderSceneConverter::FreeBlendFile(), main(), render_endjob(), and KX_BlenderSceneConverter::~KX_BlenderSceneConverter().
Definition at line 1281 of file library.c.
References BKE_id_lib_local_paths(), GS, ID::lib, LIB_LOCAL, ID::name, new_id(), NULL, and which_libbase().
Referenced by BKE_library_make_local(), id_local_cb(), make_local_action(), make_local_armature(), make_local_brush(), make_local_camera(), make_local_curve(), make_local_image(), make_local_lamp(), make_local_lattice(), make_local_material(), make_local_mball(), make_local_mesh(), make_local_object(), make_local_particlesettings(), make_local_speaker(), make_local_texture(), make_local_world(), and ntreeMakeLocal().
Definition at line 277 of file library.c.
References copy_action(), copy_armature(), copy_brush(), copy_camera(), copy_curve(), copy_group(), copy_image(), copy_key(), copy_lamp(), copy_lattice(), copy_material(), copy_mball(), copy_mesh(), copy_object(), copy_speaker(), copy_text(), copy_texture(), copy_world(), GS, ID_AC, ID_AR, ID_BR, ID_CA, ID_CU, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LT, ID_MA, ID_MB, ID_ME, ID_NT, ID_OB, ID_PA, ID_SCE, ID_SCR, ID_SCRIPT, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_WM, ID_WO, ID::name, ntreeCopyTree(), NULL, and psys_copy_settings().
Referenced by id_single_user(), and template_ID().
void id_lib_extern | ( | struct ID * | id | ) |
Definition at line 149 of file library.c.
References ID::flag, LIB_EXTERN, and LIB_INDIRECT.
Referenced by armature_set_id_extern(), background_image_add_invoke(), con_extern_cb(), copy_attr(), copy_camera(), copy_material(), copy_mesh(), copy_object(), ED_uvedit_assign_image(), expand_local_mesh(), expand_local_particlesettings(), extern_local_brush(), extern_local_curve(), extern_local_matarar(), extern_local_material(), extern_local_object(), extern_local_texture(), group_instance_add_exec(), group_linkobs2scene_cb(), lib_indirect_test_id(), make_links_data_exec(), make_local_exec(), make_local_image(), object_copy_proxy_drivers(), object_make_proxy(), and test_obpoin_but().
int id_make_local | ( | struct ID * | id, |
int | test | ||
) |
Definition at line 182 of file library.c.
References ID::flag, GS, ID_AC, ID_AR, ID_BR, ID_CA, ID_CU, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LT, ID_MA, ID_MB, ID_ME, ID_NT, ID_OB, ID_PA, ID_SCE, ID_SCR, ID_SCRIPT, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_WM, ID_WO, LIB_INDIRECT, make_local_action(), make_local_armature(), make_local_brush(), make_local_camera(), make_local_curve(), make_local_image(), make_local_key(), make_local_lamp(), make_local_lattice(), make_local_material(), make_local_mball(), make_local_mesh(), make_local_object(), make_local_particlesettings(), make_local_speaker(), make_local_texture(), make_local_world(), and ID::name.
Referenced by id_local_cb(), make_local_exec(), make_local_makelocalmaterial(), template_ID(), and template_id_cb().
int id_single_user | ( | struct bContext * | C, |
struct ID * | id, | ||
struct PointerRNA * | ptr, | ||
struct PropertyRNA * | prop | ||
) |
Definition at line 400 of file library.c.
References BKE_copy_animdata_id_action(), id_copy(), NULL, RNA_id_pointer_create(), RNA_property_editable(), RNA_property_pointer_set(), RNA_property_update(), and ID::us.
Referenced by template_id_cb().
int id_unlink | ( | struct ID * | id, |
int | test | ||
) |
Definition at line 368 of file library.c.
References free_libblock(), G, GS, ID_GR, ID_OB, ID_TXT, ID::name, unlink_group(), unlink_object(), unlink_text(), ID::us, and which_libbase().
void id_us_min | ( | struct ID * | id | ) |
Definition at line 170 of file library.c.
References ID::flag, LIB_FAKEUSER, ID::name, and ID::us.
Referenced by add_mtex_id(), ANIM_fcurve_delete_from_animdata(), BKE_animdata_separate_by_basepath(), BKE_animdata_set_action(), BKE_copy_animdata_id_action(), BKE_nla_action_pushdown(), convert_tfacematerial(), convert_tfacenomaterial(), ED_view3D_background_image_remove(), free_actuator(), free_nlastrip(), free_paint(), gp_data_add_exec(), gp_data_unlink_exec(), id_fake_user_clear_cb(), localize_texture(), make_localact_apply_cb(), material_pop_id(), ntreeFreeTree(), paint_brush_set(), poselib_init_new(), poselib_unlink_exec(), set_current_brush_texture(), set_current_lamp_texture(), set_current_material_texture(), set_current_particle_texture(), set_current_world_texture(), solve_camera_freejob(), template_id_cb(), and unlink_world_cb().
void id_us_plus | ( | struct ID * | id | ) |
Definition at line 159 of file library.c.
References ID::flag, LIB_EXTERN, and LIB_INDIRECT.
Referenced by add_nlastrip(), assign_material(), assign_material_id(), background_image_add_invoke(), BKE_animdata_set_action(), BKE_copy_animdata(), BKE_copy_envmap(), BKE_image_verify_viewer(), BKE_nla_tweakmode_enter(), brush_clone_image_set_nr(), brush_texture_set_nr(), convert_exec(), copy_actuator(), copy_attr(), copy_brush(), copy_curve(), copy_lamp(), copy_material(), copy_mball(), copy_mesh(), copy_nlastrip(), copy_object(), copy_paint(), copy_particlesystem(), copy_scene(), copy_texture(), copy_world(), do_single_tex_user(), ED_node_composit_default(), ED_uvedit_assign_image(), id_fake_user_set_cb(), IDP_LinkID(), join_mesh_exec(), localize_lamp(), localize_world(), make_links_data_exec(), make_links_scene_exec(), make_localact_apply_cb(), material_append_id(), mesh_addmaterial(), new_id_matar(), node_add_node(), node_browse_text_cb(), node_duplicate_exec(), node_socket_add_replace(), ntreeCopyTree(), nurbs_to_mesh(), object_make_proxy(), paint_brush_set(), paste_matcopybuf(), paste_mtex_copybuf(), psys_copy_settings(), set_current_brush_texture(), set_current_lamp_texture(), set_current_material_texture(), set_current_particle_texture(), set_current_world_texture(), set_mesh(), solve_camera_freejob(), template_id_cb(), test_actionpoin_but(), test_matpoin_but(), test_meshpoin_but(), and test_scenepoin_but().
void IDnames_to_pupstring | ( | const char ** | str, |
const char * | title, | ||
const char * | extraops, | ||
struct ListBase * | lb, | ||
struct ID * | link, | ||
short * | nr | ||
) |
Definition at line 1036 of file library.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_get_len(), BLI_dynstr_new(), and IDnames_to_dyn_pupstring().
Referenced by draw_actuatorbuttons(), and node_shader_buts_dynamic().
void IMAnames_to_pupstring | ( | const char ** | str, |
const char * | title, | ||
const char * | extraops, | ||
struct ListBase * | lb, | ||
struct ID * | link, | ||
short * | nr | ||
) |
Definition at line 1058 of file library.c.
References BLI_dynstr_append(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_get_len(), BLI_dynstr_new(), IDnames_to_dyn_pupstring(), and IDPUP_NO_VIEWER.
void IPOnames_to_pupstring | ( | const char ** | str, |
const char * | title, | ||
const char * | extraops, | ||
struct ListBase * | lb, | ||
struct ID * | link, | ||
short * | nr, | ||
int | blocktype | ||
) |
void name_uiprefix_id | ( | char * | name, |
struct ID * | id | ||
) |
Definition at line 1491 of file library.c.
References LIB_FAKEUSER, and ID::name.
Referenced by id_search_cb(), and rna_search_cb().
Definition at line 1232 of file library.c.
References BLI_utf8_invalid_strip(), check_for_dupid(), G, GS, ID_FALLBACK_NAME, ID::lib, MAX_ID_NAME, ID::name, NULL, sort_alpha_id(), strlen(), and which_libbase().
Referenced by alloc_libblock(), automatname(), autotexname(), BKE_library_make_local(), id_clear_lib_data(), main(), make_local_key(), rename_id(), test_idbutton(), and versions_gpencil_add_main().
void recalc_all_library_objects | ( | struct Main * | main | ) |
Definition at line 516 of file library.c.
References ListBase::first, Object::id, ID::lib, ID::next, OB_RECALC_DATA, OB_RECALC_OB, OB_RECALC_TIME, Main::object, and Object::recalc.
Referenced by bpy_lib_exit(), and wm_link_append_exec().
void rename_id | ( | struct ID * | id, |
const char * | name | ||
) |
Definition at line 1481 of file library.c.
References BLI_strncpy(), G, GS, ID::name, new_id(), and which_libbase().
Referenced by MeshImporter::create_mesh_object(), createRepresentation(), curvesurf_prim_add(), effector_add_type(), give_base_to_groups(), gp_layer_to_curve(), group_instance_add_exec(), make_prim_ext(), make_proxy_exec(), object_lamp_add_exec(), texture_paint_image_from_view_exec(), and DocumentImporter::write_node().
void set_free_windowmanager_cb | ( | void(*)(struct bContext *, struct wmWindowManager *) | func | ) |
Referenced by WM_init().
Definition at line 527 of file library.c.
References Main::action, Main::armature, Main::brush, Main::camera, Main::curve, Main::gpencil, Main::group, Main::image, Main::ipo, Main::key, Main::lamp, Main::latt, Main::library, Main::mat, Main::mball, Main::mesh, Main::movieclip, Main::nodetree, NULL, Main::object, Main::particle, Main::scene, Main::screen, Main::script, Main::sound, Main::speaker, Main::tex, Main::text, Main::vfont, Main::wm, and Main::world.
Referenced by add_main_to_main(), BKE_library_make_local(), blo_add_library_pointer_map(), blo_split_main(), bpath_traverse_main(), clear_id_newpoins(), DAG_ids_check_recalc(), DAG_ids_clear_recalc(), DAG_ids_flush_tagged(), expand_main(), flag_all_listbases_ids(), free_main(), mainvar_count_libread_blocks(), read_libraries(), tag_main(), and write_libraries().
void tag_main | ( | struct Main * | mainvar, |
const short | tag | ||
) |
Definition at line 1375 of file library.c.
References MAX_LIBARRAY, set_listbasepointers(), and tag_main_lb().
Referenced by KX_BlenderSceneConverter::FreeBlendFile(), and KX_BlenderSceneConverter::KX_BlenderSceneConverter().
void tag_main_idcode | ( | struct Main * | mainvar, |
const short | type, | ||
const short | tag | ||
) |
Definition at line 1368 of file library.c.
References tag_main_lb(), and which_libbase().
void tag_main_lb | ( | struct ListBase * | lb, |
const short | tag | ||
) |
Definition at line 1353 of file library.c.
References ListBase::first, ID::flag, LIB_DOIT, and ID::next.
Referenced by tag_main(), and tag_main_idcode().
void test_idbutton | ( | char * | name | ) |
Definition at line 1443 of file library.c.
References BLI_findstring(), G, GS, new_id(), NULL, sort_alpha_id(), and which_libbase().
Referenced by namebutton_cb().
void text_idbutton | ( | struct ID * | id, |
char * | text | ||
) |
Definition at line 428 of file library.c.
References Main::action, Main::armature, Main::brush, Main::camera, Main::curve, Main::gpencil, Main::group, ID_AC, ID_AR, ID_BR, ID_CA, ID_CU, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LT, ID_MA, ID_MB, ID_MC, ID_ME, ID_NT, ID_OB, ID_PA, ID_SCE, ID_SCR, ID_SCRIPT, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_WM, ID_WO, Main::image, Main::ipo, Main::key, Main::lamp, Main::latt, Main::library, Main::mat, Main::mball, Main::mesh, Main::movieclip, Main::nodetree, NULL, Main::object, Main::particle, Main::scene, Main::screen, Main::script, Main::sound, Main::speaker, Main::tex, Main::text, Main::vfont, Main::wm, and Main::world.
Referenced by autocomplete_id(), copy_libblock(), filelist_from_main(), find_id(), id_clear_lib_data(), id_unlink(), is_yet_read(), new_id(), pastebuf_match_path_property(), read_libblock(), rename_id(), restore_pointer_by_name(), split_libdata(), tag_main_idcode(), test_idbutton(), and ui_template_id().