doxygen: blender/blenkernel tagged.
[blender.git] / source / blender / blenkernel / intern / ipo.c
index 807b584d6f8e07243f91d34494c664404bec5c7a..92098d59e0e3624f7c1ee9b3699da2daf4b072cd 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/blenkernel/intern/ipo.c
+ *  \ingroup bke
+ */
+
+
 /* NOTE:
  *
  * This file is no longer used to provide tools for the depreceated IPO system. Instead, it
 /* NOTE:
  *
  * This file is no longer used to provide tools for the depreceated IPO system. Instead, it
 #include <string.h>
 #include <stddef.h>
 
 #include <string.h>
 #include <stddef.h>
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include "MEM_guardedalloc.h"
 
 #include "DNA_anim_types.h"
 #include "MEM_guardedalloc.h"
 
 #include "DNA_anim_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
 #include "DNA_constraint_types.h"
 #include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_lamp_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_key_types.h"
 #include "DNA_material_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_lamp_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_key_types.h"
 #include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
 #include "DNA_nla_types.h"
 #include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
 #include "DNA_sequence_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_sequence_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_view3d_types.h"
 #include "DNA_world_types.h"
 #include "DNA_world_types.h"
+#include "DNA_object_types.h"
 
 
+#include "BLI_math.h" /* windows needs for M_PI */
 #include "BLI_blenlib.h"
 #include "BLI_blenlib.h"
-#include "BLI_math.h"
 #include "BLI_dynstr.h"
 #include "BLI_dynstr.h"
+#include "BLI_utildefines.h"
 
 
-#include "BKE_utildefines.h"
 
 
+#include "BKE_ipo.h"
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_animsys.h"
 #include "BKE_action.h"
-#include "BKE_blender.h"
-#include "BKE_curve.h"
-#include "BKE_constraint.h"
 #include "BKE_fcurve.h"
 #include "BKE_global.h"
 #include "BKE_fcurve.h"
 #include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_main.h"
-#include "BKE_mesh.h"
 #include "BKE_nla.h"
 #include "BKE_nla.h"
-#include "BKE_object.h"
-
+#include "BKE_sequencer.h"
 
 
 /* *************************************************** */
 
 
 /* *************************************************** */
@@ -122,7 +108,7 @@ void free_ipo (Ipo *ipo)
 /* Mapping Table for bitflag <-> RNA path */
 typedef struct AdrBit2Path {
        int bit;
 /* Mapping Table for bitflag <-> RNA path */
 typedef struct AdrBit2Path {
        int bit;
-       char *path;
+       const char *path;
        int array_index;
 } AdrBit2Path;
 
        int array_index;
 } AdrBit2Path;
 
@@ -131,27 +117,26 @@ typedef struct AdrBit2Path {
 
 /* Object layers */
 static AdrBit2Path ob_layer_bits[]= {
 
 /* Object layers */
 static AdrBit2Path ob_layer_bits[]= {
-       {(1<<0), "layer", 0},
-       {(1<<1), "layer", 1},
-       {(1<<2), "layer", 2},
-       {(1<<3), "layer", 3},
-       {(1<<4), "layer", 4},
-       {(1<<5), "layer", 5},
-       {(1<<6), "layer", 6},
-       {(1<<7), "layer", 7},
-       {(1<<8), "layer", 8},
-       {(1<<9), "layer", 9},
-       {(1<<10), "layer", 10},
-       {(1<<11), "layer", 11},
-       {(1<<12), "layer", 12},
-       {(1<<13), "layer", 13},
-       {(1<<14), "layer", 14},
-       {(1<<15), "layer", 15},
-       {(1<<16), "layer", 16},
-       {(1<<17), "layer", 17},
-       {(1<<18), "layer", 18},
-       {(1<<19), "layer", 19},
-       {(1<<20), "layer", 20}
+       {(1<<0), "layers", 0},
+       {(1<<1), "layers", 1},
+       {(1<<2), "layers", 2},
+       {(1<<3), "layers", 3},
+       {(1<<4), "layers", 4},
+       {(1<<5), "layers", 5},
+       {(1<<6), "layers", 6},
+       {(1<<7), "layers", 7},
+       {(1<<8), "layers", 8},
+       {(1<<9), "layers", 9},
+       {(1<<10), "layers", 10},
+       {(1<<11), "layers", 11},
+       {(1<<12), "layers", 12},
+       {(1<<13), "layers", 13},
+       {(1<<14), "layers", 14},
+       {(1<<15), "layers", 15},
+       {(1<<16), "layers", 16},
+       {(1<<17), "layers", 17},
+       {(1<<18), "layers", 18},
+       {(1<<19), "layers", 19}
 };
 
 /* Material mode */
 };
 
 /* Material mode */
@@ -192,7 +177,7 @@ static AdrBit2Path *adrcode_bitmaps_to_paths (int blocktype, int adrcode, int *t
 /* ADRCODE to RNA-Path Conversion Code  - Standard */
 
 /* Object types */
 /* ADRCODE to RNA-Path Conversion Code  - Standard */
 
 /* Object types */
-static char *ob_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *ob_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -273,7 +258,7 @@ static char *ob_adrcodes_to_paths (int adrcode, int *array_index)
 /* PoseChannel types 
  * NOTE: pchan name comes from 'actname' added earlier... 
  */
 /* PoseChannel types 
  * NOTE: pchan name comes from 'actname' added earlier... 
  */
-static char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -317,7 +302,7 @@ static char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Constraint types */
 }
 
 /* Constraint types */
-static char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -335,9 +320,9 @@ static char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
 
 /* ShapeKey types 
  * NOTE: as we don't have access to the keyblock where the data comes from (for now), 
 
 /* ShapeKey types 
  * NOTE: as we don't have access to the keyblock where the data comes from (for now), 
- *             we'll just use numerical indicies for now... 
+ *             we'll just use numerical indices for now... 
  */
  */
-static char *shapekey_adrcodes_to_paths (int adrcode, int *array_index)
+static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index))
 {
        static char buf[128];
        
 {
        static char buf[128];
        
@@ -351,9 +336,9 @@ static char *shapekey_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* MTex (Texture Slot) types */
 }
 
 /* MTex (Texture Slot) types */
-static char *mtex_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index))
 {
 {
-       char *base=NULL, *prop=NULL;
+       const char *base=NULL, *prop=NULL;
        static char buf[128];
        
        /* base part of path */
        static char buf[128];
        
        /* base part of path */
@@ -421,7 +406,7 @@ static char *mtex_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Texture types */
 }
 
 /* Texture types */
-static char *texture_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *texture_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -501,7 +486,7 @@ static char *texture_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Material Types */
 }
 
 /* Material Types */
