diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_buttons.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 706215f8fae..3baf297e580 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -124,10 +124,12 @@ typedef struct { */ static float compute_scale_factor(const float ve_median, const float median) { - if (ve_median <= 0.0f) + if (ve_median <= 0.0f) { return 0.0f; - else if (ve_median >= 1.0f) + } + else if (ve_median >= 1.0f) { return 1.0f; + } else { /* Scale value to target median. */ float median_new = ve_median; @@ -337,8 +339,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float nu = nu->next; } - if (totcurvedata == 1) + if (totcurvedata == 1) { RNA_pointer_create(&cu->id, seltype, selp, &data_ptr); + } } else if (ob->type == OB_LATTICE) { Lattice *lt = ob->data; @@ -364,8 +367,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float bp++; } - if (totlattdata == 1) + if (totlattdata == 1) { RNA_pointer_create(<->id, seltype, selp, &data_ptr); + } } if (tot == 0) { @@ -375,8 +379,9 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float /* Location, X/Y/Z */ mul_v3_fl(median_basis.generic.location, 1.0f / (float)tot); - if (v3d->flag & V3D_GLOBAL_STATS) + if (v3d->flag & V3D_GLOBAL_STATS) { mul_m4_v3(ob->obmat, median_basis.generic.location); + } if (has_meshdata) { TransformMedian_Mesh *median = &median_basis.mesh; @@ -419,13 +424,18 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float UI_block_align_begin(block); if (tot == 1) { - if (totcurvedata) /* Curve */ + if (totcurvedata) { + /* Curve */ c = IFACE_("Control Point:"); - else /* Mesh or lattice */ + } + else { + /* Mesh or lattice */ c = IFACE_("Vertex:"); + } } - else + else { c = IFACE_("Median:"); + } uiDefBut(block, UI_BTYPE_LABEL, 0, c, 0, yi -= buth, butw, buth, NULL, 0, 0, 0, 0, ""); UI_block_align_begin(block); @@ -993,10 +1003,12 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) colsub = uiLayoutColumn(split, true); uiLayoutSetEmboss(colsub, UI_EMBOSS_NONE); uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE); - if (RNA_boolean_get(ptr, "lock_rotations_4d")) + if (RNA_boolean_get(ptr, "lock_rotations_4d")) { uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY, "", ICON_DECORATE_UNLOCKED); - else + } + else { uiItemL(colsub, "", ICON_NONE); + } uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_DECORATE_UNLOCKED); break; case ROT_MODE_AXISANGLE: /* axis angle */ @@ -1005,10 +1017,12 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) colsub = uiLayoutColumn(split, true); uiLayoutSetEmboss(colsub, UI_EMBOSS_NONE); uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE); - if (RNA_boolean_get(ptr, "lock_rotations_4d")) + if (RNA_boolean_get(ptr, "lock_rotations_4d")) { uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_DECORATE_UNLOCKED); - else + } + else { uiItemL(colsub, "", ICON_NONE); + } uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_DECORATE_UNLOCKED); break; default: /* euler rotations */ @@ -1093,8 +1107,9 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob) MetaBall *mball = ob->data; uiLayout *col; - if (!mball || !(mball->lastelem)) + if (!mball || !(mball->lastelem)) { return; + } RNA_pointer_create(&mball->id, &RNA_MetaBall, mball, &mbptr); @@ -1257,8 +1272,9 @@ static int view3d_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) ScrArea *sa = CTX_wm_area(C); ARegion *ar = view3d_has_buttons_region(sa); - if (ar) + if (ar) { ED_region_toggle_hidden(C, ar); + } return OPERATOR_FINISHED; } |