Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_translate.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| if (hasNumInput(&t->num)) { | if (hasNumInput(&t->num)) { | ||||
| outputNumInput(&(t->num), dvec_str[0], &t->scene->unit); | outputNumInput(&(t->num), dvec_str[0], &t->scene->unit); | ||||
| dist = len_v3(t->num.val); | dist = len_v3(t->num.val); | ||||
| } | } | ||||
| else { | else { | ||||
| float dvec[3]; | float dvec[3]; | ||||
| copy_v3_v3(dvec, vec); | copy_v3_v3(dvec, vec); | ||||
| if (t->spacetype == SPACE_GRAPH) { | if (t->spacetype == SPACE_GRAPH) { | ||||
| /* WORKAROUND: | |||||
| * Special case where snapping is done in #recalData. | |||||
| * Update the header based on the first element. */ | |||||
| const short autosnap = getAnimEdit_SnapMode(t); | const short autosnap = getAnimEdit_SnapMode(t); | ||||
| float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->data->ival; | snapFrameTransform(t, autosnap, 0.0f, dvec[0], &dvec[0]); | ||||
| float val = ival + dvec[0]; | |||||
| snapFrameTransform(t, autosnap, ival, val, &dvec[0]); | |||||
| } | } | ||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| int i = 0; | int i = 0; | ||||
| if (t->con.mode & CON_AXIS0) { | if (t->con.mode & CON_AXIS0) { | ||||
| dvec[i++] = dvec[0]; | dvec[i++] = dvec[0]; | ||||
| } | } | ||||
| if (t->con.mode & CON_AXIS1) { | if (t->con.mode & CON_AXIS1) { | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||