101 if (
G.lib[0] !=
'\0') {
104 else if (blendfile_path[0] !=
'\0') {
164 const bool do_append)
168 if (!group || !name) {
181 "Can't append data-block '%s' of type '%s'",
188 "Can't link data-block '%s' of type '%s'",
246 const bool do_append = (flag &
FILE_LINK) == 0;
252 "Scene '%s' is linked, instantiation of objects is disabled",
393 ot->
srna,
"link", is_link,
"Link",
"Link the objects or data-blocks rather than appending");
401 "Try to re-use previously matching appended data-blocks instead of appending a new copy");
411 "Put new objects on the active collection");
416 "instance_collections",
418 "Instance Collections",
419 "Create instances for collections, rather than adding them directly to the scene");
424 "instance_object_data",
426 "Instance Object Data",
427 "Create instances for object data which are not referenced by any objects");
481 "Set \"Fake User\" for appended items (except objects and collections)");
487 "Localize all appended data, including those indirectly linked from other libraries");
501 const char *filepath,
506 const bool do_append = (flag &
FILE_LINK) == 0;
544 const char *filepath,
551 bmain,
scene, view_layer, v3d, filepath, id_code,
id_name, flag);
558 const char *filepath,
565 bmain,
scene, view_layer, v3d, filepath, id_code,
id_name, flag);
588 "Cannot relocate indirectly linked library '%s'",
612 "Trying to reload library '%s' from invalid path '%s'",
670 if (
lib->parent && !do_reload) {
673 "Cannot relocate indirectly linked library '%s'",
691 "Trying to reload or relocate library '%s' to invalid path '%s'",
700 "Cannot relocate library '%s' to current blend file '%s'",
711 CLOG_INFO(&
LOG, 4,
"We are supposed to reload '%s' lib (%d)",
lib->filepath,
lib->id.us);
722 &
LOG, 4,
"We are supposed to relocate '%s' lib to new '%s' one",
lib->filepath, libname);
748 CLOG_INFO(&
LOG, 4,
"\tCandidate new lib to reload datablocks from: %s", path);
754 CLOG_INFO(&
LOG, 4,
"\tCandidate new lib to reload datablocks from: %s", path);
799 ot->
name =
"Relocate Library";
801 ot->
description =
"Relocate the given library to one or several others";
830 ot->
name =
"Reload Library";
bool BKE_blendfile_link_append_context_is_empty(struct BlendfileLinkAppendContext *lapp_context)
void BKE_blendfile_link_append_context_embedded_blendfile_set(struct BlendfileLinkAppendContext *lapp_context, const void *blendfile_mem, int blendfile_memsize)
void BKE_blendfile_link_append_context_item_library_index_enable(struct BlendfileLinkAppendContext *lapp_context, struct BlendfileLinkAppendContextItem *item, int library_index)
struct ID * BKE_blendfile_link_append_context_item_newid_get(struct BlendfileLinkAppendContext *lapp_context, struct BlendfileLinkAppendContextItem *item)
struct BlendfileLinkAppendContextItem * BKE_blendfile_link_append_context_item_add(struct BlendfileLinkAppendContext *lapp_context, const char *idname, short idcode, void *userdata)
void BKE_blendfile_link(struct BlendfileLinkAppendContext *lapp_context, struct ReportList *reports)
void BKE_blendfile_link_append_context_library_add(struct BlendfileLinkAppendContext *lapp_context, const char *libname, struct BlendHandle *blo_handle)
void BKE_blendfile_library_relocate(struct BlendfileLinkAppendContext *lapp_context, struct ReportList *reports, struct Library *library, bool do_reload)
void BKE_blendfile_link_append_context_free(struct BlendfileLinkAppendContext *lapp_context)
void BKE_blendfile_link_append_context_flag_set(struct BlendfileLinkAppendContext *lapp_context, int flag, bool do_set)
BlendfileLinkAppendContext * BKE_blendfile_link_append_context_new(struct LibraryLink_Params *params)
void BKE_blendfile_append(struct BlendfileLinkAppendContext *lapp_context, struct ReportList *reports)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
bool BKE_idtype_idcode_is_linkable(short idcode)
short BKE_idtype_idcode_from_name(const char *idtype_name)
bool BKE_idtype_idcode_is_only_appendable(short idcode)
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer)
void BKE_main_id_tag_all(struct Main *mainvar, int tag, bool value)
void BKE_main_lib_objects_recalc_all(struct Main *bmain)
struct ID * BKE_libblock_find_name(struct Main *bmain, short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global(void)
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
API for Blender-side Rigid Body stuff.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_ghashutil_strcmp(const void *a, const void *b)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
bool BLI_path_parent_dir(char *path) ATTR_NONNULL()
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
#define STRNCPY(dst, src)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
external readfile function prototypes.
@ BLO_LIBLINK_APPEND_RECURSIVE
@ BLO_LIBLINK_USE_PLACEHOLDERS
@ BLO_LIBLINK_OBDATA_INSTANCE
@ BLO_LIBLINK_APPEND_SET_FAKEUSER
@ BLO_LIBLINK_FORCE_INDIRECT
@ BLO_LIBLINK_APPEND_LOCAL_ID_REUSE
@ BLO_LIBLINK_COLLECTION_INSTANCE
void BLO_library_link_params_init_with_context(struct LibraryLink_Params *params, struct Main *bmain, int flag, int id_tag_extra, struct Scene *scene, struct ViewLayer *view_layer, const struct View3D *v3d)
bool BLO_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name)
bool BLO_has_bfile_extension(const char *str)
#define CLOG_WARN(clg_ref,...)
#define CLOG_INFO(clg_ref, level,...)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
ID and Library types, which are fundamental for sdna.
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define FILE_MAX_LIBEXTRA
@ RPT_ERROR_INVALID_INPUT
int datatoc_startup_blend_size
const char datatoc_startup_blend[]
void IMB_colormanagement_check_file_config(struct Main *bmain)
Read Guarded memory(de)allocation.
#define RNA_BEGIN(sptr, itemptr, propname)
std::string id_name(void *id)
void(* MEM_freeN)(void *vmemh)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ID * WM_file_link_datablock(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, int flag)
static int wm_lib_relocate_exec(bContext *C, wmOperator *op)
void WM_lib_reload(Library *lib, bContext *C, ReportList *reports)
static bool wm_link_append_poll(bContext *C)
static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static bool wm_link_append_item_poll(ReportList *reports, const char *path, const char *group, const char *name, const bool do_append)
static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
static int wm_link_append_flag(wmOperator *op)
static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int wm_link_append_exec(bContext *C, wmOperator *op)
void WM_OT_lib_relocate(wmOperatorType *ot)
static ID * wm_file_link_append_datablock_ex(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, const int flag)
ID * WM_file_append_datablock(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, int flag)
static void wm_link_append_properties_common(wmOperatorType *ot, bool is_link)
void WM_OT_append(wmOperatorType *ot)
static int wm_lib_reload_exec(bContext *C, wmOperator *op)
void WM_OT_lib_reload(wmOperatorType *ot)
void WM_OT_link(wmOperatorType *ot)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
bool WM_operator_winactive(bContext *C)