-static char *material_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *material_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -585,7 +570,7 @@ static char *material_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Camera Types */
 }
 
 /* Camera Types */
-static char *camera_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *camera_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -625,7 +610,7 @@ static char *camera_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Lamp Types */
 }
 
 /* Lamp Types */
-static char *lamp_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *lamp_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -667,7 +652,7 @@ static char *lamp_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Sound Types */
 }
 
 /* Sound Types */
-static char *sound_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *sound_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -690,7 +675,7 @@ static char *sound_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* World Types */
 }
 
 /* World Types */
-static char *world_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *world_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -729,6 +714,11 @@ static char *world_adrcodes_to_paths (int adrcode, int *array_index)
                        *array_index= 1; return "stars.color";
                case WO_STAR_B:
                        *array_index= 2; return "stars.color"; */
                        *array_index= 1; return "stars.color";
                case WO_STAR_B:
                        *array_index= 2; return "stars.color"; */
+               case WO_STAR_R:
+               case WO_STAR_G:
+               case WO_STAR_B:
+                       printf("WARNING: WO_STAR_R/G/B deprecated\n");
+                       return NULL;
                
                case WO_STARDIST:
                        return "stars.min_distance";
                
                case WO_STARDIST:
                        return "stars.min_distance";
@@ -743,7 +733,7 @@ static char *world_adrcodes_to_paths (int adrcode, int *array_index)
 }
 
 /* Particle Types */
 }
 
 /* Particle Types */
-static char *particle_adrcodes_to_paths (int adrcode, int *array_index)
+static const char *particle_adrcodes_to_paths (int adrcode, int *array_index)
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
 {
        /* set array index like this in-case nothing sets it correctly  */
        *array_index= 0;
@@ -813,15 +803,16 @@ static char *particle_adrcodes_to_paths (int adrcode, int *array_index)
 /* Allocate memory for RNA-path for some property given a blocktype, adrcode, and 'root' parts of path
  *     Input:
  *             - blocktype, adrcode    - determines setting to get
 /* Allocate memory for RNA-path for some property given a blocktype, adrcode, and 'root' parts of path
  *     Input:
  *             - blocktype, adrcode    - determines setting to get
- *             - actname, constname    - used to build path
+ *             - actname, constname,seq - used to build path
  *     Output:
  *             - array_index                   - index in property's array (if applicable) to use
  *             - return                                - the allocated path...
  */
  *     Output:
  *             - array_index                   - index in property's array (if applicable) to use
  *             - return                                - the allocated path...
  */
-static char *get_rna_access (int blocktype, int adrcode, char actname[], char constname[], int *array_index)
+static char *get_rna_access (int blocktype, int adrcode, char actname[], char constname[], Sequence *seq, int *array_index)
 {
        DynStr *path= BLI_dynstr_new();
 {
        DynStr *path= BLI_dynstr_new();
-       char *propname=NULL, *rpath=NULL;
+       const char *propname=NULL;
+       char *rpath=NULL;
        char buf[512];
        int dummy_index= 0;
        
        char buf[512];
        int dummy_index= 0;
        
@@ -870,19 +861,19 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
                case ID_WO: /* world */
                        propname= world_adrcodes_to_paths(adrcode, &dummy_index);
                        break;
                case ID_WO: /* world */
                        propname= world_adrcodes_to_paths(adrcode, &dummy_index);
                        break;
-
+               
                case ID_PA: /* particle */
                        propname= particle_adrcodes_to_paths(adrcode, &dummy_index);
                        break;
                        
                case ID_PA: /* particle */
                        propname= particle_adrcodes_to_paths(adrcode, &dummy_index);
                        break;
                        
-               /* XXX problematic blocktypes */
                case ID_CU: /* curve */
                        /* this used to be a 'dummy' curve which got evaluated on the fly... 
                         * now we've got real var for this!
                         */
                        propname= "eval_time";
                        break;
                case ID_CU: /* curve */
                        /* this used to be a 'dummy' curve which got evaluated on the fly... 
                         * now we've got real var for this!
                         */
                        propname= "eval_time";
                        break;
-                       
+               
+               /* XXX problematic blocktypes */                
                case ID_SEQ: /* sequencer strip */
                        //SEQ_FAC1:
                        switch (adrcode) {
                case ID_SEQ: /* sequencer strip */
                        //SEQ_FAC1:
                        switch (adrcode) {
@@ -927,19 +918,32 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
                        *array_index= dummy_index;
        }
        
                        *array_index= dummy_index;
        }
        
-       /* append preceeding bits to path */
+       /* append preceding bits to path */
        if ((actname && actname[0]) && (constname && constname[0])) {
                /* Constraint in Pose-Channel */
                sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
        }
        else if (actname && actname[0]) {
        if ((actname && actname[0]) && (constname && constname[0])) {
                /* Constraint in Pose-Channel */
                sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
        }
        else if (actname && actname[0]) {
-               /* Pose-Channel */
-               sprintf(buf, "pose.bones[\"%s\"]", actname);
+               if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) {
+                       /* Actionified "Object" IPO's... no extra path stuff needed */
+               }
+               else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) {
+                       /* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */
+                       strcpy(buf, "data.shape_keys");
+               }
+               else {
+                       /* Pose-Channel */
+                       sprintf(buf, "pose.bones[\"%s\"]", actname);
+               }
        }
        else if (constname && constname[0]) {
                /* Constraint in Object */
                sprintf(buf, "constraints[\"%s\"]", constname);
        }
        }
        else if (constname && constname[0]) {
                /* Constraint in Object */
                sprintf(buf, "constraints[\"%s\"]", constname);
        }
+       else if (seq) {
+               /* Sequence names in Scene */
+               sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
+       }
        else
                strcpy(buf, ""); /* empty string */
        BLI_dynstr_append(path, buf);
        else
                strcpy(buf, ""); /* empty string */
        BLI_dynstr_append(path, buf);
@@ -1032,13 +1036,13 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
                                dtar= &dvar->targets[0];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0])
                                dtar= &dvar->targets[0];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0])
