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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-30 10:15:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-30 10:15:35 +0400
commit4afc0e80a7af094946640b2ec03d8f9eac4042ba (patch)
tree2c0b699ad1d454c9d6c80c5131c6359877659055 /source
parent3612a8d3d4605cac1988d58b8af561e69f4130ab (diff)
fix [#29462] libraries.load can't have link=False when relative=True
was doing an unnecessary (and incorrect) library lookup.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/intern/bpy_library.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c
index d7c7a1e846f..a6426a02e18 100644
--- a/source/blender/python/intern/bpy_library.c
+++ b/source/blender/python/intern/bpy_library.c
@@ -265,8 +265,8 @@ static PyObject *bpy_lib_enter(BPy_Library *self, PyObject *UNUSED(args))
/* create a dummy */
self_from= PyObject_New(BPy_Library, &bpy_lib_Type);
- BLI_strncpy(self_from->relpath, self->relpath, sizeof(BPy_Library));
- BLI_strncpy(self_from->abspath, self->abspath, sizeof(BPy_Library));
+ BLI_strncpy(self_from->relpath, self->relpath, sizeof(self_from->relpath));
+ BLI_strncpy(self_from->abspath, self->abspath, sizeof(self_from->abspath));
self_from->blo_handle= NULL;
self_from->flag= 0;
@@ -396,6 +396,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
return NULL;
}
else {
+ Library *lib= mainl->curlib; /* newly added lib, assign before append end */
BLO_library_append_end(NULL, mainl, &(self->blo_handle), 0, self->flag);
BLO_blendhandle_close(self->blo_handle);
self->blo_handle= NULL;
@@ -406,9 +407,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
/* append, rather than linking */
if ((self->flag & FILE_LINK)==0) {
- Library *lib= BLI_findstring(&G.main->library, self->abspath, offsetof(Library, name));
- if (lib) BKE_library_make_local(bmain, lib, 1);
- else BLI_assert(!"cant find name of just added library!");
+ BKE_library_make_local(bmain, lib, 1);
}
}