NLA SoC: Merge from 2.5
authorJoshua Leung <aligorith@gmail.com>
Mon, 22 Jun 2009 04:39:35 +0000 (04:39 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 22 Jun 2009 04:39:35 +0000 (04:39 +0000)
21043 to 21072

(NOTE TO SELF: Campbell made a commit in 2.5 before this merge finished)

1  2 
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_space.c

index 0bed2c095e2121154fdf2439c235b6b0ef289688,419f0f5beeba5f3b35e07a561ce0614d024fc9f8..f6c305b202de29c671c8b94bc0994a7f822b10e0
  
  #define IS_EQT(a, b, c) ((a > b)? (((a-b) <= c)? 1:0) : ((((b-a) <= c)? 1:0)))
  #define IN_RANGE(a, b, c) ((b < c)? ((b<a && a<c)? 1:0) : ((c<a && a<b)? 1:0))
 +#define IN_RANGE_INCL(a, b, c) ((b < c)? ((b<=a && a<=c)? 1:0) : ((c<=a && a<=b)? 1:0))
  
  /* this weirdo pops up in two places ... */
- #if !defined(WIN32) && !defined(__BeOS)
+ #if !defined(WIN32)
  #ifndef O_BINARY
  #define O_BINARY 0
  #endif
  #define ID_NEW(a)             if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
  
  #define FORM MAKE_ID('F','O','R','M')
- #define DDG1 MAKE_ID('3','D','G','1')
- #define DDG2 MAKE_ID('3','D','G','2')
- #define DDG3 MAKE_ID('3','D','G','3')
- #define DDG4 MAKE_ID('3','D','G','4')
- #define GOUR MAKE_ID('G','O','U','R')
  
  #define BLEN MAKE_ID('B','L','E','N')
  #define DER_ MAKE_ID('D','E','R','_')
index 74226cabba612114067bf89c35608ba19358887a,48aa3f6a3b7585fb2293a7b3afd75a81bb1a5e42..af4f61fccc4b52a0187b197e7897d3890526869e
@@@ -1667,26 -1667,10 +1667,26 @@@ static void lib_link_constraint_channel
  
  /* Data Linking ----------------------------- */
  
 +static void lib_link_fmodifiers(FileData *fd, ID *id, ListBase *list)
 +{
 +      FModifier *fcm;
 +      
 +      for (fcm= list->first; fcm; fcm= fcm->next) {
 +              /* data for specific modifiers */
 +              switch (fcm->type) {
 +                      case FMODIFIER_TYPE_PYTHON:
 +                      {
 +                              FMod_Python *data= (FMod_Python *)fcm->data;
 +                              data->script = newlibadr(fd, id->lib, data->script);
 +                      }
 +                              break;
 +              }
 +      }
 +}
 +
  static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list) 
  {
        FCurve *fcu;
 -      FModifier *fcm;
        
        /* relink ID-block references... */
        for (fcu= list->first; fcu; fcu= fcu->next) {
                }
                
                /* modifiers */
 -              for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) {
 -                      /* data for specific modifiers */
 -                      switch (fcm->type) {
 -                              case FMODIFIER_TYPE_PYTHON:
 -                              {
 -                                      FMod_Python *data= (FMod_Python *)fcm->data;
 -                                      data->script = newlibadr(fd, id->lib, data->script);
 -                              }
 -                                      break;
 +              lib_link_fmodifiers(fd, id, &fcu->modifiers);
 +      }
 +}
 +
 +
 +/* NOTE: this assumes that link_list has already been called on the list */
 +static void direct_link_fmodifiers(FileData *fd, ListBase *list)
 +{
 +      FModifier *fcm;
 +      
 +      for (fcm= list->first; fcm; fcm= fcm->next) {
 +              /* relink general data */
 +              fcm->data = newdataadr(fd, fcm->data);
 +              fcm->edata= NULL;
 +              
 +              /* do relinking of data for specific types */
 +              switch (fcm->type) {
 +                      case FMODIFIER_TYPE_GENERATOR:
 +                      {
 +                              FMod_Generator *data= (FMod_Generator *)fcm->data;
 +                              
 +                              data->coefficients= newdataadr(fd, data->coefficients);
 +                      }
 +                              break;
 +                      case FMODIFIER_TYPE_ENVELOPE:
 +                      {
 +                              FMod_Envelope *data= (FMod_Envelope *)fcm->data;
 +                              
 +                              data->data= newdataadr(fd, data->data);
                        }
 +                              break;
 +                      case FMODIFIER_TYPE_PYTHON:
 +                      {
 +                              FMod_Python *data= (FMod_Python *)fcm->data;
 +                              
 +                              data->prop = newdataadr(fd, data->prop);
 +                              IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
 +                      }
 +                              break;
                }
        }
  }
  static void direct_link_fcurves(FileData *fd, ListBase *list)
  {
        FCurve *fcu;
 -      FModifier *fcm;
        
        /* link F-Curve data to F-Curve again (non ID-libs) */
        for (fcu= list->first; fcu; fcu= fcu->next) {
                
                /* modifiers */
                link_list(fd, &fcu->modifiers);
 -              for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) {
 -                      /* relink general data */
 -                      fcm->data = newdataadr(fd, fcm->data);
 -                      fcm->edata= NULL;
 -                      
 -                      /* do relinking of data for specific types */
 -                      switch (fcm->type) {
 -                              case FMODIFIER_TYPE_GENERATOR:
 -                              {
 -                                      FMod_Generator *data= (FMod_Generator *)fcm->data;
 -                                      
 -                                      data->coefficients= newdataadr(fd, data->coefficients);
 -                              }
 -                                      break;
 -                              case FMODIFIER_TYPE_ENVELOPE:
 -                              {
 -                                      FMod_Envelope *data= (FMod_Envelope *)fcm->data;
 -                                      
 -                                      data->data= newdataadr(fd, data->data);
 -                              }
 -                                      break;
 -                              case FMODIFIER_TYPE_PYTHON:
 -                              {
 -                                      FMod_Python *data= (FMod_Python *)fcm->data;
 -                                      
 -                                      data->prop = newdataadr(fd, data->prop);
 -                                      IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
 -                              }
 -                                      break;
 -                      }
 -              }
 +              direct_link_fmodifiers(fd, &fcu->modifiers);
        }
  }
  
