Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_constraints.c
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| static void drawObjectConstraint(TransInfo *t); | static void drawObjectConstraint(TransInfo *t); | ||||
| /* ************************** CONSTRAINTS ************************* */ | /* ************************** CONSTRAINTS ************************* */ | ||||
| static void constraintAutoValues(TransInfo *t, float vec[3]) | static void constraintValuesFinal(TransInfo *t, float vec[3]) | ||||
| { | { | ||||
| int mode = t->con.mode; | int mode = t->con.mode; | ||||
| if (mode & CON_APPLY) { | if (mode & CON_APPLY) { | ||||
| float nval = (t->flag & T_NULL_ONE) ? 1.0f : 0.0f; | float nval = (t->flag & T_NULL_ONE) ? 1.0f : 0.0f; | ||||
| if ((mode & CON_AXIS0) == 0) { | if ((mode & CON_AXIS0) == 0) { | ||||
| vec[0] = nval; | vec[0] = nval; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | if (t->flag & T_NULL_ONE) { | ||||
| } | } | ||||
| } | } | ||||
| if (applyNumInput(&t->num, vec)) { | if (applyNumInput(&t->num, vec)) { | ||||
| constraintNumInput(t, vec); | constraintNumInput(t, vec); | ||||
| removeAspectRatio(t, vec); | removeAspectRatio(t, vec); | ||||
| } | } | ||||
| /* autovalues is operator param, use that directly but not if snapping is forced */ | /* If `t->values` is operator param, use that directly but not if snapping is forced */ | ||||
| if (t->flag & T_AUTOVALUES && (t->tsnap.status & SNAP_FORCED) == 0) { | if (t->flag & T_INPUT_IS_VALUES_FINAL && (t->tsnap.status & SNAP_FORCED) == 0) { | ||||
| copy_v3_v3(vec, t->auto_values); | copy_v3_v3(vec, t->values); | ||||
| constraintAutoValues(t, vec); | constraintValuesFinal(t, vec); | ||||
| /* inverse transformation at the end */ | /* inverse transformation at the end */ | ||||
| } | } | ||||
| if (t->con.mode & CON_AXIS0) { | if (t->con.mode & CON_AXIS0) { | ||||
| pvec[i++] = vec[0]; | pvec[i++] = vec[0]; | ||||
| } | } | ||||
| if (t->con.mode & CON_AXIS1) { | if (t->con.mode & CON_AXIS1) { | ||||
| pvec[i++] = vec[1]; | pvec[i++] = vec[1]; | ||||
| ▲ Show 20 Lines • Show All 1,056 Lines • Show Last 20 Lines | |||||