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>2009-01-17 06:12:50 +0300
committerJoshua Leung <aligorith@gmail.com>2009-01-17 06:12:50 +0300
commit44e5b7788bcbe55400bf0d91eed0752ed865b644 (patch)
tree7b69e89ff7f93127d5691f528c5dc9bb85835ee1 /source/blender/editors/armature
parent9bcdb4b758d96d1fe5345858f6c61a90f7c57eac (diff)
2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future. Highlights of the new system: * Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. - F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. - The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc. * F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated. * Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place) * F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place) * NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details: http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html So, what currently works: * I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code. * Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock. * Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc. Notes: * Drivers haven't been hooked up yet * Only objects and data directly linked to objects can be animated. * Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change). * Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor) * I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review. In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c45
-rw-r--r--source/blender/editors/armature/poselib.c15
-rw-r--r--source/blender/editors/armature/poseobject.c8
3 files changed, 43 insertions, 25 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 5548700b2e1..5a751236e6e 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -99,8 +99,6 @@ static void error_libdata() {}
static void BIF_undo_push() {}
static void adduplicate() {}
static void countall() {}
-static void deselect_actionchannels() {}
-static void select_actionchannel_by_name() {}
/* ************* XXX *************** */
/* **************** tools on Editmode Armature **************** */
@@ -599,7 +597,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann
/* action constraint? */
if (con->type == CONSTRAINT_TYPE_ACTION) {
- bActionConstraint *data= con->data;
+ bActionConstraint *data= con->data; // XXX old animation system
bAction *act;
bActionChannel *achan;
@@ -1330,7 +1328,8 @@ static void selectconnected_posebonechildren (Object *ob, Bone *bone)
if (!(bone->flag & BONE_CONNECTED))
return;
- select_actionchannel_by_name (ob->action, bone->name, !(shift));
+ // XXX old cruft! use notifiers instead
+ //select_actionchannel_by_name (ob->action, bone->name, !(shift));
if (shift)
bone->flag &= ~BONE_SELECTED;
@@ -1359,7 +1358,8 @@ void selectconnected_posearmature(bContext *C)
/* Select parents */
for (curBone=bone; curBone; curBone=next){
- select_actionchannel_by_name (ob->action, curBone->name, !(shift));
+ // XXX old cruft! use notifiers instead
+ //select_actionchannel_by_name (ob->action, curBone->name, !(shift));
if (shift)
curBone->flag &= ~BONE_SELECTED;
else
@@ -3568,7 +3568,9 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
if (!(extend) || (base != scene->basact)) {
ED_pose_deselectall(ob, 0, 0);
nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 1);
+
+ // XXX old cruft! use notifiers instead
+ //select_actionchannel_by_name(ob->action, nearBone->name, 1);
}
else {
if (nearBone->flag & BONE_SELECTED) {
@@ -3579,14 +3581,18 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
}
else {
nearBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 0);
+
+ // XXX old cruft! use notifiers instead
+ //select_actionchannel_by_name(ob->action, nearBone->name, 0);
}
}
else {
bone_looper(ob, arm->bonebase.first, NULL, clear_active_flag);
nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 1);
+
+ // XXX old cruft! use notifiers instead
+ //select_actionchannel_by_name(ob->action, nearBone->name, 1);
}
}
@@ -3647,16 +3653,6 @@ void ED_pose_deselectall (Object *ob, int test, int doundo)
}
}
- /* action editor */
- if (test == 3) {
- deselect_actionchannels(ob->action, 2); /* inverts selection */
- }
- else {
- deselect_actionchannels(ob->action, 0); /* deselects for sure */
- if (selectmode == 1)
- deselect_actionchannels(ob->action, 1); /* swaps */
- }
-
countall();
if (doundo) {
@@ -4187,7 +4183,6 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldnam
void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
{
bArmature *arm= ob->data;
- Ipo *ipo;
char newname[MAXBONENAME];
char oldname[MAXBONENAME];
@@ -4225,11 +4220,12 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
/* we have the object using the armature */
if (arm==ob->data) {
Object *cob;
- bAction *act;
- bActionChannel *achan;
- bActionStrip *strip;
+ //bAction *act;
+ //bActionChannel *achan;
+ //bActionStrip *strip;
/* Rename action channel if necessary */
+#if 0 // XXX old animation system
act = ob->action;
if (act && !act->id.lib) {
/* Find the appropriate channel */
@@ -4237,6 +4233,7 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
if (achan)
BLI_strncpy(achan->name, newname, MAXBONENAME);
}
+#endif // XXX old animation system
/* Rename the pose channel, if it exists */
if (ob->pose) {
@@ -4246,6 +4243,7 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
}
/* check all nla-strips too */
+#if 0 // XXX old animation system
for (strip= ob->nlastrips.first; strip; strip= strip->next) {
/* Rename action channel if necessary */
act = strip->act;
@@ -4256,6 +4254,7 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
BLI_strncpy(achan->name, newname, MAXBONENAME);
}
}
+#endif // XXX old animation system
/* Update any object constraints to use the new bone name */
for (cob= G.main->object.first; cob; cob= cob->id.next) {
@@ -4290,6 +4289,7 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
}
/* do entire db - ipo's for the drivers */
+#if 0 // XXX old animation system
for (ipo= G.main->ipo.first; ipo; ipo= ipo->id.next) {
IpoCurve *icu;
@@ -4310,6 +4310,7 @@ void armature_bone_rename(Object *ob, char *oldnamep, char *newnamep)
}
}
}
+#endif // XXX old animation system
}
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index c6ac1adb446..ffbc787f01c 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -82,8 +82,8 @@ static int extern_qread_ext() {return 0;}
static void persptoetsen() {}
static void headerprint() {}
-static void remake_action_ipos() {}
-static void verify_pchan2achan_grouping() {}
+static void remake_action_ipos() {} // xxx depreceated
+//static void verify_pchan2achan_grouping() {} // xxx depreceated
static void action_set_activemarker() {}
/* ******* XXX ********** */
@@ -276,6 +276,7 @@ void poselib_validate_act (bAction *act)
/* This function adds an ipo-curve of the right type where it's needed */
static IpoCurve *poselib_verify_icu (Ipo *ipo, int adrcode)
{
+#if 0 // XXX old animation system
IpoCurve *icu;
for (icu= ipo->curve.first; icu; icu= icu->next) {
@@ -296,6 +297,8 @@ static IpoCurve *poselib_verify_icu (Ipo *ipo, int adrcode)
}
return icu;
+#endif // XXX old animation system
+ return NULL;
}
/* This tool adds the current pose to the poselib
@@ -385,6 +388,7 @@ void poselib_add_current_pose (Scene *scene, Object *ob, int val)
/* check if available */
if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
if (pchan->bone->flag & (BONE_SELECTED|BONE_ACTIVE)) {
+#if 0 // XXX old animation system
/* make action-channel if needed (action groups are also created) */
achan= verify_action_channel(act, pchan->name);
verify_pchan2achan_grouping(act, pose, pchan->name);
@@ -409,6 +413,7 @@ void poselib_add_current_pose (Scene *scene, Object *ob, int val)
INSERT_KEY_ICU(AC_QUAT_X, pchan->quat[1])
INSERT_KEY_ICU(AC_QUAT_Y, pchan->quat[2])
INSERT_KEY_ICU(AC_QUAT_Z, pchan->quat[3])
+#endif // XXX old animation system
}
}
}
@@ -456,6 +461,7 @@ void poselib_remove_pose (Object *ob, TimeMarker *marker)
}
/* remove relevant keyframes */
+#if 0 // XXX old animation system
for (achan= act->chanbase.first; achan; achan= achan->next) {
Ipo *ipo= achan->ipo;
IpoCurve *icu;
@@ -472,6 +478,7 @@ void poselib_remove_pose (Object *ob, TimeMarker *marker)
}
}
}
+#endif // XXX old animation system
/* remove poselib from list */
BLI_freelinkN(&act->markers, marker);
@@ -687,10 +694,12 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld)
ok= 1;
if (ok) {
+#if 0 // XXX old animation system
/* Evaluates and sets the internal ipo values */
calc_ipo(achan->ipo, (float)frame);
/* This call also sets the pchan flags */
execute_action_ipo(achan, pchan);
+#endif // XXX old animation system
}
}
}
@@ -719,6 +728,7 @@ static void poselib_keytag_pose (Scene *scene, tPoseLib_PreviewData *pld)
pchan= get_pose_channel(pose, achan->name);
if (pchan) {
+#if 0 // XXX old animation system
// TODO: use a standard autokeying function in future (to allow autokeying-editkeys to work)
if (IS_AUTOKEY_MODE(NORMAL)) {
ID *id= &pld->ob->id;
@@ -750,6 +760,7 @@ static void poselib_keytag_pose (Scene *scene, tPoseLib_PreviewData *pld)
if (pchan->bone)
pchan->bone->flag |= BONE_UNKEYED;
}
+#endif // XXX old animation system
}
}
}
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 08a670b9582..80b67ac70ac 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -36,6 +36,7 @@
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
+#include "DNA_anim_types.h"
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
@@ -57,11 +58,11 @@
#include "BKE_deform.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
+#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#include "BKE_ipo.h"
#include "BIF_transform.h" /* for autokey TFM_TRANSLATION, etc */
#include "BIF_gl.h"
@@ -851,6 +852,7 @@ void paste_posebuf (Scene *scene, int flip)
EulToQuat(eul, pchan->quat);
}
+#if 0 // XXX old animation system
if (autokeyframe_cfra_can_key(ob)) {
ID *id= &ob->id;
@@ -881,6 +883,7 @@ void paste_posebuf (Scene *scene, int flip)
if (chan->bone)
chan->bone->flag |= BONE_UNKEYED;
}
+#endif // XXX old animation system
}
}
}
@@ -1513,6 +1516,7 @@ void pose_relax(Scene *scene)
if (pchan->bone->layer & arm->layer) {
if (pchan->bone->flag & BONE_SELECTED) {
/* do we have an ipo curve? */
+#if 0 // XXX old animation system
achan= get_action_channel(act, pchan->name);
if (achan && achan->ipo) {
@@ -1563,6 +1567,8 @@ void pose_relax(Scene *scene)
/* apply BONE_TRANSFORM tag so that autokeying will pick it up */
pchan->bone->flag |= BONE_TRANSFORM;
}
+
+#endif // XXX old animation system
}
}
}