diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-18 15:17:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-18 15:19:15 +0400 |
commit | 2b0162b6226df9dcb9b6819ce93f2d434afc69c4 (patch) | |
tree | 77e5637bd19f115df5fa4850dc2a3c39fe3f7135 /source/blender | |
parent | ea79dcebe2303b0b58a0791cd8b531ecc45a2394 (diff) |
Fix T37289: ID User decrement error for Shapes on Bones when playing in BGE
GE was copying the pose channels without increasing user counter for a
custom bone shape object. Freeing copied pose will for give decrement
errors.
The same increment issue seems to happen in BKE_pose_copy_data, which
is also solved now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index fe0e3da605f..c91fae2adbc 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -589,7 +589,15 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, const bool copy_constraints) outPose = MEM_callocN(sizeof(bPose), "pose"); BLI_duplicatelist(&outPose->chanbase, &src->chanbase); - + if (outPose->chanbase.first) { + bPoseChannel *pchan; + for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) { + if (pchan->custom) { + id_us_plus(&pchan->custom->id); + } + } + } + outPose->iksolver = src->iksolver; outPose->ikdata = NULL; outPose->ikparam = MEM_dupallocN(src->ikparam); |