@@@ -1826,44 -1812,6 +1826,44 @@@ static void direct_link_action(FileDat
        }
  }
  
 +
 +static void lib_link_nladata (FileData *fd, ID *id, ListBase *list)
 +{
 +      NlaTrack *nlt;
 +      NlaStrip *strip;
 +      
 +      /* we only acare about the NLA strips inside the tracks */
 +      for (nlt= list->first; nlt; nlt= nlt->next) {
 +              for (strip= nlt->strips.first; strip; strip= strip->next) {
 +                      /* reassign the counted-reference to action */
 +                      strip->act = newlibadr_us(fd, id->lib, strip->act);
 +              }
 +      }
 +}
 +
 +/* NOTE: this assumes that link_list has already been called on the list */
 +static void direct_link_nladata(FileData *fd, ListBase *list)
 +{
 +      NlaTrack *nlt;
 +      NlaStrip *strip;
 +      
 +      for (nlt= list->first; nlt; nlt= nlt->next) {
 +              /* relink list of strips */
 +              link_list(fd, &nlt->strips);
 +              
 +              /* relink strip data */
 +              for (strip= nlt->strips.first; strip; strip= strip->next) {
 +                      /* strip's F-Curves */
 +                      link_list(fd, &strip->fcurves);
 +                      direct_link_fcurves(fd, &strip->fcurves);
 +                      
 +                      /* strip's F-Modifiers */
 +                      link_list(fd, &strip->modifiers);
 +                      direct_link_fcurves(fd, &strip->modifiers);
 +              }
 +      }
 +}
 +
  /* ------- */
  
  static void lib_link_keyingsets(FileData *fd, ID *id, ListBase *list)
@@@ -1906,7 -1854,6 +1906,7 @@@ static void lib_link_animdata(FileData 
        
        /* link action data */
        adt->action= newlibadr_us(fd, id->lib, adt->action);
 +      adt->tmpact= newlibadr_us(fd, id->lib, adt->tmpact);
        
        /* link drivers */
        lib_link_fcurves(fd, id, &adt->drivers);
        /* overrides don't have lib-link for now, so no need to do anything */
        
        /* link NLA-data */
 -      // TODO... 
 +      lib_link_nladata(fd, id, &adt->nla_tracks);
  }
  
  static void direct_link_animdata(FileData *fd, AnimData *adt)
        // TODO...
        
        /* link NLA-data */
 -      // TODO...
 +      link_list(fd, &adt->nla_tracks);
 +      direct_link_nladata(fd, &adt->nla_tracks);
  }     
  
  /* ************ READ NODE TREE *************** */
