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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-07-31 12:38:10 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-07-31 12:39:22 +0300
commit1fd27c2332a2d74d16cc8f339dd68fe1d06874a7 (patch)
tree4354ce818798ab1b56713a65275f1f2b87c24589 /source/blender/blenkernel/intern/armature.c
parent75f1fb6d86225c9b764f3909e83accc07685b009 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c6
1 files changed, 3 insertions, 3 deletions
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... */