Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_translate.c
| Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | if (hasNumInput(&t->num)) { | ||||
| 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: | /* WORKAROUND: | ||||
| * Special case where snapping is done in #recalData. | * Special case where snapping is done in #recalData. | ||||
| * Update the header based on the first element. */ | * Update the header based on the #center_local. */ | ||||
| const short autosnap = getAnimEdit_SnapMode(t); | const short autosnap = getAnimEdit_SnapMode(t); | ||||
| float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->data->ival; | float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->center_local[0]; | ||||
| float val = ival + dvec[0]; | float val = ival + dvec[0]; | ||||
| snapFrameTransform(t, autosnap, ival, val, &dvec[0]); | snapFrameTransform(t, autosnap, ival, val, &val); | ||||
| dvec[0] = val - ival; | |||||
| } | } | ||||
| 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 343 Lines • Show Last 20 Lines | |||||