Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_boneroll.c
| Show All 30 Lines | |||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_data.h" | |||||
| #include "transform_mode.h" | #include "transform_mode.h" | ||||
| #include "transform_snap.h" | #include "transform_snap.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Transform (EditBone Roll) */ | /* Transform (EditBone Roll) */ | ||||
| /** \name Transform EditBone Roll | /** \name Transform EditBone Roll | ||||
| * \{ */ | * \{ */ | ||||
| static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2])) | static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2])) | ||||
| { | { | ||||
| int i; | |||||
| char str[UI_MAX_DRAW_STR]; | char str[UI_MAX_DRAW_STR]; | ||||
| float final; | float final; | ||||
| final = t->values[0]; | final = t->values[0]; | ||||
| snapGridIncrement(t, &final); | snapGridIncrement(t, &final); | ||||
| Show All 10 Lines | static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2])) | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_snprintf(str, sizeof(str), TIP_("Roll: %.2f"), RAD2DEGF(final)); | BLI_snprintf(str, sizeof(str), TIP_("Roll: %.2f"), RAD2DEGF(final)); | ||||
| } | } | ||||
| /* set roll values */ | /* set roll values */ | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| TransData *td = tc->data; | TransData *td = tc->data; | ||||
| for (i = 0; i < tc->data_len; i++, td++) { | for (int tdi = 0; tdi < tc->data_len; tdi++) { | ||||
| if (td->flag & TD_SKIP) { | if (td->basic[tdi].flag & TD_SKIP) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| *(td->val) = td->ival - final; | *(td->special[tdi].val) = td->special[tdi].ival - final; | ||||
| } | } | ||||
| } | } | ||||
| recalcData(t); | recalcData(t); | ||||
| ED_area_status_text(t->area, str); | ED_area_status_text(t->area, str); | ||||
| } | } | ||||
| Show All 21 Lines | |||||