|
Blender V4.5
|
#include <cctype>#include <cerrno>#include <cfloat>#include <cstring>#include "CLG_log.h"#include "DNA_ID.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_windowmanager_types.h"#include "BLI_fileops.h"#include "BLI_map.hh"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLO_readfile.hh"#include "BKE_armature.hh"#include "BKE_blendfile.hh"#include "BKE_blendfile_link_append.hh"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_material.hh"#include "BKE_object.hh"#include "BKE_report.hh"#include "BKE_rigidbody.h"#include "BKE_scene.hh"#include "BKE_idtype.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_build.hh"#include "IMB_colormanagement.hh"#include "ED_datafiles.h"#include "ED_screen.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "wm_files.hh"Go to the source code of this file.
Variables | |
| static CLG_LogRef | LOG = {"wm.files_link"} |
Functions for dealing with append/link operators and helpers.
Definition in file wm_files_link.cc.
| ID * WM_file_append_datablock | ( | Main * | bmain, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| View3D * | v3d, | ||
| const char * | filepath, | ||
| short | id_code, | ||
| const char * | id_name, | ||
| int | flag ) |
Definition at line 763 of file wm_files_link.cc.
References BLI_assert, FILE_LINK, flag, id_name(), and wm_file_link_append_datablock_ex().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), WM_drag_asset_id_import(), and workspace_append_activate_exec().
|
static |
Definition at line 700 of file wm_files_link.cc.
References BKE_blendfile_append(), BKE_blendfile_link(), BKE_blendfile_link_append_context_embedded_blendfile_set(), BKE_blendfile_link_append_context_finalize(), BKE_blendfile_link_append_context_free(), BKE_blendfile_link_append_context_init_done(), BKE_blendfile_link_append_context_item_add(), BKE_blendfile_link_append_context_item_library_index_enable(), BKE_blendfile_link_append_context_item_newid_get(), BKE_blendfile_link_append_context_library_add(), BKE_blendfile_link_append_context_new(), BKE_blendfile_link_append_instantiate_loose(), BKE_main_id_tag_all(), BLO_library_link_params_init_with_context(), datatoc_startup_blend, datatoc_startup_blend_size, FILE_LINK, flag, id_name(), and ID_TAG_PRE_EXISTING.
Referenced by WM_file_append_datablock(), and WM_file_link_datablock().
| ID * WM_file_link_datablock | ( | Main * | bmain, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| View3D * | v3d, | ||
| const char * | filepath, | ||
| short | id_code, | ||
| const char * | id_name, | ||
| int | flag ) |
Definition at line 749 of file wm_files_link.cc.
References FILE_LINK, flag, id_name(), and wm_file_link_append_datablock_ex().
Referenced by blender::ed::asset::asset_local_id_ensure_imported(), and WM_drag_asset_id_import().
|
static |
Definition at line 519 of file wm_files_link.cc.
References BKE_blendfile_id_relocate(), BKE_blendfile_library_path_explode(), BKE_blendfile_link_append_context_embedded_blendfile_set(), BKE_blendfile_link_append_context_finalize(), BKE_blendfile_link_append_context_free(), BKE_blendfile_link_append_context_init_done(), BKE_blendfile_link_append_context_item_add(), BKE_blendfile_link_append_context_item_library_index_enable(), BKE_blendfile_link_append_context_library_add(), BKE_blendfile_link_append_context_new(), BKE_id_name(), BKE_idtype_idcode_from_name(), BKE_idtype_idcode_to_name(), BKE_libblock_find_session_uid(), BKE_main_blendfile_path(), BKE_main_id_tag_all(), BKE_reportf(), BKE_view_layer_base_deselect_all(), BLI_assert, BLI_path_cmp, BLI_path_join, BLO_LIBLINK_COLLECTION_INSTANCE, BLO_LIBLINK_OBDATA_INSTANCE, BLO_library_link_params_init_with_context(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), datatoc_startup_blend, datatoc_startup_blend_size, DEG_id_tag_update(), DEG_relations_tag_update(), FILE_LINK, FILE_MAX, FILE_MAX_LIBEXTRA, FILE_MAXDIR, flag, G, GS, Scene::id, ID_IS_LINKED, ID_TAG_PRE_EXISTING, ID::lib, ID::name, NC_WINDOW, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_int_get(), RNA_string_get(), RPT_ERROR, Library::runtime, STREQ, STRNCPY(), WM_event_add_notifier(), and wm_link_append_flag().
Referenced by WM_OT_id_linked_relocate().
| void WM_lib_reload | ( | Library * | lib, |
| bContext * | C, | ||
| ReportList * | reports ) |
Definition at line 813 of file wm_files_link.cc.
References BKE_blendfile_extension_check(), BKE_blendfile_library_relocate(), BKE_blendfile_link_append_context_free(), BKE_blendfile_link_append_context_library_add(), BKE_blendfile_link_append_context_new(), BKE_main_id_tag_all(), BKE_main_lib_objects_recalc_all(), BKE_reportf(), BLI_exists(), BLO_LIBLINK_FORCE_INDIRECT, BLO_LIBLINK_USE_PLACEHOLDERS, BLO_library_link_params_init_with_context(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), DEG_relations_tag_update(), ID_TAG_PRE_EXISTING, IMB_colormanagement_check_file_config(), lib, NC_WINDOW, reports, RPT_ERROR, and WM_event_add_notifier().
|
static |
Definition at line 1034 of file wm_files_link.cc.
References C, and wm_lib_relocate_exec_do().
Referenced by WM_OT_lib_reload().
|
static |
Definition at line 1003 of file wm_files_link.cc.
References C, and wm_lib_relocate_exec_do().
Referenced by WM_OT_lib_relocate().
|
static |
Definition at line 862 of file wm_files_link.cc.
References BKE_blendfile_extension_check(), BKE_blendfile_library_relocate(), BKE_blendfile_link_append_context_flag_set(), BKE_blendfile_link_append_context_free(), BKE_blendfile_link_append_context_library_add(), BKE_blendfile_link_append_context_new(), BKE_libblock_find_name(), BKE_main_blendfile_path(), BKE_main_id_tag_all(), BKE_main_lib_objects_recalc_all(), BKE_report(), BKE_reportf(), BLI_exists(), BLI_path_cmp, BLI_path_join, BLO_LIBLINK_FORCE_INDIRECT, BLO_LIBLINK_USE_PLACEHOLDERS, BLO_library_link_params_init_with_context(), C, CLOG_INFO, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), DEG_relations_tag_update(), FILE_MAX, FILE_MAXDIR, FILE_RELPATH, flag, G, ID_LI, ID_TAG_PRE_EXISTING, IMB_colormanagement_check_file_config(), lib, LOG, MAX_NAME, NC_WINDOW, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_BEGIN, RNA_boolean_get(), RNA_END, RNA_property_collection_length(), RNA_string_get(), RNA_struct_find_property(), RPT_ERROR, RPT_ERROR_INVALID_INPUT, STRNCPY(), and WM_event_add_notifier().
Referenced by wm_lib_reload_exec(), and wm_lib_relocate_exec().
|
static |
Definition at line 785 of file wm_files_link.cc.
References BKE_libblock_find_name(), BKE_reportf(), C, CTX_data_main(), ID_LI, lib, MAX_NAME, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RNA_string_set(), RPT_ERROR_INVALID_INPUT, and WM_event_add_fileselect().
Referenced by WM_OT_lib_relocate().
|
static |
Definition at line 198 of file wm_files_link.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_blendfile_append(), BKE_blendfile_library_path_explode(), BKE_blendfile_link(), BKE_blendfile_link_append_context_embedded_blendfile_set(), BKE_blendfile_link_append_context_finalize(), BKE_blendfile_link_append_context_free(), BKE_blendfile_link_append_context_init_done(), BKE_blendfile_link_append_context_is_empty(), BKE_blendfile_link_append_context_item_add(), BKE_blendfile_link_append_context_item_library_index_enable(), BKE_blendfile_link_append_context_library_add(), BKE_blendfile_link_append_context_new(), BKE_blendfile_link_append_instantiate_loose(), BKE_idtype_idcode_from_name(), BKE_main_blendfile_path(), BKE_main_id_tag_all(), BKE_main_lib_objects_recalc_all(), BKE_reportf(), BKE_view_layer_base_deselect_all(), BLI_path_cmp, BLI_path_join, BLO_LIBLINK_COLLECTION_INSTANCE, BLO_LIBLINK_OBDATA_INSTANCE, BLO_library_link_params_init_with_context(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), datatoc_startup_blend, datatoc_startup_blend_size, DEG_id_tag_update(), DEG_relations_tag_update(), FILE_LINK, FILE_MAX, FILE_MAX_LIBEXTRA, FILE_MAXDIR, flag, G, Scene::id, ID_TAG_PRE_EXISTING, IMB_colormanagement_check_file_config(), ID::lib, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), ID::name, NC_WINDOW, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_BEGIN, RNA_boolean_get(), RNA_END, RNA_property_collection_length(), RNA_string_get(), RNA_struct_find_property(), RPT_ERROR, RPT_WARNING, STRNCPY(), WM_event_add_notifier(), wm_link_append_flag(), and wm_link_append_item_poll().
Referenced by WM_OT_append(), and WM_OT_link().
|
static |
Definition at line 110 of file wm_files_link.cc.
References BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR, BLO_LIBLINK_APPEND_LOCAL_ID_REUSE, BLO_LIBLINK_APPEND_RECURSIVE, BLO_LIBLINK_APPEND_SET_FAKEUSER, BLO_LIBLINK_COLLECTION_INSTANCE, BLO_LIBLINK_OBDATA_INSTANCE, FILE_ACTIVE_COLLECTION, FILE_AUTOSELECT, FILE_LINK, FILE_RELPATH, flag, wmOperator::ptr, RNA_boolean_get(), RNA_property_boolean_get(), and RNA_struct_find_property().
Referenced by wm_id_linked_relocate_exec(), and wm_link_append_exec().
|
static |
Definition at line 90 of file wm_files_link.cc.
References BKE_main_blendfile_path_from_global(), BLI_path_split_dir_part(), C, FILE_MAX, G, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_string_set(), RNA_struct_property_is_set(), and WM_event_add_fileselect().
Referenced by WM_OT_append(), WM_OT_id_linked_relocate(), and WM_OT_link().
|
static |
Check if an item defined by name and group can be appended/linked.
| reports | Optionally report an error when an item can't be appended/linked. |
Definition at line 158 of file wm_files_link.cc.
References BKE_idtype_idcode_from_name(), BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_only_appendable(), BKE_reportf(), CLOG_WARN, LOG, reports, and RPT_ERROR_INVALID_INPUT.
Referenced by wm_link_append_exec().
|
static |
Definition at line 73 of file wm_files_link.cc.
References C, CTX_data_edit_object(), and WM_operator_winactive().
Referenced by WM_OT_append(), WM_OT_id_linked_relocate(), and WM_OT_link().
|
static |
Definition at line 400 of file wm_files_link.cc.
References ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), and RNA_def_property_flag().
Referenced by WM_OT_append(), WM_OT_id_linked_relocate(), and WM_OT_link().
| void WM_OT_append | ( | wmOperatorType * | ot | ) |
Definition at line 484 of file wm_files_link.cc.
References FILE_DEFAULTDISPLAY, FILE_LOADLIB, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_TYPE_BLENDER, FILE_TYPE_BLENDERLIB, FILE_TYPE_FOLDER, OPTYPE_UNDO, ot, RNA_def_boolean(), WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_FILES, WM_FILESEL_SHOW_PROPS, wm_link_append_exec(), wm_link_append_invoke(), wm_link_append_poll(), wm_link_append_properties_common(), and WM_operator_properties_filesel().
Referenced by wm_operatortypes_register().
| void WM_OT_id_linked_relocate | ( | wmOperatorType * | ot | ) |
Definition at line 655 of file wm_files_link.cc.
References FILE_DEFAULTDISPLAY, FILE_LOADLIB, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_TYPE_BLENDER, FILE_TYPE_BLENDERLIB, FILE_TYPE_FOLDER, MAIN_ID_SESSION_UID_UNSET, OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, PROP_HIDDEN, RNA_def_int(), RNA_def_property_flag(), WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_RELPATH, WM_FILESEL_SHOW_PROPS, wm_id_linked_relocate_exec(), wm_link_append_invoke(), wm_link_append_poll(), wm_link_append_properties_common(), and WM_operator_properties_filesel().
Referenced by wm_operatortypes_register().
| void WM_OT_lib_reload | ( | wmOperatorType * | ot | ) |
Definition at line 1039 of file wm_files_link.cc.
References FILE_BLENDER, FILE_DEFAULTDISPLAY, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_TYPE_BLENDER, FILE_TYPE_FOLDER, MAX_NAME, OPTYPE_UNDO, ot, PROP_HIDDEN, RNA_def_property_flag(), RNA_def_string(), WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_RELPATH, wm_lib_reload_exec(), and WM_operator_properties_filesel().
Referenced by wm_operatortypes_register().
| void WM_OT_lib_relocate | ( | wmOperatorType * | ot | ) |
Definition at line 1008 of file wm_files_link.cc.
References FILE_BLENDER, FILE_DEFAULTDISPLAY, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_TYPE_BLENDER, FILE_TYPE_FOLDER, MAX_NAME, OPTYPE_UNDO, ot, PROP_HIDDEN, RNA_def_property_flag(), RNA_def_string(), WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_FILES, WM_FILESEL_RELPATH, wm_lib_relocate_exec(), wm_lib_relocate_invoke(), and WM_operator_properties_filesel().
Referenced by wm_operatortypes_register().
| void WM_OT_link | ( | wmOperatorType * | ot | ) |
Definition at line 460 of file wm_files_link.cc.
References FILE_DEFAULTDISPLAY, FILE_LOADLIB, FILE_OPENFILE, FILE_SORT_DEFAULT, FILE_TYPE_BLENDER, FILE_TYPE_BLENDERLIB, FILE_TYPE_FOLDER, OPTYPE_UNDO, ot, WM_FILESEL_DIRECTORY, WM_FILESEL_FILENAME, WM_FILESEL_FILEPATH, WM_FILESEL_FILES, WM_FILESEL_RELPATH, WM_FILESEL_SHOW_PROPS, wm_link_append_exec(), wm_link_append_invoke(), wm_link_append_poll(), wm_link_append_properties_common(), and WM_operator_properties_filesel().
Referenced by wm_operatortypes_register().
|
static |
Definition at line 67 of file wm_files_link.cc.