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:
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 610237abcdd..b4c1d681ddc 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -319,7 +319,7 @@ int id_copy(ID *id, ID **newid, int test)
if (!test) *newid = (ID *)BKE_texture_copy((Tex *)id);
return 1;
case ID_IM:
- if (!test) *newid = (ID *)BKE_image_copy((Image *)id);
+ if (!test) *newid = (ID *)BKE_image_copy(G.main, (Image *)id);
return 1;
case ID_LT:
if (!test) *newid = (ID *)BKE_lattice_copy((Lattice *)id);
@@ -766,13 +766,13 @@ void BKE_libblock_copy_data(ID *id, const ID *id_from, const short do_action)
}
/* used everywhere in blenkernel */
-void *BKE_libblock_copy(ID *id)
+void *BKE_libblock_copy_ex(Main *bmain, ID *id)
{
ID *idn;
ListBase *lb;
size_t idn_len;
- lb = which_libbase(G.main, GS(id->name));
+ lb = which_libbase(bmain, GS(id->name));
idn = BKE_libblock_alloc(lb, GS(id->name), id->name + 2);
assert(idn != NULL);
@@ -793,6 +793,11 @@ void *BKE_libblock_copy(ID *id)
return idn;
}
+void *BKE_libblock_copy(ID *id)
+{
+ return BKE_libblock_copy_ex(G.main, id);
+}
+
static void BKE_library_free(Library *lib)
{
if (lib->packedfile)