@@@ -2932,6 -2878,16 +2932,16 @@@ static void direct_link_material(FileDa
  
  static void direct_link_pointcache(FileData *fd, PointCache *cache)
  {
+       if((cache->flag & PTCACHE_DISK_CACHE)==0) {
+               PTCacheMem *pm;
+               link_list(fd, &cache->mem_cache);
+               pm = cache->mem_cache.first;
+               for(; pm; pm=pm->next)
+                       pm->data = newdataadr(fd, pm->data);
+       }
        cache->flag &= ~(PTCACHE_SIMULATION_VALID|PTCACHE_BAKE_EDIT_ACTIVE);
        cache->simframe= 0;
  }
@@@ -3196,10 -3152,8 +3206,8 @@@ static void direct_link_mesh(FileData *
                direct_link_dverts(fd, lvl->totvert, CustomData_get(&mesh->mr->vdata, 0, CD_MDEFORMVERT));
                direct_link_customdata(fd, &mesh->mr->fdata, lvl->totface);
                
-               if(!mesh->mr->edge_flags)
-                       mesh->mr->edge_flags= MEM_callocN(sizeof(short)*lvl->totedge, "Multires Edge Flags");
-               if(!mesh->mr->edge_creases)
-                       mesh->mr->edge_creases= MEM_callocN(sizeof(char)*lvl->totedge, "Multires Edge Creases");
+               mesh->mr->edge_flags= newdataadr(fd, mesh->mr->edge_flags);
+               mesh->mr->edge_creases= newdataadr(fd, mesh->mr->edge_creases);
  
                mesh->mr->verts = newdataadr(fd, mesh->mr->verts);
                        
@@@ -3987,8 -3941,6 +3995,6 @@@ static void direct_link_scene(FileData 
        direct_link_keyingsets(fd, &sce->keyingsets);
        
        sce->basact= newdataadr(fd, sce->basact);
-       sce->radio= newdataadr(fd, sce->radio);
        
        sce->toolsettings= newdataadr(fd, sce->toolsettings);
        if(sce->toolsettings) {
@@@ -4755,11 -4707,6 +4761,11 @@@ static void direct_link_screen(FileDat
                                sipo->ads= newdataadr(fd, sipo->ads);
                                sipo->ghostCurves.first= sipo->ghostCurves.last= NULL;
                        }
 +                      else if (sl->spacetype==SPACE_NLA) {
 +                              SpaceNla *snla= (SpaceNla*)sl;
 +                              
 +                              snla->ads= newdataadr(fd, snla->ads);
 +                      }
                        else if (sl->spacetype==SPACE_OUTLINER) {
                                SpaceOops *soops= (SpaceOops*) sl;
                                
@@@ -9057,6 -9004,7 +9063,7 @@@ static void do_versions(FileData *fd, L
                Scene *sce;
                Tex *tx;
                ParticleSettings *part;
+               Object *ob;
                
                for(screen= main->screen.first; screen; screen= screen->id.next) {
                        do_versions_windowmanager_2_50(screen);
                        me->drawflag= ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES;
                }
  
-               /* particle settings conversion */
+               /* particle draw and render types */
                for(part= main->particle.first; part; part= part->id.next) {
                        if(part->draw_as) {
                                if(part->draw_as == PART_DRAW_DOT) {
                                }
                        }
                }
+               /* set old pointcaches to have disk cache flag */
+               for(ob = main->object.first; ob; ob= ob->id.next) {
+                       ParticleSystem *psys = ob->particlesystem.first;
+                       for(; psys; psys=psys->next) {
+                               if(psys->pointcache)
+                                       psys->pointcache->flag |= PTCACHE_DISK_CACHE;
+                       }
+                       /* TODO: softbody & cloth caches */
+               }
        }
  
        /* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can
@@@ -9556,12 -9515,9 +9574,12 @@@ static void expand_keyingsets(FileData 
  static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt)
  {
        FCurve *fcd;
 +      NlaTrack *nlt;
 +      NlaStrip *strip;
        
        /* own action */
        expand_doit(fd, mainvar, adt->action);
 +      expand_doit(fd, mainvar, adt->tmpact);
        
        /* drivers - assume that these F-Curves have driver data to be in this list... */
        for (fcd= adt->drivers.first; fcd; fcd= fcd->next) {
                for (dtar= driver->targets.first; dtar; dtar= dtar->next)
                        expand_doit(fd, mainvar, dtar->id);
        }
 +      
 +      /* nla-data - referenced actions */
 +      for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
 +              for (strip= nlt->strips.first; strip; strip= strip->next) 
 +                      expand_doit(fd, mainvar, strip->act);
 +      }
  }     
  
  static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSettings *part)
index 0c3859117216f7810695bd7c5113479750737c6d,172c081570b4da3cdc0aa7723c65328843acaa6c..3f591c62dee5ea9780f3db0c37bfb7dddfc048fa
@@@ -549,6 -549,22 +549,22 @@@ static void write_userdef(WriteData *wd
        }
  }
  
+ /* TODO: replace *cache with *cachelist once it's coded */
+ #define PTCACHE_WRITE_PSYS    0
+ static void write_pointcaches(WriteData *wd, PointCache *cache, int type)
+ {
+       writestruct(wd, DATA, "PointCache", 1, cache);
+       if((cache->flag & PTCACHE_DISK_CACHE)==0) {
+               PTCacheMem *pm = cache->mem_cache.first;
+               for(; pm; pm=pm->next) {
+                       writestruct(wd, DATA, "PTCacheMem", 1, pm);
+                       if(type==PTCACHE_WRITE_PSYS)
+                               writestruct(wd, DATA, "ParticleKey", pm->totpoint, pm->data);
+               }
+       }
+ }
  static void write_particlesettings(WriteData *wd, ListBase *idbase)
  {
        ParticleSettings *part;
@@@ -585,8 -601,8 +601,8 @@@ static void write_particlesystems(Write
                }
                if(psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child);
                writestruct(wd, DATA, "SoftBody", 1, psys->soft);
-               if(psys->soft) writestruct(wd, DATA, "PointCache", 1, psys->soft->pointcache);
-               writestruct(wd, DATA, "PointCache", 1, psys->pointcache);
+               if(psys->soft) write_pointcaches(wd, psys->soft->pointcache, PTCACHE_WRITE_PSYS);
+               write_pointcaches(wd, psys->pointcache, PTCACHE_WRITE_PSYS);
        }
  }
  
