Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_tools.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 3,688 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *shape_itemf(bContext *C, | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| static void edbm_blend_from_shape_ui(bContext *C, wmOperator *op) | static void edbm_blend_from_shape_ui(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| uiLayout *layout = op->layout; | uiLayout *layout = op->layout; | ||||
| PointerRNA ptr; | |||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| Mesh *me = obedit->data; | Mesh *me = obedit->data; | ||||
| PointerRNA ptr_key; | PointerRNA ptr_key; | ||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| RNA_id_pointer_create((ID *)me->key, &ptr_key); | RNA_id_pointer_create((ID *)me->key, &ptr_key); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetPropDecorate(layout, false); | uiLayoutSetPropDecorate(layout, false); | ||||
| uiItemPointerR(layout, &ptr, "shape", &ptr_key, "key_blocks", NULL, ICON_SHAPEKEY_DATA); | uiItemPointerR(layout, op->ptr, "shape", &ptr_key, "key_blocks", NULL, ICON_SHAPEKEY_DATA); | ||||
| uiItemR(layout, &ptr, "blend", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "blend", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "add", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "add", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| void MESH_OT_blend_from_shape(wmOperatorType *ot) | void MESH_OT_blend_from_shape(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Blend from Shape"; | ot->name = "Blend from Shape"; | ||||
| ▲ Show 20 Lines • Show All 1,890 Lines • ▼ Show 20 Lines | |||||
| static bool edbm_decimate_check(bContext *UNUSED(C), wmOperator *UNUSED(op)) | static bool edbm_decimate_check(bContext *UNUSED(C), wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void edbm_decimate_ui(bContext *UNUSED(C), wmOperator *op) | static void edbm_decimate_ui(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| uiLayout *layout = op->layout, *row, *col, *sub; | uiLayout *layout = op->layout, *row, *col, *sub; | ||||
| PointerRNA ptr; | |||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "ratio", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "ratio", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "use_vertex_group", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "use_vertex_group", 0, NULL, ICON_NONE); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_vertex_group")); | uiLayoutSetActive(col, RNA_boolean_get(op->ptr, "use_vertex_group")); | ||||
| uiItemR(col, &ptr, "vertex_group_factor", 0, NULL, ICON_NONE); | uiItemR(col, op->ptr, "vertex_group_factor", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "invert_vertex_group", 0, NULL, ICON_NONE); | uiItemR(col, op->ptr, "invert_vertex_group", 0, NULL, ICON_NONE); | ||||
| row = uiLayoutRowWithHeading(layout, true, IFACE_("Symmetry")); | row = uiLayoutRowWithHeading(layout, true, IFACE_("Symmetry")); | ||||
| uiItemR(row, &ptr, "use_symmetry", 0, "", ICON_NONE); | uiItemR(row, op->ptr, "use_symmetry", 0, "", ICON_NONE); | ||||
| sub = uiLayoutRow(row, true); | sub = uiLayoutRow(row, true); | ||||
| uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_symmetry")); | uiLayoutSetActive(sub, RNA_boolean_get(op->ptr, "use_symmetry")); | ||||
| uiItemR(sub, &ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(sub, op->ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| } | } | ||||
| void MESH_OT_decimate(wmOperatorType *ot) | void MESH_OT_decimate(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Decimate Geometry"; | ot->name = "Decimate Geometry"; | ||||
| ot->idname = "MESH_OT_decimate"; | ot->idname = "MESH_OT_decimate"; | ||||
| ot->description = "Simplify geometry by collapsing edges"; | ot->description = "Simplify geometry by collapsing edges"; | ||||
| ▲ Show 20 Lines • Show All 3,881 Lines • Show Last 20 Lines | |||||