Patch #34204: [Render Animation] Fails with "Error: Specified sample_fmt is not suppo...
[blender.git] / source / blender / blenkernel / intern / ipo.c
index b2a9e22..c536474 100644 (file)
@@ -32,7 +32,7 @@
 
 /* NOTE:
  *
- * This file is no longer used to provide tools for the depreceated IPO system. Instead, it
+ * This file is no longer used to provide tools for the deprecated IPO system. Instead, it
  * is only used to house the conversion code to the new system.
  *
  * -- Joshua Leung, Jan 2009
@@ -569,7 +569,7 @@ static const char *material_adrcodes_to_paths(int adrcode, int *array_index)
                        return mtex_adrcodes_to_paths(adrcode, array_index);
        }
        
-       return NULL;    
+       return NULL;
 }
 
 /* Camera Types */
@@ -727,7 +727,7 @@ static const char *world_adrcodes_to_paths(int adrcode, int *array_index)
                        return mtex_adrcodes_to_paths(adrcode, array_index);
        }
                
-       return NULL;    
+       return NULL;
 }
 
 /* Particle Types */
@@ -873,7 +873,7 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con
                        propname = "eval_time";
                        break;
                
-               /* XXX problematic blocktypes */                
+               /* XXX problematic blocktypes */
                case ID_SEQ: /* sequencer strip */
                        //SEQ_FAC1:
                        switch (adrcode) {
@@ -981,21 +981,21 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con
 static short adrcode_to_dtar_transchan(short adrcode)
 {
        switch (adrcode) {
-               case OB_LOC_X:  
+               case OB_LOC_X:
                        return DTAR_TRANSCHAN_LOCX;
                case OB_LOC_Y:
                        return DTAR_TRANSCHAN_LOCY;
                case OB_LOC_Z:
                        return DTAR_TRANSCHAN_LOCZ;
                
-               case OB_ROT_X:  
+               case OB_ROT_X:
                        return DTAR_TRANSCHAN_ROTX;
                case OB_ROT_Y:
                        return DTAR_TRANSCHAN_ROTY;
                case OB_ROT_Z:
                        return DTAR_TRANSCHAN_ROTZ;
                
-               case OB_SIZE_X: 
+               case OB_SIZE_X:
                        return DTAR_TRANSCHAN_SCALEX;
                case OB_SIZE_Y:
                        return DTAR_TRANSCHAN_SCALEX;
@@ -1359,8 +1359,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
                                
                                /* 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;
+                                       const float mul = (seq->enddisp - seq->startdisp) / 100.0f;
+                                       const float offset = seq->startdisp;
                                        
                                        dst->vec[0][0] *= mul;
                                        dst->vec[0][0] += offset;
@@ -1548,7 +1548,7 @@ static void ipo_to_animdata(ID *id, Ipo *ipo, char actname[], char constname[],
                        
                        BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name + 2);
                        
-                       adt->action = add_empty_action(nameBuf);
+                       adt->action = add_empty_action(G.main, nameBuf);
                        if (G.debug & G_DEBUG) printf("\t\tadded new action - '%s'\n", nameBuf);
                }
                
@@ -1645,7 +1645,7 @@ static void nlastrips_to_animdata(ID *id, ListBase *strips)
                                /* by default, we now always extrapolate, while in the past this was optional */
                                if ((as->flag & ACTSTRIP_HOLDLASTFRAME) == 0)
                                        strip->extendmode = NLASTRIP_EXTEND_NOTHING;
-                       }       
+                       }
                        
                        /* try to add this strip to the current NLA-Track (i.e. the 'last' one on the stack atm) */
                        if (BKE_nlatrack_add_strip(nlt, strip) == 0) {
@@ -1757,15 +1757,15 @@ void do_versions_ipos_to_animato(Main *main)
 
                                {
                                        /* If we have any empty action actuators, assume they were
-                                          converted IPO Actuators using the object IPO */
+                                        * converted IPO Actuators using the object IPO */
                                        bActuator *act;
                                        bActionActuator *aa;
 
                                        for (act = ob->actuators.first; act; act = act->next) {
                                                /* Any actuators set to ACT_IPO at this point are actually Action Actuators that
-                                                  need this converted IPO to finish converting the actuator. */
+                                                * need this converted IPO to finish converting the actuator. */
                                                if (act->type == ACT_IPO) {
-                                                       aa = (bActionActuator*)act->data;
+                                                       aa = (bActionActuator *)act->data;
                                                        aa->act = ob->adt->action;
                                                        act->type = ACT_ACTION;
                                                }
@@ -2093,7 +2093,7 @@ void do_versions_ipos_to_animato(Main *main)
                        bAction *new_act;
                        
                        /* add a new action for this, and convert all data into that action */
-                       new_act = add_empty_action(id->name+2);
+                       new_act = add_empty_action(main, id->name + 2);
                        ipo_to_animato(NULL, ipo, NULL, NULL, NULL, NULL, &new_act->curves, &drivers);
                        new_act->idroot = ipo->blocktype;
                }