Fix proportional editing always turned on in graph editor.
authorAntony Riakiotakis <kalast@gmail.com>
Thu, 2 Apr 2015 10:34:35 +0000 (12:34 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Thu, 2 Apr 2015 10:34:35 +0000 (12:34 +0200)
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c

index e34439945ca2b220b7f429f08016987af2dd109b..6124dab343f1fbb012d2e89acb60d5d7de58b2dc 100644 (file)
@@ -3800,7 +3800,7 @@ static void graph_key_shortest_dist(FCurve *fcu, TransData *td_start, TransData
                const bool sel3 = use_handle ? (bezt->f3 & SELECT) != 0 : sel2;
 
                if (sel1 || sel2 || sel3) {
-                       td->dist = min_ff(td->dist, fabs(td_iter->center[0] - td->center[0]));
+                       td->dist = td->rdist = min_ff(td->dist, fabs(td_iter->center[0] - td->center[0]));
                }
 
                td_iter += 3;
@@ -4088,7 +4088,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
                                        const bool sel3 = use_handle ? (bezt->f3 & SELECT) != 0 : sel2;
 
                                        if (sel1 || sel2) {
-                                               td->dist = 0.0f;
+                                               td->dist = td->rdist =  0.0f;
                                        }
                                        else {
                                                graph_key_shortest_dist(fcu, td_start, td, use_handle);
@@ -4096,7 +4096,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
                                        td++;
 
                                        if (sel2) {
-                                               td->dist = 0.0f;
+                                               td->dist = td->rdist = 0.0f;
                                        }
                                        else {
                                                graph_key_shortest_dist(fcu, td_start, td, use_handle);
@@ -4104,7 +4104,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
                                        td++;
 
                                        if (sel3 || sel2) {
-                                               td->dist = 0.0f;
+                                               td->dist = td->rdist = 0.0f;
                                        }
                                        else {
                                                graph_key_shortest_dist(fcu, td_start, td, use_handle);
@@ -7740,10 +7740,8 @@ void createTransData(bContext *C, TransInfo *t)
                createTransGraphEditData(C, t);
 
                if (t->data && (t->flag & T_PROP_EDIT)) {
-                       t->flag |= T_PROP_CONNECTED;
-                       t->flag &= ~T_PROP_PROJECTED;
                        sort_trans_data(t); // makes selected become first in array
-                       set_prop_dist(t, false);
+                       //set_prop_dist(t, false); /* don't do that, distance has been set in createTransGraphEditData already */
                        sort_trans_data_dist(t);
                }
        }
index 14ae93d1144d3b9987cade455aa2533d4828b3c5..0571fc399a629f4903b9a42b92dc2a682f7937e6 100644 (file)
@@ -1321,7 +1321,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
                        if (t->flag & T_MODAL) {
                                if ((t->options & CTX_NO_PET) == 0) {
                                        if (t->spacetype == SPACE_IPO) {
-                                               t->flag |= T_PROP_EDIT;
+                                               t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);
                                        }
                                        else if (t->obedit) {
                                                t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);