Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_edge_seq_slide.c
| Show All 32 Lines | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_data.h" | |||||
| #include "transform_mode.h" | #include "transform_mode.h" | ||||
| #include "transform_snap.h" | #include "transform_snap.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Transform (Sequencer Slide) */ | /* Transform (Sequencer Slide) */ | ||||
| /** \name Transform Sequencer Slide | /** \name Transform Sequencer Slide | ||||
| * \{ */ | * \{ */ | ||||
| Show All 22 Lines | static void headerSeqSlide(TransInfo *t, const float val[2], char str[UI_MAX_DRAW_STR]) | ||||
| ofs += BLI_snprintf(str + ofs, | ofs += BLI_snprintf(str + ofs, | ||||
| UI_MAX_DRAW_STR - ofs, | UI_MAX_DRAW_STR - ofs, | ||||
| TIP_(" or Alt) Expand to fit %s"), | TIP_(" or Alt) Expand to fit %s"), | ||||
| WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); | WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); | ||||
| } | } | ||||
| static void applySeqSlideValue(TransInfo *t, const float val[2]) | static void applySeqSlideValue(TransInfo *t, const float val[2]) | ||||
| { | { | ||||
| int i; | |||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| TransData *td = tc->data; | TransData *td = tc->data; | ||||
| for (i = 0; i < tc->data_len; i++, td++) { | for (int tdi = 0; tdi < tc->data_len; tdi++) { | ||||
| if (td->flag & TD_SKIP) { | if (td->basic[tdi].flag & TD_SKIP) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| madd_v2_v2v2fl(td->loc, td->iloc, val, td->factor); | madd_v2_v2v2fl(td->basic[tdi].loc, td->basic[tdi].iloc, val, td->prop[tdi].factor); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void applySeqSlide(TransInfo *t, const int mval[2]) | static void applySeqSlide(TransInfo *t, const int mval[2]) | ||||
| { | { | ||||
| char str[UI_MAX_DRAW_STR]; | char str[UI_MAX_DRAW_STR]; | ||||
| snapSequenceBounds(t, mval); | snapSequenceBounds(t, mval); | ||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| float tvec[3]; | float tvec[3]; | ||||
| t->con.applyVec(t, NULL, NULL, t->values, tvec); | t->con.applyVec(t, NULL, 0, t->values, tvec); | ||||
| copy_v3_v3(t->values_final, tvec); | copy_v3_v3(t->values_final, tvec); | ||||
| } | } | ||||
| else { | else { | ||||
| // snapGridIncrement(t, t->values); | // snapGridIncrement(t, t->values); | ||||
| applyNumInput(&t->num, t->values); | applyNumInput(&t->num, t->values); | ||||
| copy_v3_v3(t->values_final, t->values); | copy_v3_v3(t->values_final, t->values); | ||||
| } | } | ||||
| Show All 33 Lines | |||||