-                                       BLI_strncpy(dtar->pchan_name, idriver->name, 32);
+                                       BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
                                
                                        /* second bone target (name was stored in same var as the first one) */
                                dtar= &dvar->targets[1];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0]) // xxx... for safety
                                
                                        /* second bone target (name was stored in same var as the first one) */
                                dtar= &dvar->targets[1];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0]) // xxx... for safety
-                                       BLI_strncpy(dtar->pchan_name, idriver->name+DRIVER_NAME_OFFS, 32);
+                                       BLI_strncpy(dtar->pchan_name, idriver->name+DRIVER_NAME_OFFS, sizeof(dtar->pchan_name));
                        }
                        else {
                                /* only a single variable, of type 'transform channel' */
                        }
                        else {
                                /* only a single variable, of type 'transform channel' */
@@ -1049,7 +1053,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
                                dtar= &dvar->targets[0];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0])
                                dtar= &dvar->targets[0];
                                dtar->id= (ID *)idriver->ob;
                                if (idriver->name[0])
-                                       BLI_strncpy(dtar->pchan_name, idriver->name, 32);
+                                       BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
                                dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
                                dtar->flag |= DTAR_FLAG_LOCALSPACE; /* old drivers took local space */
                        }
                                dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
                                dtar->flag |= DTAR_FLAG_LOCALSPACE; /* old drivers took local space */
                        }
@@ -1084,7 +1088,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
                bActionGroup *agrp= NULL;
                
                /* init the temp action */
                bActionGroup *agrp= NULL;
                
                /* init the temp action */
-               //memset(&tmp_act, 0, sizeof(bAction)); // XXX only enable this line if we get errors
+               memset(&tmp_act, 0, sizeof(bAction)); // XXX only enable this line if we get errors
                tmp_act.groups.first= groups->first;
                tmp_act.groups.last= groups->last;
                tmp_act.curves.first= list->first;
                tmp_act.groups.first= groups->first;
                tmp_act.groups.last= groups->last;
                tmp_act.curves.first= list->first;
@@ -1100,8 +1104,8 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
                                agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
                                
                                agrp->flag = AGRP_SELECTED;
                                agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
                                
                                agrp->flag = AGRP_SELECTED;
-                               if(muteipo) agrp->flag |= AGRP_MUTED;
-
+                               if (muteipo) agrp->flag |= AGRP_MUTED;
+                               
                                strncpy(agrp->name, grpname, sizeof(agrp->name));
                                
                                BLI_addtail(&tmp_act.groups, agrp);
                                strncpy(agrp->name, grpname, sizeof(agrp->name));
                                
                                BLI_addtail(&tmp_act.groups, agrp);
@@ -1113,9 +1117,9 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
                /* WARNING: this func should only need to look at the stuff we initialised, if not, things may crash */
                action_groups_add_channel(&tmp_act, agrp, fcu);
                
                /* WARNING: this func should only need to look at the stuff we initialised, if not, things may crash */
                action_groups_add_channel(&tmp_act, agrp, fcu);
                
-               if(agrp->flag & AGRP_MUTED) /* flush down */
+               if (agrp->flag & AGRP_MUTED) /* flush down */
                        fcu->flag |= FCURVE_MUTED;
                        fcu->flag |= FCURVE_MUTED;
-
+               
                /* set the output lists based on the ones in the temp action */
                groups->first= tmp_act.groups.first;
                groups->last= tmp_act.groups.last;
                /* set the output lists based on the ones in the temp action */
                groups->first= tmp_act.groups.first;
                groups->last= tmp_act.groups.last;
@@ -1132,12 +1136,13 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
  * is not relevant, BUT do not free the IPO-Curve itself...
  *     actname: name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to
  *     constname: name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to
  * is not relevant, BUT do not free the IPO-Curve itself...
  *     actname: name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to
  *     constname: name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to
+ *      seq: sequencer-strip (if applicable) that IPO-Curve's IPO-block belonged to
  */
  */
