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:
authorJoshua Leung <aligorith@gmail.com>2010-01-01 15:24:16 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-01 15:24:16 +0300
commite6f26957ea56c7cfdaecd26e192a2ccbd1f6c97a (patch)
treebfe8aee1f6b75a64fe070feecda9ee5cc2f4eb62 /source/blender/blenkernel/intern/action.c
parent0b673d45e535fc59546631d2ffe602bd68aaba56 (diff)
Cleanup of MotionPaths+Ghosts (AnimViz) - Part 1
This commit sets up some of the groundwork necessary to extend the animation visualisation capabilities, previously only available for bones in PoseMode, to Objects as well. Also, some of the other goals of this refactor is to make future visualisation goodies (i.e. editable paths) more feasible... (There's really nothing to see here yet. The following log notes are really just for my own reference to keep track of things.) Currently, the following things have been done: * New datastructures + settings have been tidied up, ready for usage * Added these new types into the Object and PoseBone code as necessary, with freeing/adding/copying accounted for * File IO code for the new data, including version patching to convert the old system to the new one. * Set up the drawing system for motionpaths based on the old armature path drawing code. Armatures still draw using the old system, since the two systems use different storage systems. * Started setting up the motionpath 'baking' code, but the core of this still needs to be coded... Next Steps (after some semi-urgent Durian Driver changes): * Port the ghosting/onionskinning code over too * Finish motionpath baking code * RNA wrapping for the new types * Hooking up all the new code into the operators, etc.
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c37
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);
}