Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-31 17:21:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-31 17:21:47 +0300
commiteb1feb9f4a62e3caca4b72964c9fdd8187df53e5 (patch)
tree2c6b18ee72db4a386bf68425cc40620f9d49c48f /source/blender/blenkernel/intern
parent0b396bc15bd4433bfe9b8c6ffbc87d312d2426c1 (diff)
parent16100f8261770e367b0892bb38c778699ed609fe (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/editors/object/object_add.c source/blender/editors/object/object_select.c source/blender/editors/space_outliner/outliner_edit.c
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/bpath.c2
-rw-r--r--source/blender/blenkernel/intern/library.c15
-rw-r--r--source/blender/blenkernel/intern/scene.c2
3 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index dbaf3f2ee9e..1fd2797d2f8 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -643,7 +643,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
/* keep packedfile paths always relative to the blend */
if (lib->packedfile == NULL) {
if (rewrite_path_fixed(lib->name, visit_cb, absbase, bpath_user_data)) {
- BKE_library_filepath_set(lib, lib->name);
+ BKE_library_filepath_set(bmain, lib, lib->name);
}
}
break;
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 3926d2055f0..917b318899c 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1738,17 +1738,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)
{
@@ -2078,7 +2073,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).
@@ -2510,7 +2505,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 */
@@ -2529,8 +2524,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);
}
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 5de352b3f47..62585c2421b 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -942,7 +942,7 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
/* called from creator_args.c */
Scene *BKE_scene_set_name(Main *bmain, const char *name)
{
- Scene *sce = (Scene *)BKE_libblock_find_name_ex(bmain, ID_SCE, name);
+ Scene *sce = (Scene *)BKE_libblock_find_name(bmain, ID_SCE, name);
if (sce) {
BKE_scene_set_background(bmain, sce);
printf("Scene switch for render: '%s' in file: '%s'\n", name, bmain->name);