diff options
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 9e89ae77caa..a95cc7d1816 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -382,12 +382,12 @@ bPoseChannel *get_pose_channel(const bPose *pose, const char *name) if (ELEM(NULL, pose, name) || (name[0] == 0)) return NULL; - return BLI_findstring(&pose->chanbase, name, offsetof(bPoseChannel, name)); + return BLI_findstring(&((bPose *)pose)->chanbase, name, offsetof(bPoseChannel, name)); } /* Use with care, not on Armature poses but for temporal ones */ /* (currently used for action constraints and in rebuild_pose) */ -bPoseChannel *verify_pose_channel(bPose* pose, const char* name) +bPoseChannel *verify_pose_channel(bPose *pose, const char *name) { bPoseChannel *chan; @@ -455,10 +455,10 @@ const char *get_ikparam_name(bPose *pose) void copy_pose (bPose **dst, bPose *src, int copycon) { bPose *outPose; - bPoseChannel *pchan; + bPoseChannel *pchan; ListBase listb; - if (!src){ + if (!src) { *dst=NULL; return; } @@ -482,7 +482,8 @@ void copy_pose (bPose **dst, bPose *src, int copycon) if (copycon) { copy_constraints(&listb, &pchan->constraints); // copy_constraints NULLs listb pchan->constraints= listb; - pchan->path= NULL; + pchan->path= NULL; // XXX remove this line when the new motionpaths are ready... (depreceated code) + pchan->mpath= NULL; /* motion paths should not get copied yet... */ } if(pchan->prop) { @@ -491,7 +492,7 @@ void copy_pose (bPose **dst, bPose *src, int copycon) } /* for now, duplicate Bone Groups too when doing this */ - if(copycon) + if (copycon) BLI_duplicatelist(&outPose->agroups, &src->agroups); *dst=outPose; @@ -532,12 +533,20 @@ void init_pose_ikparam(bPose *pose) void free_pose_channel(bPoseChannel *pchan) { - if (pchan->path) + // XXX this case here will need to be removed when the new motionpaths are ready + if (pchan->path) { MEM_freeN(pchan->path); - + pchan->path= NULL; + } + + if (pchan->mpath) { + animviz_free_motionpath(pchan->mpath); + pchan->mpath= NULL; + } + free_constraints(&pchan->constraints); - - if(pchan->prop) { + + if (pchan->prop) { IDP_FreeProperty(pchan->prop); MEM_freeN(pchan->prop); } @@ -550,7 +559,7 @@ void free_pose_channels(bPose *pose) if (pose->chanbase.first) { for (pchan = pose->chanbase.first; pchan; pchan=pchan->next) free_pose_channel(pchan); - + BLI_freelistN(&pose->chanbase); } } @@ -564,14 +573,14 @@ void free_pose(bPose *pose) /* free pose-groups */ if (pose->agroups.first) BLI_freelistN(&pose->agroups); - + /* free IK solver state */ BIK_clear_data(pose); - + /* free IK solver param */ if (pose->ikparam) MEM_freeN(pose->ikparam); - + /* free pose */ MEM_freeN(pose); } |