Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_bevel.c
| Context not available. | |||||
| static void edbm_bevel_update_header(bContext *C, wmOperator *op) | static void edbm_bevel_update_header(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| const char *str = IFACE_("Confirm: (Enter/LMB), Cancel: (Esc/RMB), Mode: %s (M), Clamp Overlap: %s (C), " | const char *str = IFACE_("Confirm: (Enter/LMB), Cancel: (Esc/RMB), Mode: %s (M), Offset: %s, Segments: %d"); | ||||
| "Offset: %s, Segments: %d"); | |||||
| char msg[HEADER_LENGTH]; | char msg[HEADER_LENGTH]; | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| Context not available. | |||||
| RNA_property_enum_name_gettexted(C, op->ptr, prop, RNA_property_enum_get(op->ptr, prop), &type_str); | RNA_property_enum_name_gettexted(C, op->ptr, prop, RNA_property_enum_get(op->ptr, prop), &type_str); | ||||
| BLI_snprintf(msg, HEADER_LENGTH, str, type_str, | BLI_snprintf(msg, HEADER_LENGTH, str, type_str, offset_str, RNA_int_get(op->ptr, "segments")); | ||||
| WM_bool_as_string(RNA_boolean_get(op->ptr, "clamp_overlap")), | |||||
| offset_str, RNA_int_get(op->ptr, "segments")); | |||||
| ED_area_headerprint(sa, msg); | ED_area_headerprint(sa, msg); | ||||
| } | } | ||||
| Context not available. | |||||
| const int segments = RNA_int_get(op->ptr, "segments"); | const int segments = RNA_int_get(op->ptr, "segments"); | ||||
| const float profile = RNA_float_get(op->ptr, "profile"); | const float profile = RNA_float_get(op->ptr, "profile"); | ||||
| const bool vertex_only = RNA_boolean_get(op->ptr, "vertex_only"); | const bool vertex_only = RNA_boolean_get(op->ptr, "vertex_only"); | ||||
| const bool clamp_overlap = RNA_boolean_get(op->ptr, "clamp_overlap"); | |||||
| int material = RNA_int_get(op->ptr, "material"); | int material = RNA_int_get(op->ptr, "material"); | ||||
| /* revert to original mesh */ | /* revert to original mesh */ | ||||
| Context not available. | |||||
| material = CLAMPIS(material, -1, em->ob->totcol - 1); | material = CLAMPIS(material, -1, em->ob->totcol - 1); | ||||
| EDBM_op_init(em, &bmop, op, | EDBM_op_init(em, &bmop, op, | ||||
| "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f clamp_overlap=%b " | "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f material=%i", | ||||
| "material=%i", | BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile, material); | ||||
| BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile, clamp_overlap, material); | |||||
| BMO_op_exec(em->bm, &bmop); | BMO_op_exec(em->bm, &bmop); | ||||
| Context not available. | |||||
| edbm_bevel_update_header(C, op); | edbm_bevel_update_header(C, op); | ||||
| handled = true; | handled = true; | ||||
| break; | break; | ||||
| case CKEY: | |||||
| if (event->val == KM_RELEASE) | |||||
| break; | |||||
| { | |||||
| PropertyRNA *prop = RNA_struct_find_property(op->ptr, "clamp_overlap"); | |||||
| RNA_property_enum_set(op->ptr, prop, !RNA_property_boolean_get(op->ptr, prop)); | |||||
| } | |||||
| edbm_bevel_calc(op); | |||||
| edbm_bevel_update_header(C, op); | |||||
| handled = true; | |||||
| break; | |||||
| } | } | ||||
| /* Modal numinput inactive, try to handle numeric inputs last... */ | /* Modal numinput inactive, try to handle numeric inputs last... */ | ||||
| Context not available. | |||||
| RNA_def_property_float_array_funcs_runtime(prop, NULL, NULL, mesh_ot_bevel_offset_range_func); | RNA_def_property_float_array_funcs_runtime(prop, NULL, NULL, mesh_ot_bevel_offset_range_func); | ||||
| RNA_def_int(ot->srna, "segments", 1, 1, 50, "Segments", "Segments for curved edge", 1, 8); | RNA_def_int(ot->srna, "segments", 1, 1, 50, "Segments", "Segments for curved edge", 1, 8); | ||||
| RNA_def_float(ot->srna, "profile", 0.5f, 0.15f, 1.0f, "Profile", "Controls profile shape (0.5 = round)", 0.15f, 1.0f); | RNA_def_float(ot->srna, "profile", 0.5f, 0.15f, 1.0f, "Profile", "Controls profile shape (0.5 = round)", 0.15f, 1.0f); | ||||
| RNA_def_boolean(ot->srna, "vertex_only", false, "Vertex Only", "Bevel only vertices"); | RNA_def_boolean(ot->srna, "vertex_only", false, "Vertex only", "Bevel only vertices"); | ||||
| RNA_def_boolean(ot->srna, "clamp_overlap", false, "Clamp Overlap", | |||||
| "Do not allow beveled edges/vertices to overlap each other"); | |||||
| RNA_def_int(ot->srna, "material", -1, -1, INT_MAX, "Material", "Material for bevel faces (-1 means use adjacent faces)", -1, 100); | RNA_def_int(ot->srna, "material", -1, -1, INT_MAX, "Material", "Material for bevel faces (-1 means use adjacent faces)", -1, 100); | ||||
| } | } | ||||
| Context not available. | |||||