diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-01-17 06:12:50 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-01-17 06:12:50 +0300 |
commit | 44e5b7788bcbe55400bf0d91eed0752ed865b644 (patch) | |
tree | 7b69e89ff7f93127d5691f528c5dc9bb85835ee1 /source/blender/editors/space_view3d | |
parent | 9bcdb4b758d96d1fe5345858f6c61a90f7c57eac (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/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 38 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 46 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 2 |
3 files changed, 46 insertions, 40 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 9fa045830ab..16372791736 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -64,7 +64,6 @@ #include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_object.h" -#include "BKE_ipo.h" #include "BKE_utildefines.h" #include "BIF_gl.h" @@ -1742,7 +1741,7 @@ static void draw_pose_channels(Scene *scene, View3D *v3d, Base *base, int dt) /* extra draw service for pose mode */ constflag= pchan->constflag; - if (pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) + if (pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) // XXX this is useless crap constflag |= PCHAN_HAS_ACTION; if (pchan->flag & POSE_STRIDE) constflag |= PCHAN_HAS_STRIDE; @@ -2025,7 +2024,7 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, Object *ob) { bArmature *arm= ob->data; bPoseChannel *pchan; - bAction *act; + bAction *act; // XXX old animsys - watch it! bActionChannel *achan; ActKeyColumn *ak; ListBase keys; @@ -2173,12 +2172,15 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, Object *ob) if (arm->pathflag & ARM_PATH_KFRAS) { /* build list of all keyframes in active action for pchan */ keys.first = keys.last = NULL; + + #if 0 // XXX old animation system act= ob->action; if (act) { achan= get_action_channel(act, pchan->name); if (achan) ipo_to_keylist(achan->ipo, &keys, NULL, NULL); } + #endif // XXX old animation system /* Draw slightly-larger yellow dots at each keyframe */ UI_ThemeColor(TH_VERTEX_SELECT); @@ -2294,7 +2296,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, Base *base) colfac = (end-CFRA)/range; UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac))); - do_all_pose_actions(scene, ob); + //do_all_pose_actions(scene, ob); // XXX old animation system where_is_pose(scene, ob); draw_pose_channels(scene, v3d, base, OB_WIRE); } @@ -2319,14 +2321,14 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, Base *base) static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, Base *base) { Object *ob= base->object; - bAction *act= ob->action; + bAction *act= ob->action; // XXX old animsys stuff... watch it! bArmature *arm= ob->data; bPose *posen, *poseo; ListBase keys= {NULL, NULL}; ActKeysInc aki = {0, 0, 0}; ActKeyColumn *ak, *akn; float start, end, range, colfac, i; - int cfrao, flago, ipoflago; + int cfrao, flago; aki.start= start = arm->ghostsf; aki.end= end = arm->ghostef; @@ -2351,7 +2353,6 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, Base *base) cfrao= CFRA; flago= arm->flag; arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); - ipoflago= ob->ipoflag; ob->ipoflag |= OB_DISABLE_PATH; /* copy the pose */ @@ -2371,7 +2372,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, Base *base) CFRA= (int)ak->cfra; - do_all_pose_actions(scene, ob); + //do_all_pose_actions(scene, ob); // XXX old animation system where_is_pose(scene, ob); draw_pose_channels(scene, v3d, base, OB_WIRE); } @@ -2388,7 +2389,6 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, Base *base) arm->flag= flago; armature_rebuild_pose(ob, ob->data); ob->flag |= OB_POSEMODE; - ob->ipoflag= ipoflago; } /* draw ghosts around current frame @@ -2399,13 +2399,13 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) Object *ob= base->object; bArmature *arm= ob->data; bPose *posen, *poseo; - bActionStrip *strip; + //bActionStrip *strip; float cur, start, end, stepsize, range, colfac, actframe, ctime; - int cfrao, maptime, flago, ipoflago; + int cfrao, maptime, flago; /* pre conditions, get an action with sufficient frames */ - if (ob->action==NULL) - return; + //if (ob->action==NULL) + // return; calc_action_range(ob->action, &start, &end, 0); if (start == end) @@ -2414,12 +2414,15 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) stepsize= (float)(arm->ghostsize); range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */ +#if 0 // XXX old animation system /* we only map time for armature when an active strip exists */ for (strip=ob->nlastrips.first; strip; strip=strip->next) if (strip->flag & ACTSTRIP_ACTIVE) break; +#endif // XXX old animsys - maptime= (strip!=NULL); + //maptime= (strip!=NULL); + maptime= 0; /* store values */ ob->flag &= ~OB_POSEMODE; @@ -2428,8 +2431,6 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) else actframe= CFRA; flago= arm->flag; arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); - ipoflago= ob->ipoflag; - ob->ipoflag |= OB_DISABLE_PATH; /* copy the pose */ poseo= ob->pose; @@ -2453,7 +2454,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) else CFRA= (int)floor(actframe+ctime); if (CFRA!=cfrao) { - do_all_pose_actions(scene, ob); + //do_all_pose_actions(scene, ob); // xxx old animation system crap where_is_pose(scene, ob); draw_pose_channels(scene, v3d, base, OB_WIRE); } @@ -2469,7 +2470,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) else CFRA= (int)floor(actframe-ctime); if (CFRA != cfrao) { - do_all_pose_actions(scene, ob); + //do_all_pose_actions(scene, ob); // XXX old animation system crap... where_is_pose(scene, ob); draw_pose_channels(scene, v3d, base, OB_WIRE); } @@ -2487,7 +2488,6 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, Base *base) arm->flag= flago; armature_rebuild_pose(ob, ob->data); ob->flag |= OB_POSEMODE; - ob->ipoflag= ipoflago; } /* ********************************** Armature Drawing - Main ************************* */ diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 8282e021dad..7a01e1ada7a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -46,7 +46,6 @@ #include "DNA_curve_types.h" #include "DNA_constraint_types.h" // for drawing constraint #include "DNA_effect_types.h" -#include "DNA_ipo_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" @@ -82,7 +81,6 @@ #include "BKE_font.h" #include "BKE_global.h" #include "BKE_image.h" -#include "BKE_ipo.h" #include "BKE_key.h" #include "BKE_lattice.h" #include "BKE_mesh.h" @@ -3040,7 +3038,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, Base *base, Part pa_time=(cfra-pa->time)/pa->lifetime; pa_size=pa->size; - if((part->flag&PART_ABS_TIME)==0){ + if((part->flag&PART_ABS_TIME)==0){ +#if 0 // XXX old animation system if(ma && ma->ipo){ IpoCurve *icu; @@ -3067,6 +3066,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, Base *base, Part pa_size = icu->curval; } } +#endif // XXX old animation system } r_tilt=1.0f+pa->r_ave[0]; @@ -3083,6 +3083,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, Base *base, Part if((part->flag&PART_ABS_TIME)==0) { if(ma && ma->ipo){ +#if 0 // XXX old animation system IpoCurve *icu; /* correction for lifetime */ @@ -3096,6 +3097,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, Base *base, Part else if(icu->adrcode == MA_COL_B) ma_b = icu->curval; } +#endif // XXX old animation system } } @@ -4009,6 +4011,7 @@ static void draw_empty_cone (float size) /* draw points on curve speed handles */ static void curve_draw_speed(Scene *scene, Object *ob) { +#if 0 // XXX old animation system stuff Curve *cu= ob->data; IpoCurve *icu; BezTriple *bezt; @@ -4034,6 +4037,7 @@ static void curve_draw_speed(Scene *scene, Object *ob) glPointSize(1.0); bglEnd(); +#endif // XXX old animation system stuff } @@ -4267,9 +4271,9 @@ static void draw_forcefield(Scene *scene, Object *ob) Mat4One(tmat); UI_ThemeColorBlend(curcol, TH_BACK, 0.5); - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); - else + //if (has_ipo_code(ob->ipo, OB_PD_FSTR)) + // force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); + //else force_val = pd->f_strength; force_val*= 0.1; drawcircball(GL_LINE_LOOP, vec, size, tmat); @@ -4285,9 +4289,9 @@ static void draw_forcefield(Scene *scene, Object *ob) else if (pd->forcefield == PFIELD_FORCE) { float ffall_val; - if (has_ipo_code(ob->ipo, OB_PD_FFALL)) - ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); - else + //if (has_ipo_code(ob->ipo, OB_PD_FFALL)) + // ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); + //else ffall_val = pd->f_power; UI_ThemeColorBlend(curcol, TH_BACK, 0.5); @@ -4301,14 +4305,14 @@ static void draw_forcefield(Scene *scene, Object *ob) float ffall_val, force_val; Mat4One(tmat); - if (has_ipo_code(ob->ipo, OB_PD_FFALL)) - ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); - else + //if (has_ipo_code(ob->ipo, OB_PD_FFALL)) + // ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, scene->r.cfra); + //else ffall_val = pd->f_power; - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); - else + //if (has_ipo_code(ob->ipo, OB_PD_FSTR)) + // force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); + //else force_val = pd->f_strength; UI_ThemeColorBlend(curcol, TH_BACK, 0.7); @@ -4326,9 +4330,9 @@ static void draw_forcefield(Scene *scene, Object *ob) if((cu->flag & CU_PATH) && cu->path && cu->path->data) { float mindist, guidevec1[4], guidevec2[3]; - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - mindist = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); - else + //if (has_ipo_code(ob->ipo, OB_PD_FSTR)) + // mindist = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, scene->r.cfra); + //else mindist = pd->f_strength; /*path end*/ @@ -4697,10 +4701,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) static int warning_recursive= 0; Object *ob; Curve *cu; - float cfraont; + //float cfraont; float vec1[3], vec2[3]; unsigned int col=0; - int sel, drawtype, colindex= 0, ipoflag; + int /*sel, drawtype,*/ colindex= 0; int i, selstart, selend, empty_object=0; short dt, dtx, zbufoff= 0; @@ -4728,6 +4732,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* draw keys? */ +#if 0 // XXX old animation system if(base==(scene->basact) || (base->flag & (SELECT+BA_WAS_SEL))) { if(flag==0 && warning_recursive==0 && ob!=scene->obedit) { if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { @@ -4800,6 +4805,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } } } +#endif // XXX old animation system /* patch? children objects with a timeoffs change the parents. How to solve! */ /* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d85be9406d7..618d30eea60 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -802,7 +802,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d) } /* colour depends on whether there is a keyframe */ - if (id_frame_has_keyframe((ID *)ob, frame_to_float(scene, CFRA), v3d->keyflags)) + if (id_frame_has_keyframe((ID *)ob, /*frame_to_float(scene, CFRA)*/(float)(CFRA), v3d->keyflags)) UI_ThemeColor(TH_VERTEX_SELECT); else UI_ThemeColor(TH_TEXT_HI); |