2.5 - NLA SoC Branch Merged to 2.5!
authorJoshua Leung <aligorith@gmail.com>
Sat, 11 Jul 2009 05:41:21 +0000 (05:41 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 11 Jul 2009 05:41:21 +0000 (05:41 +0000)
(19863 to 21513)

Highlights of the new NLA System (and related Animation System changes):
* NLA Data is stored in AnimData alongside Action and Drivers. The NLA stack is evaluated before the Action, with the Action always overriding the results of the stack.
* NLA Data is arranged in 'Tracks', which act like PhotoShop layers. These can be muted, protected, and/or made to be played back by themselves
* Within each track, there can be multiple 'Strips'. There are 3 types of strip -> Action Clip (references some action), Transition (blends between the endpoints of two strips), and Meta (container for several strips that occur sequentially)
* FModifiers can be applied to strips, and strips can have animated influence/time controls. Playback for strips can also be backwards now!
* Playback can now go in forward and backwards directions.
* Animation Editors have been polished (unfinished features added, existing features cleaned up and made more consistent)

Notes for BuildSystem Maintainers:
* Only scons has been actively tested. Makefiles should work fine.
* MSVC ProjectFiles are broken due to the very way they work.
* CMake status unknown...

Other notes:
* Hopefully I haven't made any mistakes while doing the merge. More files than expected were showing some weird conflicts, so you may have some broken code...
* Not all old files (with NLA) data load exactly the same anymore. However, the bulk of the files out there should be ok (I hope)

1  2 
source/blender/editors/interface/view2d.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_view3d/space_view3d.c

index e0e2af5472d5ff5b653196162e3761ca2fa28af0,c3a0b2a2cdd558749e5f4e700cfa801887b96e2e..6df7b1c8e281b970ceaea43629741def1b1d3fee
@@@ -209,6 -209,23 +209,23 @@@ void UI_view2d_region_reinit(View2D *v2
                        }
                                break;
                                
+                       /* 'stack view' - practically the same as list/channel view, except is located in the pos y half instead. 
+                        *      zoom, aspect ratio, and alignment restrictions are set here */
+                       case V2D_COMMONVIEW_STACK:
+                       {
+                               /* zoom + aspect ratio are locked */
+                               v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+                               v2d->minzoom= v2d->maxzoom= 1.0f;
+                               
+                               /* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
+                               v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+                               v2d->keeptot = V2D_KEEPTOT_STRICT;
+                               tot_changed= 1;
+                               
+                               /* scroller settings are currently not set here... that is left for regions... */
+                       }
+                               break;
+                               
                        /* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */
                        case V2D_COMMONVIEW_HEADER:
                        {
                                
                                v2d->tot.xmin= 0.0f;
                                v2d->tot.xmax= winx;
+                               
                                v2d->tot.ymax= 0.0f;
                                v2d->tot.ymin= -winy;
+                               
                                v2d->cur.xmin= 0.0f;
                                v2d->cur.xmax= winx*style->panelzoom;
  
                                v2d->cur.ymax= 0.0f;
                                v2d->cur.ymin= -winy*style->panelzoom;
++
++                              v2d->cur.ymax= 0.0f;
++                              v2d->cur.ymin= -winy*style->panelzoom;
                        }
                                break;
+                               
                                /* other view types are completely defined using their own settings already */
                        default:
                                /* we don't do anything here, as settings should be fine, but just make sure that rect */
index ddf4105fdf440d24c35dbf35fd26d26fd76e0b87,f8f613223db2c3cb035bf81d09ff66fec91ca0b4..8b242794ca301cc48169e874b3ab2dcd2d074a23
@@@ -775,46 -775,6 +775,46 @@@ void graph_draw_ghost_curves (bAnimCont
        glDisable(GL_BLEND);
  }
  
 +/* check if any FModifiers to draw controls for  - fcm is 'active' modifier */
 +static short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm)
 +{
 +      /* don't draw if there aren't any modifiers at all */
 +      if (fcu->modifiers.first == NULL) 
 +              return 0;
 +      
 +      /* if there's an active modifier - don't draw if it doesn't drastically
 +       * alter the curve...
 +       */
 +      if (fcm) {
 +              switch (fcm->type) {
 +                      /* clearly harmless */
 +                      case FMODIFIER_TYPE_CYCLES:
 +                              return 0;
 +                              
 +                      /* borderline... */
 +                      case FMODIFIER_TYPE_NOISE:
 +                              return 0;
 +              }
 +      }
 +      
 +      /* if only one modifier - don't draw if it is muted or disabled */
 +      if (fcu->modifiers.first == fcu->modifiers.last) {
 +              fcm= fcu->modifiers.first;
 +              if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) 
 +                      return 0;
 +      }
 +      
 +      /* if only active modifier - don't draw if it is muted or disabled */
 +      if (fcm) {
 +              if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) 
 +                      return 0;
 +      }
 +      
 +      /* if we're still here, this means that there are modifiers with controls to be drawn */
 +      // FIXME: what happens if all the modifiers were muted/disabled
 +      return 1;
 +}
 +
  /* This is called twice from space_graph.c -> graph_main_area_draw()
   * Unselected then selected F-Curves are drawn so that they do not occlude each other.
   */
