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-14 15:23:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-14 15:25:13 +0300
commiteabfd031fa055dc064c751b4cd2cb6a783a24cfd (patch)
tree0a1708e5cb6bdfa207b2989c7606a5844ab1eb3f /source/blender/blenkernel/intern/library.c
parent63c23971717d8a578e737c26796b92479c160f23 (diff)
Fix T55031: add explicit copy flag to force deep-copying shapekey datablock with 'parent' one.
Chose to change defaut behavior (0-flag one) here, for sake of consistency. Default behavior of simple BKE_id_copy() remains unchanged though.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index a2bd8eeea95..883f0342159 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -691,7 +691,7 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag, con
*/
bool id_copy(Main *bmain, const ID *id, ID **newid, bool test)
{
- return BKE_id_copy_ex(bmain, id, newid, 0, test);
+ return BKE_id_copy_ex(bmain, id, newid, LIB_ID_COPY_SHAPEKEY, test);
}
/** Does a mere memory swap over the whole IDs data (including type-specific memory).
@@ -1427,6 +1427,8 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int fla
BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || bmain != NULL);
BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || (flag & LIB_ID_CREATE_NO_ALLOCATE) == 0);
BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) == 0 || (flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0);
+ /* Never implicitely copy shapekeys when generating temp data outside of Main database. */
+ BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) == 0 || (flag & LIB_ID_COPY_SHAPEKEY) == 0);
if ((flag & LIB_ID_CREATE_NO_ALLOCATE) != 0) {
/* r_newid already contains pointer to allocated memory. */