-static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, int muteipo)
+static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, Sequence * seq, int muteipo)
 {
        AdrBit2Path *abp;
        FCurve *fcu;
 {
        AdrBit2Path *abp;
        FCurve *fcu;
-       int i=0, totbits;
+       int totbits;
        
        /* allocate memory for a new F-Curve */
        fcu= MEM_callocN(sizeof(FCurve), "FCurve");
        
        /* allocate memory for a new F-Curve */
        fcu= MEM_callocN(sizeof(FCurve), "FCurve");
@@ -1202,6 +1207,8 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                 * 3) filter the keyframes for the flag of interest
                 */
                for (b=0; b < totbits; b++, abp++) {
                 * 3) filter the keyframes for the flag of interest
                 */
                for (b=0; b < totbits; b++, abp++) {
+                       unsigned int i=0;
+                       
                        /* make a copy of existing base-data if not the last curve */
                        if (b < (totbits-1))
                                fcurve= copy_fcurve(fcu);
                        /* make a copy of existing base-data if not the last curve */
                        if (b < (totbits-1))
                                fcurve= copy_fcurve(fcu);
@@ -1209,7 +1216,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                                fcurve= fcu;
                                
                        /* set path */
                                fcurve= fcu;
                                
                        /* set path */
-                       fcurve->rna_path= BLI_strdupn(abp->path, strlen(abp->path));
+                       fcurve->rna_path= BLI_strdup(abp->path);
                        fcurve->array_index= abp->array_index;
                        
                        /* convert keyframes 
                        fcurve->array_index= abp->array_index;
                        
                        /* convert keyframes 
@@ -1225,7 +1232,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                                fcurve->bezt= MEM_callocN(sizeof(BezTriple)*fcurve->totvert, "BezTriples");
                                
                                /* loop through copying all BezTriples individually, as we need to modify a few things */
                                fcurve->bezt= MEM_callocN(sizeof(BezTriple)*fcurve->totvert, "BezTriples");
                                
                                /* loop through copying all BezTriples individually, as we need to modify a few things */
-                               for (dst=fcurve->bezt, src=icu->bezt; i < fcurve->totvert; i++, dst++, src++) {
+                               for (dst=fcurve->bezt, src=icu->bezt, i=0; i < fcurve->totvert; i++, dst++, src++) {
                                        /* firstly, copy BezTriple data */
                                        *dst= *src;
                                        
                                        /* firstly, copy BezTriple data */
                                        *dst= *src;
                                        
@@ -1253,10 +1260,12 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                }
        }
        else {
                }
        }
        else {
+               unsigned int i=0;
+               
                /* get rna-path
                 *      - we will need to set the 'disabled' flag if no path is able to be made (for now)
                 */
                /* get rna-path
                 *      - we will need to set the 'disabled' flag if no path is able to be made (for now)
                 */
-               fcu->rna_path= get_rna_access(icu->blocktype, icu->adrcode, actname, constname, &fcu->array_index);
+               fcu->rna_path= get_rna_access(icu->blocktype, icu->adrcode, actname, constname, seq, &fcu->array_index);
                if (fcu->rna_path == NULL)
                        fcu->flag |= FCURVE_DISABLED;
                
                if (fcu->rna_path == NULL)
                        fcu->flag |= FCURVE_DISABLED;
                
@@ -1273,7 +1282,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                        fcu->bezt= MEM_callocN(sizeof(BezTriple)*fcu->totvert, "BezTriples");
                        
                        /* loop through copying all BezTriples individually, as we need to modify a few things */
                        fcu->bezt= MEM_callocN(sizeof(BezTriple)*fcu->totvert, "BezTriples");
                        
                        /* loop through copying all BezTriples individually, as we need to modify a few things */
-                       for (dst=fcu->bezt, src=icu->bezt; i < fcu->totvert; i++, dst++, src++) {
+                       for (dst=fcu->bezt, src=icu->bezt, i=0; i < fcu->totvert; i++, dst++, src++) {
                                /* firstly, copy BezTriple data */
                                *dst= *src;
                                
                                /* firstly, copy BezTriple data */
                                *dst= *src;
                                
@@ -1298,22 +1307,52 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
                                        dst->vec[2][1] *= fac;
                                }
                                
                                        dst->vec[2][1] *= fac;
                                }
                                
+                               /* correct values for path speed curves 
+                                *      - their values were 0-1
+                                *      - we now need as 'frames'
+                                */
+                               if ( (id) && (icu->blocktype == GS(id->name)) && 
+                                        (fcu->rna_path && strcmp(fcu->rna_path, "eval_time")==0) )
+                               {
+                                       Curve *cu = (Curve *)id;
+                                       
+                                       dst->vec[0][1] *= cu->pathlen;
+                                       dst->vec[1][1] *= cu->pathlen;
+                                       dst->vec[2][1] *= cu->pathlen;
+                               }
+                               
                                /* correct times for rotation drivers 
                                 *      - need to go from degrees to radians...
                                 *      - there's only really 1 target to worry about 
                                /* correct times for rotation drivers 
                                 *      - need to go from degrees to radians...
                                 *      - there's only really 1 target to worry about 
+                                *  - were also degrees/10
                                 */
                                if (fcu->driver && fcu->driver->variables.first) {
                                        DriverVar *dvar= fcu->driver->variables.first;
                                        DriverTarget *dtar= &dvar->targets[0];
                                        
                                        if (ELEM3(dtar->transChan, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ)) {
                                 */
                                if (fcu->driver && fcu->driver->variables.first) {
                                        DriverVar *dvar= fcu->driver->variables.first;
                                        DriverTarget *dtar= &dvar->targets[0];
                                        
                                        if (ELEM3(dtar->transChan, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ)) {
-                                               const float fac= (float)M_PI / 180.0f;
+                                               const float fac= (float)M_PI / 18.0f;
                                                
                                                dst->vec[0][0] *= fac;
                                                dst->vec[1][0] *= fac;
                                                dst->vec[2][0] *= fac;
                                        }
                                }
                                                
                                                dst->vec[0][0] *= fac;
                                                dst->vec[1][0] *= fac;
                                                dst->vec[2][0] *= fac;
                                        }
                                }
+                               
+                               /* correct values for sequencer curves, that were not locked to frame */
+                               if (seq && (seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) {
+                                       double mul= (seq->enddisp-seq->startdisp)/100.0f;
+                                       double offset= seq->startdisp;
+                                       
+                                       dst->vec[0][0] *= mul;
+                                       dst->vec[0][0] += offset;
+                                       
+                                       dst->vec[1][0] *= mul;
+                                       dst->vec[1][0] += offset;
+                                       
+                                       dst->vec[2][0] *= mul;
+                                       dst->vec[2][0] += offset;
+                               }
                        }
                }
                else if (icu->bp) {
                        }
                }
                else if (icu->bp) {
@@ -1333,7 +1372,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha
  * This does not assume that any ID or AnimData uses it, but does assume that
  * it is given two lists, which it will perform driver/animation-data separation.
  */
  * This does not assume that any ID or AnimData uses it, but does assume that
  * it is given two lists, which it will perform driver/animation-data separation.
  */
-static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase *animgroups, ListBase *anim, ListBase *drivers)
+static void ipo_to_animato (ID *id, Ipo *ipo, char actname[], char constname[], Sequence * seq, ListBase *animgroups, ListBase *anim, ListBase *drivers)
 {
        IpoCurve *icu;
        
 {
        IpoCurve *icu;
        
@@ -1364,7 +1403,7 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase
                if (icu->driver) {
                        /* Blender 2.4x allowed empty drivers, but we don't now, since they cause more trouble than they're worth */
                        if ((icu->driver->ob) || (icu->driver->type == IPO_DRIVER_TYPE_PYTHON)) {
                if (icu->driver) {
                        /* Blender 2.4x allowed empty drivers, but we don't now, since they cause more trouble than they're worth */
                        if ((icu->driver->ob) || (icu->driver->type == IPO_DRIVER_TYPE_PYTHON)) {
-                               icu_to_fcurves(NULL, drivers, icu, actname, constname, ipo->muteipo);
+                               icu_to_fcurves(id, NULL, drivers, icu, actname, constname, seq, ipo->muteipo);
                        }
                        else {
                                MEM_freeN(icu->driver);
                        }
                        else {
                                MEM_freeN(icu->driver);
@@ -1372,7 +1411,7 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase
                        }
                }
                else
                        }
                }
                else
-                       icu_to_fcurves(animgroups, anim, icu, actname, constname, ipo->muteipo);
+                       icu_to_fcurves(id, animgroups, anim, icu, actname, constname, seq, ipo->muteipo);
        }
        
        /* if this IPO block doesn't have any users after this one, free... */
        }
        
        /* if this IPO block doesn't have any users after this one, free... */