@@@ -835,12 -795,12 +835,12 @@@ void graph_draw_curves (bAnimContext *a
         */
        for (ale=anim_data.first; ale; ale=ale->next) {
                FCurve *fcu= (FCurve *)ale->key_data;
-               FModifier *fcm= fcurve_find_active_modifier(fcu);
-               //Object *nob= ANIM_nla_mapping_get(ac, ale);
+               FModifier *fcm= find_active_fmodifier(&fcu->modifiers);
+               AnimData *adt= ANIM_nla_mapping_get(ac, ale);
                
                /* map keyframes for drawing if scaled F-Curve */
-               //if (nob)
-               //      ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 0); 
+               if (adt)
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); 
                
                /* draw curve:
                 *      - curve line may be result of one or more destructive modifiers or just the raw data,
                }
                
                /* undo mapping of keyframes for drawing if scaled F-Curve */
-               //if (nob)
-               //      ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 0); 
+               if (adt)
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); 
        }
        
        /* free list of curves */
@@@ -1206,6 -1166,17 +1206,17 @@@ void graph_draw_channel_names(bAnimCont
                                                        expand = ICON_TRIA_RIGHT;
                                        }
                                        
+                                       /* for now, 'special' (i.e. in front of name) is used to show visibility status */
+                                       if (agrp->flag & AGRP_NOTVISIBLE)
+                                               special= ICON_CHECKBOX_DEHLT;
+                                       else
+                                               special= ICON_CHECKBOX_HLT;
+                                       
+                                       if (agrp->flag & AGRP_MUTED)
+                                               mute = ICON_MUTE_IPO_ON;
+                                       else    
+                                               mute = ICON_MUTE_IPO_OFF;
+                                       
                                        if (EDITABLE_AGRP(agrp))
                                                protect = ICON_UNLOCKED;
                                        else
index c93926c908e5a7604f0eb6cc87749b7b640ca241,6c3bb798c18663df57389617a844ff026f46a7dc..e52d28864390bd7d5b68a3192b7351a682ca90b5
@@@ -409,6 -409,15 +409,15 @@@ static void view3d_main_area_listener(A
  {
        /* context changes */
        switch(wmn->category) {
+               case NC_ANIMATION:
+                       switch(wmn->data) {
+                               case ND_KEYFRAME_EDIT:
+                               case ND_KEYFRAME_PROP:
+                               case ND_NLA_ACTCHANGE:
+                               case ND_ANIMCHAN_SELECT:
+                                       ED_region_tag_redraw(ar);
+                                       break;
+                       }
                case NC_SCENE:
                        switch(wmn->data) {
                                case ND_TRANSFORM:
                                case ND_GEOM_DATA:
                                case ND_DRAW:
                                case ND_MODIFIER:
 +                              case ND_CONSTRAINT:
                                case ND_KEYS:
                                case ND_PARTICLE:
                                        ED_region_tag_redraw(ar);