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:
authorBastien Montagne <montagne29@wanadoo.fr>2012-05-20 17:56:42 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-05-20 17:56:42 +0400
commit1cb1d51db486018c018c1314d93ad5cdbe309dad (patch)
tree1fa934ded79ed2fdb81e22cd86747bc2d7dbbda2 /source/blender/editors
parent518ff6995de78ccbf4aa0faa47367a4f9b995d03 (diff)
Various small fixes:
*i18n: panel title of current tool in 3D view & File windows are now translated, as well a redo (F3) menu. *MESH_OT_faces_select_linked_flat & MESH_OT_edges_select_sharp: use ANGLE RNA prop for sharpness, and fix tip of the later op.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/mesh/editmesh_select.c18
-rw-r--r--source/blender/editors/screen/screen_ops.c4
-rw-r--r--source/blender/editors/space_file/file_panels.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c10
4 files changed, 20 insertions, 14 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 2df89a3df6c..dc0a1a98b2d 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -2245,8 +2245,6 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
BMLoop *l1, *l2;
float sharp = RNA_float_get(op->ptr, "sharpness"), angle;
- sharp = DEG2RADF(sharp);
-
BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || !e->l)
continue;
@@ -2273,9 +2271,11 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
void MESH_OT_edges_select_sharp(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Select Sharp Edges";
- ot->description = "Marked selected edges as sharp";
+ ot->description = "Select all sharp-enough edges";
ot->idname = "MESH_OT_edges_select_sharp";
/* api callbacks */
@@ -2286,7 +2286,9 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f);
+ prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f),
+ "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f));
+ RNA_def_property_float_default(prop, DEG2RADF(1.0f));
}
static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
@@ -2300,8 +2302,6 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
float sharp = RNA_float_get(op->ptr, "sharpness");
int i;
- sharp = (sharp * (float)M_PI) / 180.0f;
-
BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
BM_elem_flag_disable(f, BM_ELEM_TAG);
}
@@ -2354,6 +2354,8 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Select Linked Flat Faces";
ot->description = "Select linked faces by angle";
@@ -2367,7 +2369,9 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
- RNA_def_float(ot->srna, "sharpness", 1.0f, 0.01f, FLT_MAX, "sharpness", "", 1.0f, 180.0f);
+ prop = RNA_def_float_rotation(ot->srna, "sharpness", 0, NULL, DEG2RADF(0.01f), DEG2RADF(180.0f),
+ "Sharpness", "", DEG2RADF(1.0f), DEG2RADF(180.0f));
+ RNA_def_property_float_default(prop, DEG2RADF(1.0f));
}
static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index e2a9bf37916..5c68c92500b 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2501,11 +2501,11 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
if (items == 0)
return OPERATOR_CANCELLED;
- pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
layout = uiPupMenuLayout(pup);
for (i = items - 1, lastop = wm->operators.last; lastop; lastop = lastop->prev, i--)
- uiItemIntO(layout, lastop->type->name, ICON_NONE, op->type->idname, "index", i);
+ uiItemIntO(layout, RNA_struct_ui_name(lastop->type->srna), ICON_NONE, op->type->idname, "index", i);
uiPupMenuEnd(C, pup);
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 9fe1940e87b..a17a7edbd80 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -174,7 +174,7 @@ static void file_panel_operator_header(const bContext *C, Panel *pa)
SpaceFile *sfile= CTX_wm_space_file(C);
wmOperator *op= sfile->op;
- BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
+ BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
}
static int file_panel_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 82ab6cd7193..ff896a95941 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -64,7 +64,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" /* own include */
/* ******************* view3d space & buttons ************** */
@@ -78,15 +78,17 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
{
wmOperator *op = WM_operator_last_redo(C);
- if (op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
- else BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname));
+ if (op)
+ BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
+ else
+ BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname));
}
static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
{
if (op->type->flag & OPTYPE_MACRO) {
for (op = op->macro.first; op; op = op->next) {
- uiItemL(pa->layout, op->type->name, ICON_NONE);
+ uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE);
view3d_panel_operator_redo_operator(C, pa, op);
}
}