@@ -1403,7 +1442,7 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase
  * to Objects, where ob->ipo and ob->action need to be combined).
  * NOTE: we need to be careful here, as same data-structs are used for new system too!
  */
  * to Objects, where ob->ipo and ob->action need to be combined).
  * NOTE: we need to be careful here, as same data-structs are used for new system too!
  */
-static void action_to_animato (bAction *act, ListBase *groups, ListBase *curves, ListBase *drivers)
+static void action_to_animato (ID *id, bAction *act, ListBase *groups, ListBase *curves, ListBase *drivers)
 {
        bActionChannel *achan, *achann;
        bConstraintChannel *conchan, *conchann;
 {
        bActionChannel *achan, *achann;
        bConstraintChannel *conchan, *conchann;
@@ -1424,7 +1463,7 @@ static void action_to_animato (bAction *act, ListBase *groups, ListBase *curves,
                
                /* convert Action Channel's IPO data */
                if (achan->ipo) {
                
                /* convert Action Channel's IPO data */
                if (achan->ipo) {
-                       ipo_to_animato(achan->ipo, achan->name, NULL, groups, curves, drivers);
+                       ipo_to_animato(id, achan->ipo, achan->name, NULL, NULL, groups, curves, drivers);
                        achan->ipo->id.us--;
                        achan->ipo= NULL;
                }
                        achan->ipo->id.us--;
                        achan->ipo= NULL;
                }
@@ -1436,7 +1475,7 @@ static void action_to_animato (bAction *act, ListBase *groups, ListBase *curves,
                        
                        /* convert Constraint Channel's IPO data */
                        if (conchan->ipo) {
                        
                        /* convert Constraint Channel's IPO data */
                        if (conchan->ipo) {
-                               ipo_to_animato(conchan->ipo, achan->name, conchan->name, groups, curves, drivers);
+                               ipo_to_animato(id, conchan->ipo, achan->name, conchan->name, NULL, groups, curves, drivers);
                                conchan->ipo->id.us--;
                                conchan->ipo= NULL;
                        }
                                conchan->ipo->id.us--;
                                conchan->ipo= NULL;
                        }
@@ -1457,7 +1496,7 @@ static void action_to_animato (bAction *act, ListBase *groups, ListBase *curves,
  * This assumes that AnimData has been added already. Separation of drivers
  * from animation data is accomplished here too...
  */
  * This assumes that AnimData has been added already. Separation of drivers
  * from animation data is accomplished here too...
  */
-static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[])
+static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq)
 {
        AnimData *adt= BKE_animdata_from_id(id);
        ListBase anim = {NULL, NULL};
 {
        AnimData *adt= BKE_animdata_from_id(id);
        ListBase anim = {NULL, NULL};
@@ -1472,8 +1511,8 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[])
        }
        
        if (G.f & G_DEBUG) {
        }
        
        if (G.f & G_DEBUG) {
-               printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s  curves:%d \n", 
-                       id->name+2, ipo->id.name+2, (actname)?actname:"<None>", (constname)?constname:"<None>", 
+               printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s  curves:%d \n", 
+                      id->name+2, ipo->id.name+2, (actname)?actname:"<None>", (constname)?constname:"<None>", (seq)?(seq->name+2):"<None>",
                        BLI_countlist(&ipo->curve));
        }
        
                        BLI_countlist(&ipo->curve));
        }
        
