Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_translate.c
| Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | else { | ||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| float in[3]; | float in[3]; | ||||
| copy_v3_v3(in, global_dir); | copy_v3_v3(in, global_dir); | ||||
| t->con.applyVec(t, NULL, NULL, in, global_dir); | t->con.applyVec(t, NULL, NULL, in, global_dir); | ||||
| } | } | ||||
| float incr_dir[3]; | float incr_dir[3]; | ||||
| mul_v3_m3v3(incr_dir, t->spacemtx_inv, global_dir); | mul_v3_m3v3(incr_dir, t->spacemtx_inv, global_dir); | ||||
| if (transform_snap_increment(t, incr_dir)) { | if (!(activeSnap(t) && validSnap(t)) && transform_snap_increment(t, incr_dir)) { | ||||
| mul_v3_m3v3(incr_dir, t->spacemtx, incr_dir); | mul_v3_m3v3(incr_dir, t->spacemtx, incr_dir); | ||||
| /* Test for mixed snap with grid. */ | /* Test for mixed snap with grid. */ | ||||
| float snap_dist_sq = FLT_MAX; | float snap_dist_sq = FLT_MAX; | ||||
| if (t->tsnap.snapElem != 0) { | if (t->tsnap.snapElem != 0) { | ||||
| snap_dist_sq = len_squared_v3v3(t->values, global_dir); | snap_dist_sq = len_squared_v3v3(t->values, global_dir); | ||||
| } | } | ||||
| if ((snap_dist_sq == FLT_MAX) || (len_squared_v3v3(global_dir, incr_dir) < snap_dist_sq)) { | if ((snap_dist_sq == FLT_MAX) || (len_squared_v3v3(global_dir, incr_dir) < snap_dist_sq)) { | ||||
| Show All 33 Lines | BKE_report(t->reports, | ||||
| RPT_ERROR, | RPT_ERROR, | ||||
| "Use 'Time_Translate' transform mode instead of 'Translation' mode " | "Use 'Time_Translate' transform mode instead of 'Translation' mode " | ||||
| "for translating keyframes in Dope Sheet Editor"); | "for translating keyframes in Dope Sheet Editor"); | ||||
| t->state = TRANS_CANCEL; | t->state = TRANS_CANCEL; | ||||
| } | } | ||||
| t->transform = applyTranslation; | t->transform = applyTranslation; | ||||
| t->tsnap.applySnap = ApplySnapTranslation; | t->tsnap.applySnap = ApplySnapTranslation; | ||||
| t->tsnap.updateBasePoint = transform_snap_translate_update_baseboint_fn; | |||||
| t->tsnap.distance = transform_snap_distance_len_squared_fn; | t->tsnap.distance = transform_snap_distance_len_squared_fn; | ||||
| initMouseInputMode(t, &t->mouse, INPUT_VECTOR); | initMouseInputMode(t, &t->mouse, INPUT_VECTOR); | ||||
| t->idx_max = (t->flag & T_2D_EDIT) ? 1 : 2; | t->idx_max = (t->flag & T_2D_EDIT) ? 1 : 2; | ||||
| t->num.flag = 0; | t->num.flag = 0; | ||||
| t->num.idx_max = t->idx_max; | t->num.idx_max = t->idx_max; | ||||
| Show All 18 Lines | |||||