@@@ -760,59 -776,10 +776,59 @@@ static void write_actuators(WriteData *
        }
  }
  
 +static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers)
 +{
 +      FModifier *fcm;
 +      
 +      /* Modifiers */
 +      for (fcm= fmodifiers->first; fcm; fcm= fcm->next) {
 +              FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
 +              
 +              /* Write the specific data */
 +              if (fmi && fcm->data) {
 +                      /* firstly, just write the plain fmi->data struct */
 +                      writestruct(wd, DATA, fmi->structName, 1, fcm->data);
 +                      
 +                      /* do any modifier specific stuff */
 +                      switch (fcm->type) {
 +                              case FMODIFIER_TYPE_GENERATOR:
 +                              {
 +                                      FMod_Generator *data= (FMod_Generator *)fcm->data;
 +                                      
 +                                      /* write coefficients array */
 +                                      if (data->coefficients)
 +                                              writedata(wd, DATA, sizeof(float)*(data->arraysize), data->coefficients);
 +                              }
 +                                      break;
 +                              case FMODIFIER_TYPE_ENVELOPE:
 +                              {
 +                                      FMod_Envelope *data= (FMod_Envelope *)fcm->data;
 +                                      
 +                                      /* write envelope data */
 +                                      if (data->data)
 +                                              writedata(wd, DATA, sizeof(FCM_EnvelopeData)*(data->totvert), data->data);
 +                              }
 +                                      break;
 +                              case FMODIFIER_TYPE_PYTHON:
 +                              {
 +                                      FMod_Python *data = (FMod_Python *)fcm->data;
 +                                      
 +                                      /* Write ID Properties -- and copy this comment EXACTLY for easy finding
 +                                       of library blocks that implement this.*/
 +                                      IDP_WriteProperty(data->prop, wd);
 +                              }
 +                                      break;
 +                      }
 +              }
 +              
 +              /* Write the modifier */
 +              writestruct(wd, DATA, "FModifier", 1, fcm);
 +      }
 +}
 +
  static void write_fcurves(WriteData *wd, ListBase *fcurves)
  {
        FCurve *fcu;
 -      FModifier *fcm;
        
        for (fcu=fcurves->first; fcu; fcu=fcu->next) {
                /* F-Curve */
                        }
                }
                
 -              /* Modifiers */
 -              for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) {
 -                      FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
 -                      
 -                      /* Write the specific data */
 -                      if (fmi && fcm->data) {
 -                              /* firstly, just write the plain fmi->data struct */
 -                              writestruct(wd, DATA, fmi->structName, 1, fcm->data);
 -                              
 -                              /* do any modifier specific stuff */
 -                              switch (fcm->type) {
 -                                      case FMODIFIER_TYPE_GENERATOR:
 -                                      {
 -                                              FMod_Generator *data= (FMod_Generator *)fcm->data;
 -                                              
 -                                              /* write coefficients array */
 -                                              if (data->coefficients)
 -                                                      writedata(wd, DATA, sizeof(float)*(data->arraysize), data->coefficients);
 -                                      }
 -                                              break;
 -                                      case FMODIFIER_TYPE_ENVELOPE:
 -                                      {
 -                                              FMod_Envelope *data= (FMod_Envelope *)fcm->data;
 -                                              
 -                                              /* write envelope data */
 -                                              if (data->data)
 -                                                      writedata(wd, DATA, sizeof(FCM_EnvelopeData)*(data->totvert), data->data);
 -                                      }
 -                                              break;
 -                                      case FMODIFIER_TYPE_PYTHON:
 -                                      {
 -                                              FMod_Python *data = (FMod_Python *)fcm->data;
 -                                              
 -                                              /* Write ID Properties -- and copy this comment EXACTLY for easy finding
 -                                               of library blocks that implement this.*/
 -                                              IDP_WriteProperty(data->prop, wd);
 -                                      }
 -                                              break;
 -                              }
 -                      }
 -                      
 -                      /* Write the modifier */
 -                      writestruct(wd, DATA, "FModifier", 1, fcm);
 -              }
 +              /* write F-Modifiers */
 +              write_fmodifiers(wd, &fcu->modifiers);
        }
  }
  
@@@ -895,29 -904,6 +911,29 @@@ static void write_keyingsets(WriteData 
        }
  }
  
 +static void write_nladata(WriteData *wd, ListBase *nlabase)
 +{
 +      NlaTrack *nlt;
 +      NlaStrip *strip;
 +      
 +      /* write all the tracks */
 +      for (nlt= nlabase->first; nlt; nlt= nlt->next) {
 +              /* write the track first */
 +              writestruct(wd, DATA, "NlaTrack", 1, nlt);
 +              
 +              for (strip= nlt->strips.first; strip; strip= strip->next) {
 +                      /* write the strip first */
 +                      writestruct(wd, DATA, "NlaStrip", 1, strip);
 +                      
 +                      /* write the strip's F-Curves and modifiers */
 +                      write_fcurves(wd, &strip->fcurves);
 +                      write_fmodifiers(wd, &strip->modifiers);
 +                      
 +                      // TODO write the remaps
 +              }
 +      }
 +}
 +
  static void write_animdata(WriteData *wd, AnimData *adt)
  {
        AnimOverride *aor;
        write_fcurves(wd, &adt->drivers);
        
        /* write overrides */
 +      // FIXME: are these needed?
        for (aor= adt->overrides.first; aor; aor= aor->next) {
                /* overrides consist of base data + rna_path */
                writestruct(wd, DATA, "AnimOverride", 1, aor);
                writedata(wd, DATA, strlen(aor->rna_path)+1, aor->rna_path);
        }
        
 +      // TODO write the remaps (if they are needed)
 +      
        /* write NLA data */
 -      // XXX todo...
 +      write_nladata(wd, &adt->nla_tracks);
  }
  
  static void write_constraints(WriteData *wd, ListBase *conlist)
@@@ -1617,7 -1600,6 +1633,6 @@@ static void write_scenes(WriteData *wd
                        base= base->next;
                }
                
-               writestruct(wd, DATA, "Radio", 1, sce->radio);
                writestruct(wd, DATA, "ToolSettings", 1, sce->toolsettings);
                if(sce->toolsettings->vpaint)
                        writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->vpaint);
