Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/transform/transform_gizmo_3d.c')
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 14ef5e87534..a71915d8122 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -42,6 +42,7 @@
#include "BLI_utildefines.h"
#include "BKE_action.h"
+#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_editmesh.h"
@@ -564,6 +565,9 @@ static bool test_rotmode_euler(short rotmode)
return (ELEM(rotmode, ROT_MODE_AXISANGLE, ROT_MODE_QUAT)) ? 0 : 1;
}
+/**
+ * Return false when no gimbal for selection.
+ */
bool gimbal_axis(Object *ob, float gmat[3][3])
{
if (ob->mode & OB_MODE_POSE) {
@@ -914,7 +918,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
mul_m4_v3(obedit->obmat, tbounds->center);
mul_m4_v3(obedit->obmat, tbounds->min);
mul_m4_v3(obedit->obmat, tbounds->max);
@@ -957,7 +961,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
MEM_freeN(objects);
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
mul_m4_v3(ob->obmat, tbounds->center);
mul_m4_v3(ob->obmat, tbounds->min);
mul_m4_v3(ob->obmat, tbounds->max);
@@ -995,7 +999,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
}
}
}
@@ -1043,7 +1047,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
/* selection center */
if (totsel) {
- mul_v3_fl(tbounds->center, 1.0f / (float)totsel); // centroid!
+ mul_v3_fl(tbounds->center, 1.0f / (float)totsel); /* centroid! */
}
}
@@ -1279,7 +1283,7 @@ void drawDial3d(const TransInfo *t)
float mat_basis[4][4];
float mat_final[4][4];
float color[4];
- float increment;
+ float increment = 0.0f;
float line_with = GIZMO_AXIS_LINE_WIDTH + 1.0f;
float scale = UI_DPI_FAC * U.gizmo_size;
@@ -1334,10 +1338,7 @@ void drawDial3d(const TransInfo *t)
if (activeSnap(t) && (!transformModeUseSnap(t) ||
(t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) {
- increment = (t->modifiers & MOD_PRECISION) ? t->snap[2] : t->snap[1];
- }
- else {
- increment = t->snap[0];
+ increment = (t->modifiers & MOD_PRECISION) ? t->snap[1] : t->snap[0];
}
BLI_assert(axis_idx >= MAN_AXIS_RANGE_ROT_START && axis_idx < MAN_AXIS_RANGE_ROT_END);