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-08-05 19:50:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-08-05 19:50:01 +0300
commit53c56b2b5fdc4fbb53a36e0856edf2c742f0848f (patch)
treed7ef424798ac0d85d4b4920d11f58f9d9c51f3b8 /source/blender/blenkernel/intern/library.c
parent75e34b9002f5137695b8b9b685114d4ef866bb5d (diff)
Fix T54915: Usercount of active action increases when editing things with COW enabled.
Just pass along the 'no user refcount' flag to animdata copy function.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 8922cd75618..75444ca3b2f 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1407,13 +1407,13 @@ void *BKE_id_new_nomain(const short type, const char *name)
/* by spec, animdata is first item after ID */
/* and, trust that BKE_animdata_from_id() will only find AnimData for valid ID-types */
-static void id_copy_animdata(Main *bmain, ID *id, const bool do_action)
+static void id_copy_animdata(Main *bmain, ID *id, const bool do_action, const bool do_id_user)
{
AnimData *adt = BKE_animdata_from_id(id);
if (adt) {
IdAdtTemplate *iat = (IdAdtTemplate *)id;
- iat->adt = BKE_animdata_copy(bmain, iat->adt, do_action, true); /* could be set to false, need to investigate */
+ iat->adt = BKE_animdata_copy(bmain, iat->adt, do_action, do_id_user);
}
}
@@ -1470,7 +1470,9 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int fla
/* the duplicate should get a copy of the animdata */
if ((flag & LIB_ID_COPY_NO_ANIMDATA) == 0) {
BLI_assert((flag & LIB_ID_COPY_ACTIONS) == 0 || (flag & LIB_ID_CREATE_NO_MAIN) == 0);
- id_copy_animdata(bmain, new_id, (flag & LIB_ID_COPY_ACTIONS) != 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0);
+ id_copy_animdata(bmain, new_id,
+ (flag & LIB_ID_COPY_ACTIONS) != 0 && (flag & LIB_ID_CREATE_NO_MAIN) == 0,
+ (flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0);
}
else if (id_can_have_animdata(new_id)) {
IdAdtTemplate *iat = (IdAdtTemplate *)new_id;