@@ -1481,26 +1520,30 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[])
         * and the try to put these lists in the right places, but do not free the lists here
         */
        // XXX there shouldn't be any need for the groups, so don't supply pointer for that now... 
         * and the try to put these lists in the right places, but do not free the lists here
         */
        // XXX there shouldn't be any need for the groups, so don't supply pointer for that now... 
-       ipo_to_animato(ipo, actname, constname, NULL, &anim, &drivers);
+       ipo_to_animato(id, ipo, actname, constname, seq, NULL, &anim, &drivers);
        
        /* deal with animation first */
        if (anim.first) {
                if (G.f & G_DEBUG) printf("\thas anim \n");
                /* try to get action */
                if (adt->action == NULL) {
        
        /* deal with animation first */
        if (anim.first) {
                if (G.f & G_DEBUG) printf("\thas anim \n");
                /* try to get action */
                if (adt->action == NULL) {
-                       adt->action= add_empty_action("ConvData_Action"); // XXX we need a better name for this
-                       if (G.f & G_DEBUG) printf("\t\tadded new action \n");
+                       char nameBuf[MAX_ID_NAME];
+                       
+                       BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name+2);
+                       
+                       adt->action= add_empty_action(nameBuf);
+                       if (G.f & G_DEBUG) printf("\t\tadded new action - '%s' \n", nameBuf);
                }
                
                /* add F-Curves to action */
                }
                
                /* add F-Curves to action */
-               addlisttolist(&adt->action->curves, &anim);
+               BLI_movelisttolist(&adt->action->curves, &anim);
        }
        
        /* deal with drivers */
        if (drivers.first) {
                if (G.f & G_DEBUG) printf("\thas drivers \n");
                /* add drivers to end of driver stack */
        }
        
        /* deal with drivers */
        if (drivers.first) {
                if (G.f & G_DEBUG) printf("\thas drivers \n");
                /* add drivers to end of driver stack */
-               addlisttolist(&adt->drivers, &drivers);
+               BLI_movelisttolist(&adt->drivers, &drivers);
        }
 }
 
        }
 }
 
@@ -1523,7 +1566,7 @@ static void action_to_animdata (ID *id, bAction *act)
        }
        
        /* convert Action data */
        }
        
        /* convert Action data */
-       action_to_animato(act, &adt->action->groups, &adt->action->curves, &adt->drivers);
+       action_to_animato(id, act, &adt->action->groups, &adt->action->curves, &adt->drivers);
 }
 
 /* ------------------------- */
 }
 
 /* ------------------------- */
