~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/editipo_mods.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
695
695
}
696
696
 
697
697
/* currently only used by some action editor tools, but may soon get used by ipo editor */
698
 
void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore)
 
698
/* restore = whether to map points back to ipo-time 
 
699
 * only_keys = whether to only adjust the location of the center point of beztriples
 
700
 */
 
701
void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore, short only_keys)
699
702
{
700
703
        IpoCurve *icu;
701
704
        BezTriple *bezt;
702
705
        int a;
703
706
        
 
707
        if (ipo==NULL) return;
 
708
        
704
709
        /* loop through all ipo curves, adjusting the times of the selected keys */
705
710
        for (icu= ipo->curve.first; icu; icu= icu->next) {
706
711
                for (a=0, bezt=icu->bezt; a<icu->totvert; a++, bezt++) {
707
712
                        /* are the times being adjusted for editing, or has editing finished */
708
 
                        if (restore) 
 
713
                        if (restore) {
 
714
                                if (only_keys == 0) {
 
715
                                        bezt->vec[0][0]= get_action_frame(ob, bezt->vec[0][0]);
 
716
                                        bezt->vec[2][0]= get_action_frame(ob, bezt->vec[2][0]);
 
717
                                }                                       
709
718
                                bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]);
710
 
                        else
 
719
                        }
 
720
                        else {
 
721
                                if (only_keys == 0) {
 
722
                                        bezt->vec[0][0]= get_action_frame_inv(ob, bezt->vec[0][0]);
 
723
                                        bezt->vec[2][0]= get_action_frame_inv(ob, bezt->vec[2][0]);
 
724
                                }
711
725
                                bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]);
 
726
                        }
712
727
                }
713
728
        }
714
729
}
894
909
        val= get_border(&rect, 3);
895
910
 
896
911
        if(val) {
 
912
                /* map ipo-points for editing if scaled ipo */
 
913
                if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) {
 
914
                        actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
 
915
                }
 
916
                
897
917
                mval[0]= rect.xmin;
898
918
                mval[1]= rect.ymin;
899
919
                areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
940
960
                                }
941
961
                        }
942
962
                }
 
963
                
 
964
                /* undo mapping of ipo-points for drawing if scaled ipo */
 
965
                if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) {
 
966
                        actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
 
967
                }
 
968
                
943
969
                BIF_undo_push("Border select Ipo");
944
970
                allqueue(REDRAWIPO, 0);
945
971
                allqueue(REDRAWACTION, 0);
1020
1046
        IpoKey *ik;
1021
1047
        int a;
1022
1048
        
 
1049
        if (!G.vd) {
 
1050
                error("Can't do this! Open a 3D window");
 
1051
                return;
 
1052
        }
 
1053
        
1023
1054
        /* problem: this doesnt work when you mix dLoc keys with Loc keys */
1024
1055
        
1025
1056
        base= FIRSTBASE;
1112
1143
        if (!ipo)
1113
1144
                return tvtot;
1114
1145
        
1115
 
        for (icu=ipo->curve.first; icu; icu=icu->next){
 
1146
        for (icu=ipo->curve.first; icu; icu=icu->next) {
1116
1147
                for (i=0; i<icu->totvert; i++){
1117
1148
                        if (icu->bezt[i].f2 & 1){
1118
1149
                                tvtot+=3;
1151
1182
void borderselect_ipo_key(Ipo *ipo, float xmin, float xmax, int selectmode)
1152
1183
{
1153
1184
        /* Selects all bezier triples in each Ipocurve of the
1154
 
        * Ipo between times xmin and xmax, using the selection mode.
1155
 
        */
 
1185
         * Ipo between times xmin and xmax, using the selection mode.
 
1186
         */
1156
1187
        
1157
1188
        IpoCurve *icu;
1158
1189
        int (*select_function)(BezTriple *);
1162
1193
                return;
1163
1194
        
1164
1195
        /* Set the selection function based on the
1165
 
                * selection mode.
1166
 
                */
 
1196
         * selection mode.
 
1197
         */
1167
1198
        switch(selectmode) {
1168
1199
                case SELECT_ADD:
1169
1200
                        select_function = select_bezier_add;