diff options
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 52ba9460818..04390612dd0 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -53,6 +53,8 @@ #include "BLI_editVert.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_deform.h" @@ -1550,7 +1552,7 @@ static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Vertex Group"; + ot->name= _("Add Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_add"; /* api callbacks */ @@ -1580,7 +1582,7 @@ static int vertex_group_remove_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Vertex Group"; + ot->name= _("Remove Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_remove"; /* api callbacks */ @@ -1591,7 +1593,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups."); + RNA_def_boolean(ot->srna, "all", 0, _("All"), _("Remove from all vertex groups.")); } static int vertex_group_assign_exec(bContext *C, wmOperator *op) @@ -1612,7 +1614,7 @@ static int vertex_group_assign_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) { /* identifiers */ - ot->name= "Assign Vertex Group"; + ot->name= _("Assign Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_assign"; /* api callbacks */ @@ -1623,7 +1625,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group."); + RNA_def_boolean(ot->srna, "new", 0, _("New"), _("Assign vertex to new vertex group.")); } static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) @@ -1651,7 +1653,7 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove from Vertex Group"; + ot->name= _("Remove from Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_remove_from"; /* api callbacks */ @@ -1662,7 +1664,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups."); + RNA_def_boolean(ot->srna, "all", 0, _("All"), _("Remove from all vertex groups.")); } static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1681,7 +1683,7 @@ static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_select(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Vertex Group"; + ot->name= _("Select Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_select"; /* api callbacks */ @@ -1705,7 +1707,7 @@ static int vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) { /* identifiers */ - ot->name= "Deselect Vertex Group"; + ot->name= _("Deselect Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_deselect"; /* api callbacks */ @@ -1731,7 +1733,7 @@ static int vertex_group_copy_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_copy(wmOperatorType *ot) { /* identifiers */ - ot->name= "Copy Vertex Group"; + ot->name= _("Copy Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_copy"; /* api callbacks */ @@ -1761,7 +1763,7 @@ static int vertex_group_levels_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) { /* identifiers */ - ot->name= "Vertex Group Levels"; + ot->name= _("Vertex Group Levels"); ot->idname= "OBJECT_OT_vertex_group_levels"; /* api callbacks */ @@ -1771,8 +1773,8 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights.", -1.0f, 1.f); - RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f); + RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, N_("Offset"), N_("Value to add to weights."), -1.0f, 1.f); + RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, N_("Gain"), N_("Value to multiply weights by."), 0.0f, 10.f); } static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1791,7 +1793,7 @@ static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_normalize(wmOperatorType *ot) { /* identifiers */ - ot->name= "Normalize Vertex Group"; + ot->name= _("Normalize Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_normalize"; /* api callbacks */ @@ -1819,7 +1821,7 @@ static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot) { /* identifiers */ - ot->name= "Normalize All Vertex Groups"; + ot->name= _("Normalize All Vertex Groups"); ot->idname= "OBJECT_OT_vertex_group_normalize_all"; /* api callbacks */ @@ -1829,7 +1831,7 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others."); + RNA_def_boolean(ot->srna, "lock_active", TRUE, _("Lock Active"), _("Keep the values of the active group while normalizing others.")); } static int vertex_group_invert_exec(bContext *C, wmOperator *op) @@ -1849,7 +1851,7 @@ static int vertex_group_invert_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) { /* identifiers */ - ot->name= "Invert Vertex Group"; + ot->name= _("Invert Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_invert"; /* api callbacks */ @@ -1859,8 +1861,8 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", "Add verts from groups that have zero weight before inverting."); - RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", "Remove verts from groups that have zero weight after inverting."); + RNA_def_boolean(ot->srna, "auto_assign", TRUE, _("Add Weights"), _("Add verts from groups that have zero weight before inverting.")); + RNA_def_boolean(ot->srna, "auto_remove", TRUE, _("Remove Weights"), _("Remove verts from groups that have zero weight after inverting.")); } @@ -1880,7 +1882,7 @@ static int vertex_group_blend_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_blend(wmOperatorType *ot) { /* identifiers */ - ot->name= "Blend Vertex Group"; + ot->name= _("Blend Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_blend"; ot->description= ""; @@ -1914,9 +1916,9 @@ static int vertex_group_clean_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_clean(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clean Vertex Group"; + ot->name= _("Clean Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_clean"; - ot->description= "Remove Vertex Group assignments which aren't required"; + ot->description= _("Remove Vertex Group assignments which aren't required"); /* api callbacks */ ot->poll= vertex_group_poll; @@ -1925,9 +1927,9 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f); - RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups."); - RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning."); + RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, _("Limit"), _("Remove weights under this limit."), 0.001f, 0.99f); + RNA_def_boolean(ot->srna, "all_groups", FALSE, _("All Groups"), _("Clean all vertex groups.")); + RNA_def_boolean(ot->srna, "keep_single", FALSE, _("Keep Single"), _("Keep verts assigned to at least one group when cleaning.")); } @@ -1947,9 +1949,9 @@ static int vertex_group_mirror_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mirror Vertex Group"; + ot->name= _("Mirror Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_mirror"; - ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, flipping when both sides are selected otherwise copy from unselected"; + ot->description= _("Mirror all vertex groups, flip weights and/or names, editing only selected vertices, flipping when both sides are selected otherwise copy from unselected"); /* api callbacks */ ot->poll= vertex_group_poll_edit; @@ -1959,8 +1961,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights."); - RNA_def_boolean(ot->srna, "flip_group_names", TRUE, "Flip Groups", "Flip vertex group names."); + RNA_def_boolean(ot->srna, "mirror_weights", TRUE, _("Mirror Weights"), _("Mirror weights.")); + RNA_def_boolean(ot->srna, "flip_group_names", TRUE, _("Flip Groups"), _("Flip vertex group names.")); } @@ -1993,9 +1995,9 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) { /* identifiers */ - ot->name= "Copy Vertex Groups to Linked"; + ot->name= _("Copy Vertex Groups to Linked"); ot->idname= "OBJECT_OT_vertex_group_copy_to_linked"; - ot->description= "Copy Vertex Groups to all users of the same Geometry data"; + ot->description= _("Copy Vertex Groups to all users of the same Geometry data"); /* api callbacks */ ot->poll= vertex_group_poll; @@ -2031,9 +2033,9 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot) { /* identifiers */ - ot->name= "Copy Vertex Group to Selected"; + ot->name= _("Copy Vertex Group to Selected"); ot->idname= "OBJECT_OT_vertex_group_copy_to_selected"; - ot->description= "Copy Vertex Groups to other selected objects with matching indices"; + ot->description= _("Copy Vertex Groups to other selected objects with matching indices"); /* api callbacks */ ot->poll= vertex_group_poll; @@ -2089,9 +2091,9 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) PropertyRNA *prop; /* identifiers */ - ot->name= "Set Active Vertex Group"; + ot->name= _("Set Active Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_set_active"; - ot->description= "Set the active vertex group"; + ot->description= _("Set the active vertex group"); /* api callbacks */ ot->poll= vertex_group_poll; @@ -2102,7 +2104,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active."); + prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, _("Group"), _("Vertex group to set as active.")); RNA_def_enum_funcs(prop, vgroup_itemf); ot->prop= prop; } @@ -2221,9 +2223,9 @@ static int vertex_group_sort_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_sort(wmOperatorType *ot) { - ot->name= "Sort Vertex Groups"; + ot->name= _("Sort Vertex Groups"); ot->idname= "OBJECT_OT_vertex_group_sort"; - ot->description= "Sorts vertex groups alphabetically"; + ot->description= _("Sorts vertex groups alphabetically"); /* api callbacks */ ot->poll= vertex_group_poll; @@ -2274,13 +2276,13 @@ static int vgroup_move_exec(bContext *C, wmOperator *op) void OBJECT_OT_vertex_group_move(wmOperatorType *ot) { static EnumPropertyItem vgroup_slot_move[] = { - {1, "UP", 0, "Up", ""}, - {-1, "DOWN", 0, "Down", ""}, + {1, "UP", 0, N_("Up"), ""}, + {-1, "DOWN", 0, N_("Down"), ""}, {0, NULL, 0, NULL, NULL} }; /* identifiers */ - ot->name= "Move Vertex Group"; + ot->name= _("Move Vertex Group"); ot->idname= "OBJECT_OT_vertex_group_move"; /* api callbacks */ @@ -2290,5 +2292,5 @@ void OBJECT_OT_vertex_group_move(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "direction", vgroup_slot_move, 0, "Direction", "Direction to move, UP or DOWN"); + RNA_def_enum(ot->srna, "direction", RNA_enum_items_gettexted(vgroup_slot_move), 0, _("Direction"), _("Direction to move, UP or DOWN")); } |