Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 1,491 Lines • ▼ Show 20 Lines | static void applyGridIncrement(TransInfo *t, float *val, int max_index, const float fac[3], GearsType action) | ||||
| float asp_local[3] = {1, 1, 1}; | float asp_local[3] = {1, 1, 1}; | ||||
| const bool use_aspect = ELEM(t->mode, TFM_TRANSLATION); | const bool use_aspect = ELEM(t->mode, TFM_TRANSLATION); | ||||
| const float *asp = use_aspect ? t->aspect : asp_local; | const float *asp = use_aspect ? t->aspect : asp_local; | ||||
| int i; | int i; | ||||
| BLI_assert(t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)); | BLI_assert(t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)); | ||||
| BLI_assert(max_index <= 2); | BLI_assert(max_index <= 2); | ||||
| if (t->gz && t->gz->type == WM_gizmotype_find("GIZMO_GT_dial_3d", true)) { | |||||
| RNA_float_set(t->gz->ptr, "incremental_angle", fac[action]); | |||||
| } | |||||
| /* Early bailing out if no need to snap */ | /* Early bailing out if no need to snap */ | ||||
| if (fac[action] == 0.0f) { | if (fac[action] == 0.0f) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (use_aspect) { | if (use_aspect) { | ||||
| /* custom aspect for fcurve */ | /* custom aspect for fcurve */ | ||||
| if (t->spacetype == SPACE_IPO) { | if (t->spacetype == SPACE_IPO) { | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||