diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index ddc4533f228..c6e3dda3f7a 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -580,7 +580,7 @@ static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *UN char lib_name[MAX_NAME]; RNA_string_get(op->ptr, "library", lib_name); - lib = (Library *)BKE_libblock_find_name_ex(CTX_data_main(C), ID_LI, lib_name); + lib = (Library *)BKE_libblock_find_name(CTX_data_main(C), ID_LI, lib_name); if (lib) { if (lib->parent) { @@ -822,7 +822,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) char lib_name[MAX_NAME]; RNA_string_get(op->ptr, "library", lib_name); - lib = (Library *)BKE_libblock_find_name_ex(CTX_data_main(C), ID_LI, lib_name); + lib = (Library *)BKE_libblock_find_name(CTX_data_main(C), ID_LI, lib_name); if (lib) { Main *bmain = CTX_data_main(C); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ed731cf5f32..7d0fcbdcaf6 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1408,6 +1408,7 @@ void WM_operator_last_properties_ensure(wmOperatorType *ot, PointerRNA *ptr) */ ID *WM_operator_drop_load_path(struct bContext *C, wmOperator *op, const short idcode) { + Main *bmain = CTX_data_main(C); ID *id = NULL; /* check input variables */ if (RNA_struct_property_is_set(op->ptr, "filepath")) { @@ -1435,8 +1436,6 @@ ID *WM_operator_drop_load_path(struct bContext *C, wmOperator *op, const short i if (is_relative_path ) { if (exists == false) { - Main *bmain = CTX_data_main(C); - if (idcode == ID_IM) { BLI_path_rel(((Image *)id)->name, bmain->name); } @@ -1449,7 +1448,7 @@ ID *WM_operator_drop_load_path(struct bContext *C, wmOperator *op, const short i else if (RNA_struct_property_is_set(op->ptr, "name")) { char name[MAX_ID_NAME - 2]; RNA_string_get(op->ptr, "name", name); - id = BKE_libblock_find_name(idcode, name); + id = BKE_libblock_find_name(bmain, idcode, name); if (!id) { BKE_reportf(op->reports, RPT_ERROR, "%s '%s' not found", BKE_idcode_to_name(idcode), name); diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 0ea933a852b..508713c9096 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -186,7 +186,7 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre Main *bmain = CTX_data_main(C); /* Currently only brush data-blocks supported. */ - struct Brush *brush = (struct Brush *)BKE_libblock_find_name(ID_BR, tref_rt->data_block); + struct Brush *brush = (struct Brush *)BKE_libblock_find_name(bmain, ID_BR, tref_rt->data_block); if (brush) { wmWindowManager *wm = bmain->wm.first; |