@@@ -1909,10 -1891,7 +1924,10 @@@ static void write_screens(WriteData *wd
                                        writestruct(wd, DATA, "SpaceSound", 1, sl);
                                }
                                else if(sl->spacetype==SPACE_NLA){
 -                                      writestruct(wd, DATA, "SpaceNla", 1, sl);
 +                                      SpaceNla *snla= (SpaceNla *)sl;
 +                                      
 +                                      writestruct(wd, DATA, "SpaceNla", 1, snla);
 +                                      if(snla->ads) writestruct(wd, DATA, "bDopeSheet", 1, snla->ads);
                                }
                                else if(sl->spacetype==SPACE_TIME){
                                        writestruct(wd, DATA, "SpaceTime", 1, sl);
index fb7d9c57eafc56a156c7e5e86670e6c7a2b322c6,efe5122ad010a0ff25b32165430447b6ad4b442c..cb210a37bf48d815e0cfe034dcd10e1b70dc951f
@@@ -2559,137 -2559,7 +2559,137 @@@ int clipUVTransform(TransInfo *t, floa
        return (clipx || clipy);
  }
  
 -/* ********************* ACTION/NLA EDITOR ****************** */
 +/* ********************* ANIMATION EDITORS (GENERAL) ************************* */
 +
 +/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */
 +static short FrameOnMouseSide(char side, float frame, float cframe)
 +{
 +      /* both sides, so it doesn't matter */
 +      if (side == 'B') return 1;
 +      
 +      /* only on the named side */
 +      if (side == 'R')
 +              return (frame >= cframe) ? 1 : 0;
 +      else
 +              return (frame <= cframe) ? 1 : 0;
 +}
 +
 +/* ********************* NLA EDITOR ************************* */
 +
 +static void createTransNlaData(bContext *C, TransInfo *t)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      TransData *td = NULL;
 +      TransDataNla *tdn = NULL;
 +      
 +      bAnimContext ac;
 +      ListBase anim_data = {NULL, NULL};
 +      bAnimListElem *ale;
 +      int filter;
 +      
 +      int count=0;
 +      char side;
 +      
 +      /* determine what type of data we are operating on */
 +      if (ANIM_animdata_get_context(C, &ac) == 0)
 +              return;
 +      
 +      /* filter data */
 +      filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT);
 +      ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
 +              
 +      /* which side of the current frame should be allowed */
 +      if (t->mode == TFM_TIME_EXTEND) {
 +              /* only side on which mouse is gets transformed */
 +              float xmouse, ymouse;
 +              
 +              UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse);
 +              side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side
 +      }
 +      else {
 +              /* normal transform - both sides of current frame are considered */
 +              side = 'B';
 +      }
 +      
 +      /* loop 1: count how many strips are selected (consider each strip as 2 points) */
 +      for (ale= anim_data.first; ale; ale= ale->next) {
 +              NlaTrack *nlt= (NlaTrack *)ale->data;
 +              NlaStrip *strip;
 +              
 +              /* only consider selected strips */
 +              for (strip= nlt->strips.first; strip; strip= strip->next) {
 +                      // TODO: we can make strips have handles later on...
 +                      if (strip->flag & NLASTRIP_FLAG_SELECT) {
 +                              if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++;
 +                              if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++;
 +                      }
 +              }
 +      }
 +      
 +      /* stop if trying to build list if nothing selected */
 +      if (count == 0) {
 +              /* cleanup temp list */
 +              BLI_freelistN(&anim_data);
 +              return;
 +      }
 +      
 +      /* allocate memory for data */
 +      t->total= count;
 +      
 +      t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(NLA Editor)");
 +      td= t->data;
 +      t->customData= MEM_callocN(t->total*sizeof(TransDataNla), "TransDataNla (NLA Editor)");
 +      tdn= t->customData;
 +      
 +      /* loop 2: build transdata array */
 +      for (ale= anim_data.first; ale; ale= ale->next) {
 +              /* only if a real NLA-track */
 +              if (ale->type == ANIMTYPE_NLATRACK) {
 +                      NlaTrack *nlt= (NlaTrack *)ale->data;
 +                      NlaStrip *strip;
 +                      
 +                      /* only consider selected strips */
 +                      for (strip= nlt->strips.first; strip; strip= strip->next) {
 +                              // TODO: we can make strips have handles later on...
 +                              if (strip->flag & NLASTRIP_FLAG_SELECT) {
 +                                      if (FrameOnMouseSide(side, strip->start, (float)CFRA)) 
 +                                      {
 +                                              /* init the 'extra' data for NLA strip handles first */
 +                                              tdn->strip= strip;
 +                                              tdn->val= strip->start;
 +                                              tdn->handle= 0;
 +                                              
 +                                              /* now, link the transform data up to this data */
 +                                              td->val= &tdn->val;
 +                                              td->ival= tdn->val;
 +                                              td->extra= tdn;
 +                                              td++;
 +                                              tdn++;
 +                                      }
 +                                      if (FrameOnMouseSide(side, strip->end, (float)CFRA)) 
 +                                      {       
 +                                              /* init the 'extra' data for NLA strip handles first */
 +                                              tdn->strip= strip;
 +                                              tdn->val= strip->end;
 +                                              tdn->handle= 1;
 +                                              
 +                                              /* now, link the transform data up to this data */
 +                                              td->val= &tdn->val;
 +                                              td->ival= tdn->val;
 +                                              td->extra= tdn;
 +                                              td++;
 +                                              tdn++;
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
 +      
 +      /* cleanup temp list */
 +      BLI_freelistN(&anim_data);
 +}
 +
 +/* ********************* ACTION EDITOR ****************** */
  
  /* Called by special_aftertrans_update to make sure selected gp-frames replace
   * any other gp-frames which may reside on that frame (that are not selected).
@@@ -2874,6 -2744,19 +2874,6 @@@ static void posttrans_action_clean (bAn
  
  /* ----------------------------- */
  
 -/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */
 -static short FrameOnMouseSide(char side, float frame, float cframe)
 -{
 -      /* both sides, so it doesn't matter */
 -      if (side == 'B') return 1;
 -      
 -      /* only on the named side */
 -      if (side == 'R')
 -              return (frame >= cframe) ? 1 : 0;
 -      else
 -              return (frame <= cframe) ? 1 : 0;
 -}
 -
  /* fully select selected beztriples, but only include if it's on the right side of cfra */
  static int count_fcurve_keys(FCurve *fcu, char side, float cfra)
  {
@@@ -3161,6 -3044,8 +3161,6 @@@ static void createTransActionData(bCont
  
  /* ********************* GRAPH EDITOR ************************* */
  
 -
 -
  /* Helper function for createTransGraphEditData, which is reponsible for associating
   * source data with transform data
   */
@@@ -3617,6 -3502,7 +3617,6 @@@ void flushTransGraphData(TransInfo *t
        }
  }
  
 -
  /* **************** IpoKey stuff, for Object TransData ********** */
  
  /* while transforming */
@@@ -4718,29 -4604,6 +4718,29 @@@ void special_aftertrans_update(TransInf
                /* make sure all F-Curves are set correctly */
                ANIM_editkeyframes_refresh(&ac);
        }
 +      else if (t->spacetype == SPACE_NLA) {
 +              SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first;
 +              Scene *scene;
 +              bAnimContext ac;
 +              
 +              /* initialise relevant anim-context 'context' data from TransInfo data */
 +              /* NOTE: sync this with the code in ANIM_animdata_get_context() */
 +              memset(&ac, 0, sizeof(bAnimContext));
 +              
 +              scene= ac.scene= t->scene;
 +              ob= ac.obact= OBACT;
 +              ac.sa= t->sa;
 +              ac.ar= t->ar;
 +              ac.spacetype= (t->sa)? t->sa->spacetype : 0;
 +              ac.regiontype= (t->ar)? t->ar->regiontype : 0;
 +              
 +              if (ANIM_animdata_context_getdata(&ac) == 0)
 +                      return;
 +              
 +              // XXX check on the calls below... we need some of these sanity checks
 +              //synchronize_action_strips();
 +              //ANIM_editkeyframes_refresh(&ac);
 +      }
        else if (t->obedit) {
                // TRANSFORM_FIX_ME
  //            if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE)
                        
                        if (base->flag & SELECT && (t->mode != TFM_DUMMY)) {
                                /* pointcache refresh */
-                               if (BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH))
+                               if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH))
                                        ob->recalc |= OB_RECALC_DATA;
                                
                                /* Set autokey if necessary */
                }
        }
        
 -#if 0 // TRANSFORM_FIX_ME
 -      else if (t->spacetype == SPACE_NLA) {
 -              recalc_all_ipos();      // bad
 -              synchronize_action_strips();
 -              
 -              /* cleanup */
 -              for (base=t->scene->base.first; base; base=base->next)
 -                      base->flag &= ~(BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA);
 -              
 -              /* after transform, remove duplicate keyframes on a frame that resulted from transform */
 -              if ( (G.snla->flag & SNLA_NOTRANSKEYCULL)==0 && 
 -                       ((cancelled == 0) || (duplicate)) )
 -              {
 -                      posttrans_nla_clean(t);
 -              }
 -      }
 -#endif
 -      
        clear_trans_object_base_flags(t);
  
  #if 0 // TRANSFORM_FIX_ME
@@@ -5051,7 -4932,8 +5051,7 @@@ void createTransData(bContext *C, Trans
        }
        else if (t->spacetype == SPACE_NLA) {
                t->flag |= T_POINTS|T_2D_EDIT;
 -              // TRANSFORM_FIX_ME
 -              //createTransNlaData(C, t);
 +              createTransNlaData(C, t);
        }
        else if (t->spacetype == SPACE_SEQ) {
                t->flag |= T_POINTS|T_2D_EDIT;
index 2219535bfd30380f872bcf4c4b3e643e2eadbbed,4605d1f31e26dc74dc6b4ceafc595710785273e8..89db9ae3ee8bd0503c599220c549bec3b4ac8799
@@@ -39,7 -39,6 +39,6 @@@ extern "C" 
  #include "DNA_scriptlink_types.h"
  #include "DNA_ID.h"
  
- struct Radio;
  struct Object;
  struct World;
  struct Scene;
@@@ -158,7 -157,7 +157,7 @@@ typedef struct SceneRenderLayer 
  #define SCE_PASS_REFRACT      1024
  #define SCE_PASS_INDEXOB      2048
  #define SCE_PASS_UV                   4096
- #define SCE_PASS_RADIO                8192
+ #define SCE_PASS_RADIO                8192 /* Radio removed, can use for new GI? */
  #define SCE_PASS_MIST         16384
  
  /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
@@@ -570,7 -569,6 +569,6 @@@ typedef struct Scene 
        struct bNodeTree *nodetree;     
        
        void *ed;                                                               /* sequence editor data is allocated here */
-       struct Radio *radio;
        
        struct GameFraming framing;
  
  /* sce->flag */
  #define SCE_DS_SELECTED                       (1<<0)
  #define SCE_DS_COLLAPSED              (1<<1)
 +#define SCE_NLA_EDIT_ON                       (1<<2)
  
  
        /* return flag next_object function */
index 01abc5450aa5a92eb99ac216f209c5afbc014b8a,4a074ab1546ff5dad7e4d5004eb9fb9cb04d0ac3..af64daa3293cffef4dd2f3a9cccda5c98428e12a
@@@ -172,6 -172,7 +172,7 @@@ extern StructRNA RNA_EnvironmentMap
  extern StructRNA RNA_EnvironmentMapTexture;
  extern StructRNA RNA_ExplodeModifier;
  extern StructRNA RNA_ExpressionController;
+ extern StructRNA RNA_Event;
  extern StructRNA RNA_FCurve;
  extern StructRNA RNA_FModifier;
  extern StructRNA RNA_FModifierCycles;
@@@ -272,8 -273,6 +273,8 @@@ extern StructRNA RNA_MultiresModifier
  extern StructRNA RNA_MusgraveTexture;
  extern StructRNA RNA_NandController;
  extern StructRNA RNA_NearSensor;
 +extern StructRNA RNA_NlaTrack;
 +extern StructRNA RNA_NlaStrip;
  extern StructRNA RNA_Node;
  extern StructRNA RNA_NodeTree;
  extern StructRNA RNA_NoiseTexture;
@@@ -366,10 -365,7 +367,10 @@@ extern StructRNA RNA_SoundSequence
  extern StructRNA RNA_Space;
  extern StructRNA RNA_Space3DView;
  extern StructRNA RNA_SpaceButtonsWindow;
 +extern StructRNA RNA_SpaceDopeSheetEditor;
 +extern StructRNA RNA_SpaceGraphEditor;
  extern StructRNA RNA_SpaceImageEditor;
 +extern StructRNA RNA_SpaceNLA;
  extern StructRNA RNA_SpaceOutliner;
  extern StructRNA RNA_SpaceSequenceEditor;
  extern StructRNA RNA_SpaceTextEditor;
@@@ -546,6 -542,9 +547,9 @@@ void RNA_property_int_ui_range(PointerR
  void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax);
  void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision);
  
+ int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier);
+ int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name);
  void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem);
  int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
  int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier);
