diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:04:04 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:04:04 +0300 |
commit | 16100f8261770e367b0892bb38c778699ed609fe (patch) | |
tree | 97232730f4680cd689cfa086c5434761c7dd33c7 /source/blender/blenkernel/intern/library.c | |
parent | b53d358261a26652d510d62565f1b43035a55e67 (diff) |
Cleanup: get rid of last G.main usages in BKE library code.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index ff4780f0605..70ee3cbe5f3 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1594,17 +1594,12 @@ void BKE_main_thumbnail_create(struct Main *bmain) } /* ***************** ID ************************ */ -ID *BKE_libblock_find_name_ex(struct Main *bmain, const short type, const char *name) +ID *BKE_libblock_find_name(struct Main *bmain, const short type, const char *name) { ListBase *lb = which_libbase(bmain, type); BLI_assert(lb != NULL); return BLI_findstring(lb, name, offsetof(ID, name) + 2); } -ID *BKE_libblock_find_name(const short type, const char *name) -{ - return BKE_libblock_find_name_ex(G.main, type, name); -} - void id_sort_by_name(ListBase *lb, ID *id) { @@ -1934,7 +1929,7 @@ static void library_make_local_copying_check(ID *id, GSet *loop_tags, MainIDRela /** Make linked datablocks local. * - * \param bmain Almost certainly G.main. + * \param bmain Almost certainly global main. * \param lib If not NULL, only make local datablocks from this library. * \param untagged_only If true, only make local datablocks not tagged with LIB_TAG_PRE_EXISTING. * \param set_fake If true, set fake user on all localized datablocks (except group and objects ones). @@ -2366,7 +2361,7 @@ void BKE_id_ui_prefix(char name[MAX_ID_NAME + 1], const ID *id) strcpy(name + 3, id->name + 2); } -void BKE_library_filepath_set(Library *lib, const char *filepath) +void BKE_library_filepath_set(Main *bmain, Library *lib, const char *filepath) { /* in some cases this is used to update the absolute path from the * relative */ @@ -2385,8 +2380,8 @@ void BKE_library_filepath_set(Library *lib, const char *filepath) * since making local could cause this to be directly linked - campbell */ /* Never make paths relative to parent lib - reading code (blenloader) always set *all* lib->name relative to - * current G.main, not to their parent for indirectly linked ones. */ - const char *basepath = G.main->name; + * current main, not to their parent for indirectly linked ones. */ + const char *basepath = bmain->name; BLI_path_abs(lib->filepath, basepath); } } |