From 1fd27c2332a2d74d16cc8f339dd68fe1d06874a7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 31 Jul 2018 11:38:10 +0200 Subject: Respect ID user count when creating pose on object copy This solves wrong user counter of custom shape when duplicating bone few times and then undoing all the duplications. --- source/blender/blenkernel/intern/armature.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/armature.c') diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 6be4574a62e..cea81a82f4b 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1960,7 +1960,7 @@ void BKE_pose_remap_bone_pointers(bArmature *armature, bPose *pose) * * \param bmain May be NULL, only used to tag depsgraph as being dirty... */ -void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm) +void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, const bool do_id_user) { Bone *bone; bPose *pose; @@ -1989,7 +1989,7 @@ void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm) for (pchan = pose->chanbase.first; pchan; pchan = next) { next = pchan->next; if (pchan->bone == NULL) { - BKE_pose_channel_free(pchan); + BKE_pose_channel_free_ex(pchan, do_id_user); BKE_pose_channels_hash_free(pose); BLI_freelinkN(&pose->chanbase, pchan); } @@ -2291,7 +2291,7 @@ void BKE_pose_where_is(struct Depsgraph *depsgraph, Scene *scene, Object *ob) return; if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC)) { /* WARNING! passing NULL bmain here means we won't tag depsgraph's as dirty - hopefully this is OK. */ - BKE_pose_rebuild(NULL, ob, arm); + BKE_pose_rebuild(NULL, ob, arm, true); } ctime = BKE_scene_frame_get(scene); /* not accurate... */ -- cgit v1.2.3