2.5: warning fixes
[blender.git] / source / blender / editors / transform / transform_conversions.c
index 4c91ca9af4aa9996622f44a3b174a60c8a41db79..be677c8523d29ea69cffa0e2727158f90d8cd007 100644 (file)
@@ -1217,8 +1217,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t)
 
 static void createTransMBallVerts(bContext *C, TransInfo *t)
 {
-       // TRANSFORM_FIX_ME
-#if 0
+       MetaBall *mb = (MetaBall*)t->obedit->data;
        MetaElem *ml;
        TransData *td;
        TransDataExtension *tx;
@@ -1227,7 +1226,7 @@ static void createTransMBallVerts(bContext *C, TransInfo *t)
        int propmode = t->flag & T_PROP_EDIT;
 
        /* count totals */
-       for(ml= editelems.first; ml; ml= ml->next) {
+       for(ml= mb->editelems->first; ml; ml= ml->next) {
                if(ml->flag & SELECT) countsel++;
                if(propmode) count++;
        }
@@ -1244,7 +1243,7 @@ static void createTransMBallVerts(bContext *C, TransInfo *t)
        Mat3CpyMat4(mtx, t->obedit->obmat);
        Mat3Inv(smtx, mtx);
 
-       for(ml= editelems.first; ml; ml= ml->next) {
+       for(ml= mb->editelems->first; ml; ml= ml->next) {
                if(propmode || (ml->flag & SELECT)) {
                        td->loc= &ml->x;
                        VECCOPY(td->iloc, td->loc);
@@ -1285,7 +1284,6 @@ static void createTransMBallVerts(bContext *C, TransInfo *t)
                        tx++;
                }
        }
-#endif
 }
 
 /* ********************* curve/surface ********* */
@@ -2416,7 +2414,7 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f
 
 static void createTransUVs(bContext *C, TransInfo *t)
 {
-       SpaceImage *sima = (SpaceImage*)CTX_wm_space_data(C);
+       SpaceImage *sima = CTX_wm_space_image(C);
        Image *ima = CTX_data_edit_image(C);
        Scene *scene = CTX_data_scene(C);
        TransData *td = NULL;
@@ -4779,7 +4777,6 @@ void special_aftertrans_update(TransInfo *t)
                        /* get channels to work on */
                        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
                        
-                       /* these should all be ipo-blocks */
                        for (ale= anim_data.first; ale; ale= ale->next) {
                                AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
                                FCurve *fcu= (FCurve *)ale->key_data;
@@ -4826,43 +4823,26 @@ void special_aftertrans_update(TransInfo *t)
                {
                        ListBase anim_data = {NULL, NULL};
                        bAnimListElem *ale;
+                       short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS);
                        
-                       /* firstly, make the strips normal again */
-                       {
-                               short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS);
-                               
-                               /* get channels to work on */
-                               ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+                       /* get channels to work on */
+                       ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+                       
+                       for (ale= anim_data.first; ale; ale= ale->next) {
+                               NlaTrack *nlt= (NlaTrack *)ale->data;
                                
-                               for (ale= anim_data.first; ale; ale= ale->next) {
-                                       NlaTrack *nlt= (NlaTrack *)ale->data;
-                                       
-                                       /* make sure strips are in order again */
-                                       BKE_nlatrack_sort_strips(nlt);
-                                       
-                                       /* remove the temp metas */
-                                       BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
-                               }
+                               /* make sure strips are in order again */
+                               BKE_nlatrack_sort_strips(nlt);
                                
-                               /* free temp memory */
-                               BLI_freelistN(&anim_data);
+                               /* remove the temp metas */
+                               BKE_nlastrips_clear_metas(&nlt->strips, 0, 1);
                        }
                        
+                       /* free temp memory */
+                       BLI_freelistN(&anim_data);
+                       
                        /* perform after-transfrom validation */
-                       {
-                               short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_FOREDIT);
-                               
-                               /* get blocks to work on */
-                               ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
-                               
-                               for (ale= anim_data.first; ale; ale= ale->next) {
-                                       /* performing auto-blending, extend-mode validation, etc. */
-                                       BKE_nla_validate_state(ale->data);
-                               }
-                               
-                               /* free temp memory */
-                               BLI_freelistN(&anim_data);
-                       }
+                       ED_nla_postop_refresh(&ac);
                }
        }
        else if (t->obedit) {
@@ -4977,9 +4957,9 @@ static void createTransObject(bContext *C, TransInfo *t)
        set_trans_object_base_flags(C, t);
 
        /* count */
+#if 0 // TRANSFORM_FIX_ME
        CTX_DATA_BEGIN(C, Object*, ob, selected_objects)
        {
-#if 0 // TRANSFORM_FIX_ME
                /* store ipo keys? */
                if ((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
                        elems.first= elems.last= NULL;
@@ -4993,12 +4973,14 @@ static void createTransObject(bContext *C, TransInfo *t)
                        if(elems.first==NULL)
                                t->total++;
                }
-#endif
 //             else {
                        t->total++;
 //             }
        }
        CTX_DATA_END;
+#else
+       t->total= CTX_DATA_COUNT(C, selected_objects);
+#endif
 
        if(!t->total) {
                /* clear here, main transform function escapes too */