@@ -1547,7 +1590,7 @@ static void nlastrips_to_animdata (ID *id, ListBase *strips)
                /* this old strip is only worth something if it had an action... */
                if (as->act) {
                        /* convert Action data (if not yet converted), storing the results in the same Action */
                /* this old strip is only worth something if it had an action... */
                if (as->act) {
                        /* convert Action data (if not yet converted), storing the results in the same Action */
-                       action_to_animato(as->act, &as->act->groups, &as->act->curves, &adt->drivers);
+                       action_to_animato(id, as->act, &as->act->groups, &as->act->curves, &adt->drivers);
                        
                        /* create a new-style NLA-strip which references this Action, then copy over relevant settings */
                        {
                        
                        /* create a new-style NLA-strip which references this Action, then copy over relevant settings */
                        {
@@ -1626,7 +1669,6 @@ void do_versions_ipos_to_animato(Main *main)
        ListBase drivers = {NULL, NULL};
        ID *id;
        AnimData *adt;
        ListBase drivers = {NULL, NULL};
        ID *id;
        AnimData *adt;
-       Scene *scene;
        
        if (main == NULL) {
                printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
        
        if (main == NULL) {
                printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
@@ -1634,13 +1676,12 @@ void do_versions_ipos_to_animato(Main *main)
        }
                
        /* only convert if version is right */
        }
                
        /* only convert if version is right */
-       // XXX???
        if (main->versionfile >= 250) {
                printf("WARNING: Animation data too new to convert (Version %d) \n", main->versionfile);
                return;
        }
        if (main->versionfile >= 250) {
                printf("WARNING: Animation data too new to convert (Version %d) \n", main->versionfile);
                return;
        }
-       else
-               printf("INFO: Converting to Animato... \n"); // xxx debug
+       else if (G.f & G_DEBUG)
+               printf("INFO: Converting to Animato... \n");
                
        /* ----------- Animation Attached to Data -------------- */
        
                
        /* ----------- Animation Attached to Data -------------- */
        
@@ -1660,7 +1701,7 @@ void do_versions_ipos_to_animato(Main *main)
                        
                        /* IPO first to take into any non-NLA'd Object Animation */
                        if (ob->ipo) {
                        
                        /* IPO first to take into any non-NLA'd Object Animation */
                        if (ob->ipo) {
-                               ipo_to_animdata(id, ob->ipo, NULL, NULL);
+                               ipo_to_animdata(id, ob->ipo, NULL, NULL, NULL);
                                
                                ob->ipo->id.us--;
                                ob->ipo= NULL;
                                
                                ob->ipo->id.us--;
                                ob->ipo= NULL;
@@ -1694,7 +1735,7 @@ void do_versions_ipos_to_animato(Main *main)
                        
                        /* IPO second... */
                        if (ob->ipo) {
                        
                        /* IPO second... */
                        if (ob->ipo) {
-                               ipo_to_animdata(id, ob->ipo, NULL, NULL);
+                               ipo_to_animdata(id, ob->ipo, NULL, NULL, NULL);
                                ob->ipo->id.us--;
                                ob->ipo= NULL;
                        }
                                ob->ipo->id.us--;
                                ob->ipo= NULL;
                        }
@@ -1714,7 +1755,7 @@ void do_versions_ipos_to_animato(Main *main)
                                                /* although this was the constraint's local IPO, we still need to provide pchan + con 
                                                 * so that drivers can be added properly...
                                                 */
                                                /* although this was the constraint's local IPO, we still need to provide pchan + con 
                                                 * so that drivers can be added properly...
                                                 */
-                                               ipo_to_animdata(id, con->ipo, pchan->name, con->name);
+                                               ipo_to_animdata(id, con->ipo, pchan->name, con->name, NULL);
                                                con->ipo->id.us--;
                                                con->ipo= NULL;
                                        }
                                                con->ipo->id.us--;
                                                con->ipo= NULL;
                                        }
@@ -1734,7 +1775,7 @@ void do_versions_ipos_to_animato(Main *main)
                                /* although this was the constraint's local IPO, we still need to provide con 
                                 * so that drivers can be added properly...
                                 */
                                /* although this was the constraint's local IPO, we still need to provide con 
                                 * so that drivers can be added properly...
                                 */
-                               ipo_to_animdata(id, con->ipo, NULL, con->name);
+                               ipo_to_animdata(id, con->ipo, NULL, con->name, NULL);
                                con->ipo->id.us--;
                                con->ipo= NULL;
                        }
                                con->ipo->id.us--;
                                con->ipo= NULL;
                        }
@@ -1754,7 +1795,7 @@ void do_versions_ipos_to_animato(Main *main)
                                
                                /* convert Constraint Channel's IPO data */
                                if (conchan->ipo) {
                                
                                /* convert Constraint Channel's IPO data */
                                if (conchan->ipo) {
-                                       ipo_to_animdata(id, conchan->ipo, NULL, conchan->name);
+                                       ipo_to_animdata(id, conchan->ipo, NULL, conchan->name, NULL);
                                        conchan->ipo->id.us--;
                                        conchan->ipo= NULL;
                                }
                                        conchan->ipo->id.us--;
                                        conchan->ipo= NULL;
                                }
@@ -1780,7 +1821,7 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Shapekey data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Shapekey data... */
-                       ipo_to_animdata(id, key->ipo, NULL, NULL);
+                       ipo_to_animdata(id, key->ipo, NULL, NULL, NULL);
                        key->ipo->id.us--;
                        key->ipo= NULL;
                }
                        key->ipo->id.us--;
                        key->ipo= NULL;
                }
@@ -1798,7 +1839,7 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Material data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Material data... */
-                       ipo_to_animdata(id, ma->ipo, NULL, NULL);
+                       ipo_to_animdata(id, ma->ipo, NULL, NULL, NULL);
                        ma->ipo->id.us--;
                        ma->ipo= NULL;
                }
                        ma->ipo->id.us--;
                        ma->ipo= NULL;
                }
@@ -1816,27 +1857,30 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert World data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert World data... */
-                       ipo_to_animdata(id, wo->ipo, NULL, NULL);
+                       ipo_to_animdata(id, wo->ipo, NULL, NULL, NULL);
                        wo->ipo->id.us--;
                        wo->ipo= NULL;
                }
        }
        
        /* sequence strips */
                        wo->ipo->id.us--;
                        wo->ipo= NULL;
                }
        }
        
        /* sequence strips */
-       for(scene = main->scene.first; scene; scene = scene->id.next) {
-               if(scene->ed && scene->ed->seqbasep) {
+       for (id= main->scene.first; id; id= id->next) {
+               Scene *scene = (Scene *)id;
+               Editing * ed = scene->ed;
+               if (ed && ed->seqbasep) {
                        Sequence * seq;
                        
                        Sequence * seq;
                        
-                       for(seq = scene->ed->seqbasep->first; 
-                           seq; seq = seq->next) {
+                       adt= BKE_id_add_animdata(id);
+                       
+                       SEQ_BEGIN(ed, seq) {
+                               IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL;
                                short adrcode = SEQ_FAC1;
                                
                                if (G.f & G_DEBUG) 
                                        printf("\tconverting sequence strip %s \n", seq->name+2);
                                
                                short adrcode = SEQ_FAC1;
                                
                                if (G.f & G_DEBUG) 
                                        printf("\tconverting sequence strip %s \n", seq->name+2);
                                
-                               if (!seq->ipo || !seq->ipo->curve.first) {
-                                       seq->flag |= 
-                                               SEQ_USE_EFFECT_DEFAULT_FADE;
+                               if (ELEM(NULL, seq->ipo, icu)) {
+                                       seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
                                        continue;
                                }
                                
                                        continue;
                                }
                                
@@ -1844,25 +1888,26 @@ void do_versions_ipos_to_animato(Main *main)
                                   to different DNA variables later 
                                   (semi-hack (tm) )
                                */
                                   to different DNA variables later 
                                   (semi-hack (tm) )
                                */
-                               switch(seq->type) {
-                               case SEQ_IMAGE:
-                               case SEQ_META:
-                               case SEQ_SCENE:
-                               case SEQ_MOVIE:
-                               case SEQ_COLOR:
-                                       adrcode = SEQ_FAC_OPACITY;
-                                       break;
-                               case SEQ_SPEED:
-                                       adrcode = SEQ_FAC_SPEED;
-                                       break;
+                               switch (seq->type) {
+                                       case SEQ_IMAGE:
+                                       case SEQ_META:
+                                       case SEQ_SCENE:
+                                       case SEQ_MOVIE:
+                                       case SEQ_COLOR:
+                                               adrcode = SEQ_FAC_OPACITY;
+                                               break;
+                                       case SEQ_SPEED:
+                                               adrcode = SEQ_FAC_SPEED;
+                                               break;
                                }
                                }
-                               ((IpoCurve*) seq->ipo->curve.first)
-                                       ->adrcode = adrcode;
-                               ipo_to_animdata((ID*) seq, seq->ipo,
-                                               NULL, NULL);
+                               icu->adrcode = adrcode;
+                               
+                               /* convert IPO */
+                               ipo_to_animdata((ID *)scene, seq->ipo, NULL, NULL, seq);
                                seq->ipo->id.us--;
                                seq->ipo = NULL;
                        }
                                seq->ipo->id.us--;
                                seq->ipo = NULL;
                        }
+                       SEQ_END
                }
        }
 
                }
        }
 
