diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-11 21:26:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-11 21:48:18 +0300 |
commit | 9520fc0ff72cb510a0991889dcbbd2010c97c16e (patch) | |
tree | 7f9819eedb6227f8485eff25269c8062efe558ba /source/blender/blenkernel/intern/action.c | |
parent | 691471fe22be17e9ad24ca4da71aeedea640f05c (diff) |
Pose: optimize pose rebuild for copy-on-write.
Ref T55442.
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 01f6eab261f..28534fc9783 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -426,7 +426,7 @@ bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name) return NULL; /* See if this channel exists */ - chan = BLI_findstring(&pose->chanbase, name, offsetof(bPoseChannel, name)); + chan = BKE_pose_channel_find_name(pose, name); if (chan) { return chan; } @@ -454,7 +454,9 @@ bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name) chan->protectflag = OB_LOCK_ROT4D; /* lock by components by default */ BLI_addtail(&pose->chanbase, chan); - BKE_pose_channels_hash_free(pose); + if (pose->chanhash) { + BLI_ghash_insert(pose->chanhash, chan->name, chan); + } return chan; } |