index 18734fbcb18e24612930ec6f61af4fb9d345c6dd,e7ca3fc59321946b23675ea91fcb37a2cedef9d9..9ece6684cd84b9cdf95bf564f09f1be1d4e15c2f
@@@ -1846,7 -1846,6 +1846,7 @@@ RNAProcessItem PROCESS_ITEMS[]= 
        {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
        {"rna_meta.c", NULL, RNA_def_meta},
        {"rna_modifier.c", NULL, RNA_def_modifier},
 +      {"rna_nla.c", NULL, RNA_def_nla},
        {"rna_nodetree.c", NULL, RNA_def_nodetree},
        {"rna_object.c", "rna_object_api.c", RNA_def_object},
        {"rna_object_force.c", NULL, RNA_def_object_force},
        {"rna_particle.c", NULL, RNA_def_particle},
        {"rna_pose.c", NULL, RNA_def_pose},
        {"rna_property.c", NULL, RNA_def_gameproperty},
-       {"rna_radio.c", NULL, RNA_def_radio},
        {"rna_scene.c", NULL, RNA_def_scene},
        {"rna_screen.c", NULL, RNA_def_screen},
        {"rna_scriptlink.c", NULL, RNA_def_scriptlink},
index a3d5c4fe3882dcb28ea1c2618bf10f966fb8c74a,7538f103245eca4d50a7b6d914f1a4f806af4f17..c2f2e1d519fd504c9bfb714dd5a11f79b37552dc
@@@ -139,14 -139,12 +139,13 @@@ void RNA_def_material(struct BlenderRN
  void RNA_def_mesh(struct BlenderRNA *brna);
  void RNA_def_meta(struct BlenderRNA *brna);
  void RNA_def_modifier(struct BlenderRNA *brna);
 +void RNA_def_nla(struct BlenderRNA *brna);
  void RNA_def_nodetree(struct BlenderRNA *brna);
  void RNA_def_object(struct BlenderRNA *brna);
  void RNA_def_object_force(struct BlenderRNA *brna);
  void RNA_def_packedfile(struct BlenderRNA *brna);
  void RNA_def_particle(struct BlenderRNA *brna);
  void RNA_def_pose(struct BlenderRNA *brna);
- void RNA_def_radio(struct BlenderRNA *brna);
  void RNA_def_rna(struct BlenderRNA *brna);
  void RNA_def_scene(struct BlenderRNA *brna);
  void RNA_def_screen(struct BlenderRNA *brna);
index d4f7c5b0bd1a984c5d4f16fface8456b72c5b837,66d98d98834e06a43f2cf10e9d7b533a024b6b27..ce31cb27c9ab0933ae1e1ea9d19efff335cf49b5
@@@ -30,7 -30,6 +30,7 @@@
  
  #include "rna_internal.h"
  
 +#include "DNA_action_types.h"
  #include "DNA_object_types.h"
  #include "DNA_space_types.h"
  #include "DNA_view3d_types.h"
@@@ -90,8 -89,9 +90,8 @@@ static StructRNA* rna_Space_refine(stru
        switch(space->spacetype) {
                case SPACE_VIEW3D:
                        return &RNA_Space3DView;
 -              /*case SPACE_IPO:
 +              case SPACE_IPO:
                        return &RNA_SpaceGraphEditor;
 -              */
                case SPACE_OUTLINER:
                        return &RNA_SpaceOutliner;
                case SPACE_BUTS:
                //case SPACE_IMASEL:
                //      return &RNA_SpaceImageBrowser;
                /*case SPACE_SOUND:
 -                      return &RNA_SpaceAudioWindow;
 +                      return &RNA_SpaceAudioWindow;*/
                case SPACE_ACTION:
                        return &RNA_SpaceDopeSheetEditor;
                case SPACE_NLA:
 -                      return &RNA_SpaceNLAEditor;
 -              case SPACE_SCRIPT:
 +                      return &RNA_SpaceNLA;
 +              /*case SPACE_SCRIPT:
                        return &RNA_SpaceScriptsWindow;
                case SPACE_TIME:
                        return &RNA_SpaceTimeline;
@@@ -575,18 -575,17 +575,17 @@@ static void rna_def_space_buttons(Blend
        PropertyRNA *prop;
  
        static EnumPropertyItem buttons_context_items[] = {
-               {BCONTEXT_SCENE, "SCENE", 0, "Scene", ""},
-               {BCONTEXT_WORLD, "WORLD", 0, "World", ""},
-               {BCONTEXT_OBJECT, "OBJECT", 0, "Object", ""},
-               {BCONTEXT_DATA, "DATA", 0, "Data", ""},
-               {BCONTEXT_MATERIAL, "MATERIAL", 0, "Material", ""},
-               {BCONTEXT_TEXTURE, "TEXTURE", 0, "Texture", ""},
-               {BCONTEXT_PARTICLE, "PARTICLE", 0, "Particle", ""},
-               {BCONTEXT_PHYSICS, "PHYSICS", 0, "Physics", ""},
-               {BCONTEXT_GAME, "GAME", 0, "Game", ""},
-               {BCONTEXT_BONE, "BONE", 0, "Bone", ""},
-               {BCONTEXT_MODIFIER, "MODIFIER", 0, "Modifier", ""},
-               {BCONTEXT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
+               {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
+               {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
+               {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
+               {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint", "Constraint"},
+               {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifier", "Modifier"},
+               {BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
+               {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
+               {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
+               {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
+               {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
+               {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
                {0, NULL, 0, NULL, NULL}};
                
        static EnumPropertyItem panel_alignment_items[] = {
        RNA_def_property_enum_sdna(prop, NULL, "mainb");
        RNA_def_property_enum_items(prop, buttons_context_items);
        RNA_def_property_ui_text(prop, "Buttons Context", "The type of active data to display and edit in the buttons window");
+       RNA_def_property_update(prop, NC_WINDOW, NULL);
        
        prop= RNA_def_property(srna, "panel_alignment", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "align");
        RNA_def_property_enum_items(prop, panel_alignment_items);
        RNA_def_property_ui_text(prop, "Panel Alignment", "Arrangement of the panels within the buttons window");
+       RNA_def_property_update(prop, NC_WINDOW, NULL);
  
        /* pinned data */
        prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
@@@ -868,117 -869,6 +869,117 @@@ static void rna_def_space_text(BlenderR
        RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool.");
  }
  
 +static void rna_def_space_dopesheet(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +      
 +      static EnumPropertyItem mode_items[] = {
 +              {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""},
 +              {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""},
 +              {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, // XXX to be depreceated?
 +              {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +              
 +      
 +      srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
 +      RNA_def_struct_sdna(srna, "SpaceAction");
 +      RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data.");
 +      
 +      /* mode */
 +      prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "mode");
 +      RNA_def_property_enum_items(prop, mode_items);
 +      RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
 +      
 +      /* display */
 +      prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
 +      RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
 +      
 +      prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
 +      RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
 +      
 +      prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
 +      RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels.");
 +      
 +      /* editing */
 +      prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
 +      RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
 +      
 +      // TODO... autosnap, dopesheet?
 +}
 +
 +static void rna_def_space_graph(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +      
 +      static EnumPropertyItem mode_items[] = {
 +              {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curves", ""},
 +              {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""},
 +              {0, NULL, 0, NULL, NULL}};
 +      
 +      
 +      srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
 +      RNA_def_struct_sdna(srna, "SpaceIpo");
 +      RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data.");
 +      
 +      /* mode */
 +      prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "mode");
 +      RNA_def_property_enum_items(prop, mode_items);
 +      RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed.");
 +      
 +      /* display */
 +      prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
 +      RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
 +      
 +      prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
 +      RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
 +      
 +      prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
 +      RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points.");
 +      
 +      /* editing */
 +      prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
 +      RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
 +      
 +      // TODO... autosnap, dopesheet?
 +}
 +
 +static void rna_def_space_nla(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +      
 +      srna= RNA_def_struct(brna, "SpaceNLA", "Space");
 +      RNA_def_struct_sdna(srna, "SpaceNla");
 +      RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data.");
 +      
 +      /* display */
 +      prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
 +      RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames.");
 +      
 +      prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
 +      RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line.");
 +      
 +      /* editing */
 +      // TODO... autosnap, dopesheet?
 +}
 +
  void RNA_def_space(BlenderRNA *brna)
  {
        rna_def_space(brna);
        rna_def_background_image(brna);
        rna_def_space_3dview(brna);
        rna_def_space_buttons(brna);
 +      rna_def_space_dopesheet(brna);
 +      rna_def_space_graph(brna);
 +      rna_def_space_nla(brna);
  }
  
  #endif