@@ -1879,7 +1924,7 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Texture data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Texture data... */
-                       ipo_to_animdata(id, te->ipo, NULL, NULL);
+                       ipo_to_animdata(id, te->ipo, NULL, NULL, NULL);
                        te->ipo->id.us--;
                        te->ipo= NULL;
                }
                        te->ipo->id.us--;
                        te->ipo= NULL;
                }
@@ -1897,7 +1942,7 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Camera data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Camera data... */
-                       ipo_to_animdata(id, ca->ipo, NULL, NULL);
+                       ipo_to_animdata(id, ca->ipo, NULL, NULL, NULL);
                        ca->ipo->id.us--;
                        ca->ipo= NULL;
                }
                        ca->ipo->id.us--;
                        ca->ipo= NULL;
                }
@@ -1915,12 +1960,30 @@ void do_versions_ipos_to_animato(Main *main)
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Lamp data... */
                        adt= BKE_id_add_animdata(id);
                        
                        /* Convert Lamp data... */
-                       ipo_to_animdata(id, la->ipo, NULL, NULL);
+                       ipo_to_animdata(id, la->ipo, NULL, NULL, NULL);
                        la->ipo->id.us--;
                        la->ipo= NULL;
                }
        }
        
                        la->ipo->id.us--;
                        la->ipo= NULL;
                }
        }
        
+       /* curves */
+       for (id= main->curve.first; id; id= id->next) {
+               Curve *cu= (Curve *)id;
+               
+               if (G.f & G_DEBUG) printf("\tconverting curve %s \n", id->name+2);
+               
+               /* we're only interested in the IPO */
+               if (cu->ipo) {
+                       /* Add AnimData block */
+                       adt= BKE_id_add_animdata(id);
+                       
+                       /* Convert Curve data... */
+                       ipo_to_animdata(id, cu->ipo, NULL, NULL, NULL);
+                       cu->ipo->id.us--;
+                       cu->ipo= NULL;
+               }
+       }
+       
        /* --------- Unconverted Animation Data ------------------ */
        /* For Animation data which may not be directly connected (i.e. not linked) to any other 
         * data, we need to perform a separate pass to make sure that they are converted to standalone
        /* --------- Unconverted Animation Data ------------------ */
        /* For Animation data which may not be directly connected (i.e. not linked) to any other 
         * data, we need to perform a separate pass to make sure that they are converted to standalone
@@ -1939,7 +2002,7 @@ void do_versions_ipos_to_animato(Main *main)
                if (G.f & G_DEBUG) printf("\tconverting action %s \n", id->name+2);
                
                /* be careful! some of the actions we encounter will be converted ones... */
                if (G.f & G_DEBUG) printf("\tconverting action %s \n", id->name+2);
                
                /* be careful! some of the actions we encounter will be converted ones... */
-               action_to_animato(act, &act->groups, &act->curves, &drivers);
+               action_to_animato(NULL, act, &act->groups, &act->curves, &drivers);
        }
        
        /* ipo's */
        }
        
        /* ipo's */
@@ -1954,7 +2017,7 @@ void do_versions_ipos_to_animato(Main *main)
                        
                        /* add a new action for this, and convert all data into that action */
                        new_act= add_empty_action("ConvIPO_Action"); // XXX need a better name...
                        
                        /* add a new action for this, and convert all data into that action */
                        new_act= add_empty_action("ConvIPO_Action"); // XXX need a better name...
-                       ipo_to_animato(ipo, NULL, NULL, NULL, &new_act->curves, &drivers);
+                       ipo_to_animato(NULL, ipo, NULL, NULL, NULL, NULL, &new_act->curves, &drivers);
                }
                
                /* clear fake-users, and set user-count to zero to make sure it is cleared on file-save */
                }
                
                /* clear fake-users, and set user-count to zero to make sure it is cleared on file-save */
@@ -1965,6 +2028,7 @@ void do_versions_ipos_to_animato(Main *main)
        /* free unused drivers from actions + ipos */
        free_fcurves(&drivers);
        
        /* free unused drivers from actions + ipos */
        free_fcurves(&drivers);
        
-       printf("INFO: Animato convert done \n"); // xxx debug
+       if (G.f & G_DEBUG)
+               printf("INFO: Animato convert done \n");
 }
 
 }