diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-19 17:13:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-19 17:14:37 +0300 |
commit | 4402c2324b81efad8d09a016a7e6838395711158 (patch) | |
tree | db28202b57d1cd4588002eacf2ef7306d3e6a63b /source/blender/editors/mesh/editmesh_tools.c | |
parent | e1acefd45e2365d0163e5fb3d7f8fc34a2749cf0 (diff) |
Cleanup: use 'wmOperator.ptr' in draw functions
Draw functions used RNA_pointer_create to create the pointer,
however this already exists in the operator.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 33e4691bfb5..bb332a4094c 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3694,21 +3694,18 @@ static const EnumPropertyItem *shape_itemf(bContext *C, static void edbm_blend_from_shape_ui(bContext *C, wmOperator *op) { uiLayout *layout = op->layout; - wmWindowManager *wm = CTX_wm_manager(C); - PointerRNA ptr; Object *obedit = CTX_data_edit_object(C); Mesh *me = obedit->data; PointerRNA ptr_key; - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); RNA_id_pointer_create((ID *)me->key, &ptr_key); uiLayoutSetPropSep(layout, true); uiLayoutSetPropDecorate(layout, false); - uiItemPointerR(layout, &ptr, "shape", &ptr_key, "key_blocks", NULL, ICON_SHAPEKEY_DATA); - uiItemR(layout, &ptr, "blend", 0, NULL, ICON_NONE); - uiItemR(layout, &ptr, "add", 0, NULL, ICON_NONE); + uiItemPointerR(layout, op->ptr, "shape", &ptr_key, "key_blocks", NULL, ICON_SHAPEKEY_DATA); + uiItemR(layout, op->ptr, "blend", 0, NULL, ICON_NONE); + uiItemR(layout, op->ptr, "add", 0, NULL, ICON_NONE); } void MESH_OT_blend_from_shape(wmOperatorType *ot) @@ -5612,29 +5609,25 @@ static bool edbm_decimate_check(bContext *UNUSED(C), wmOperator *UNUSED(op)) return true; } -static void edbm_decimate_ui(bContext *C, wmOperator *op) +static void edbm_decimate_ui(bContext *UNUSED(C), wmOperator *op) { uiLayout *layout = op->layout, *row, *col, *sub; - wmWindowManager *wm = CTX_wm_manager(C); - PointerRNA ptr; - - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); 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); - uiLayoutSetActive(col, RNA_boolean_get(&ptr, "use_vertex_group")); - uiItemR(col, &ptr, "vertex_group_factor", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "invert_vertex_group", 0, NULL, ICON_NONE); + uiLayoutSetActive(col, RNA_boolean_get(op->ptr, "use_vertex_group")); + uiItemR(col, op->ptr, "vertex_group_factor", 0, NULL, ICON_NONE); + uiItemR(col, op->ptr, "invert_vertex_group", 0, NULL, ICON_NONE); 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); - uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_symmetry")); - uiItemR(sub, &ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiLayoutSetActive(sub, RNA_boolean_get(op->ptr, "use_symmetry")); + uiItemR(sub, op->ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } void MESH_OT_decimate(wmOperatorType *ot) |