Cleanup/optimization: Simplify some usages of uiItemFullO/_ptr, avoid multiple search...
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Mar 2017 18:41:03 +0000 (19:41 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Mar 2017 18:42:19 +0000 (19:42 +0100)
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/windowmanager/intern/wm_operators.c

index 6e3c3c3674a1c432aaffcdaa00fb3843895284e3..4846272b17df5ca73be9c2c3f93b5c033807e64c 100644 (file)
@@ -7005,20 +7005,17 @@ static bool ui_but_menu(bContext *C, uiBut *but)
                        uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Manual"),
                                ICON_URL, "WM_OT_doc_view_manual_ui_context");
 
-                       WM_operator_properties_create(&ptr_props, "WM_OT_doc_view");
+                       ptr_props = uiItemFullO(layout, "WM_OT_doc_view",
+                                                   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Python Reference"),
+                                                   ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                        RNA_string_set(&ptr_props, "doc_id", buf);
-                       uiItemFullO(layout, "WM_OT_doc_view",
-                                   CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Python Reference"),
-                                   ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
 
                        /* XXX inactive option, not for public! */
 #if 0
-                       WM_operator_properties_create(&ptr_props, "WM_OT_doc_edit");
+                       ptr_props = uiItemFullO(layout, "WM_OT_doc_edit",
+                                                   "Submit Description", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                        RNA_string_set(&ptr_props, "doc_id", buf);
                        RNA_string_set(&ptr_props, "doc_new", RNA_property_description(but->rnaprop));
-
-                       uiItemFullO(layout, "WM_OT_doc_edit",
-                                   "Submit Description", ICON_NONE, ptr_props.data, WM_OP_INVOKE_DEFAULT, 0);
 #endif
                }
        }
index c62fb4cadd6e52d356079fe3e0162bad2eeb5cd5..76fa1720863be961e3be464d5d8d5a029c70b50e 100644 (file)
@@ -3556,14 +3556,13 @@ void uiLayoutOperatorButs(
                row = uiLayoutRow(layout, true);
                uiItemM(row, (bContext *)C, "WM_MT_operator_presets", NULL, ICON_NONE);
 
-               WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
+               wmOperatorType *ot = WM_operatortype_find("WM_OT_operator_preset_add", false);
+               op_ptr = uiItemFullO_ptr(row, ot, "", ICON_ZOOMIN, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                RNA_string_set(&op_ptr, "operator", op->type->idname);
-               uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMIN, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
 
-               WM_operator_properties_create(&op_ptr, "WM_OT_operator_preset_add");
+               op_ptr = uiItemFullO_ptr(row, ot, "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                RNA_string_set(&op_ptr, "operator", op->type->idname);
                RNA_boolean_set(&op_ptr, "remove_active", true);
-               uiItemFullO(row, "WM_OT_operator_preset_add", "", ICON_ZOOMOUT, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
        }
 
        if (op->type->ui) {
index d88c36a8e242d6850de44de9c18d5817877f13bd..c2e094fc161dbb82e38d4966ef4c63acef1c7e27 100644 (file)
@@ -2808,7 +2808,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent
        bScreen *sc = CTX_wm_screen(C);
        uiPopupMenu *pup;
        uiLayout *layout;
-       PointerRNA ptr1, ptr2;
+       PointerRNA ptr;
        ScrEdge *actedge;
        const int winsize_x = WM_window_pixels_x(win);
        const int winsize_y = WM_window_pixels_y(win);
@@ -2820,22 +2820,17 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent
        pup = UI_popup_menu_begin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
        layout = UI_popup_menu_layout(pup);
        
-       WM_operator_properties_create(&ptr1, "SCREEN_OT_area_join");
-       
-       /* mouse cursor on edge, '4' can fail on wide edges... */
-       RNA_int_set(&ptr1, "min_x", event->x + 4);
-       RNA_int_set(&ptr1, "min_y", event->y + 4);
-       RNA_int_set(&ptr1, "max_x", event->x - 4);
-       RNA_int_set(&ptr1, "max_y", event->y - 4);
-       
-       WM_operator_properties_create(&ptr2, "SCREEN_OT_area_split");
-       
+       ptr = uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        /* store initial mouse cursor position */
-       RNA_int_set(&ptr2, "mouse_x", event->x);
-       RNA_int_set(&ptr2, "mouse_y", event->y);
-       
-       uiItemFullO(layout, "SCREEN_OT_area_split", NULL, ICON_NONE, ptr2.data, WM_OP_INVOKE_DEFAULT, 0);
-       uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, ptr1.data, WM_OP_INVOKE_DEFAULT, 0);
+       RNA_int_set(&ptr, "mouse_x", event->x);
+       RNA_int_set(&ptr, "mouse_y", event->y);
+
+       ptr = uiItemFullO(layout, "SCREEN_OT_area_join", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       /* mouse cursor on edge, '4' can fail on wide edges... */
+       RNA_int_set(&ptr, "min_x", event->x + 4);
+       RNA_int_set(&ptr, "min_y", event->y + 4);
+       RNA_int_set(&ptr, "max_x", event->x - 4);
+       RNA_int_set(&ptr, "max_y", event->y - 4);
        
        UI_popup_menu_end(C, pup);
        
index d31a475e45e2f0f4e709421daa8dc3e9d3a81677..e4f5802a395fe061d2b0747e1e2531e77691ba85 100644 (file)
@@ -1320,9 +1320,6 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
        PropertyRNA *prop;
        const char *layer_name;
        char scene_name[MAX_ID_NAME - 2];
-       wmOperatorType *ot = WM_operatortype_find("RENDER_OT_render", 1);
-
-       BLI_assert(ot != 0);
 
        uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL);
        
@@ -1339,11 +1336,9 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
        scn_ptr = RNA_pointer_get(ptr, "scene");
        RNA_string_get(&scn_ptr, "name", scene_name);
 
-       WM_operator_properties_create_ptr(&op_ptr, ot);
+       op_ptr = uiItemFullO(row, "RENDER_OT_render", "", ICON_RENDER_STILL, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_string_set(&op_ptr, "layer", layer_name);
        RNA_string_set(&op_ptr, "scene", scene_name);
-       uiItemFullO_ptr(row, ot, "", ICON_RENDER_STILL, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
-
 }
 
 
@@ -1792,6 +1787,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
        Scene *scene = CTX_data_scene(C);
        PointerRNA imfptr = RNA_pointer_get(ptr, "format");
        PointerRNA active_input_ptr, op_ptr;
+       wmOperatorType *ot;
        uiLayout *row, *col;
        int active_index;
        const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER;
@@ -1830,11 +1826,10 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
        active_input_ptr.id.data = ptr->id.data;
        
        col = uiLayoutColumn(row, true);
-       op_ptr = uiItemFullO(col, "NODE_OT_output_file_move_active_socket", "",
-                            ICON_TRIA_UP, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       ot = WM_operatortype_find("NODE_OT_output_file_move_active_socket", false);
+       op_ptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&op_ptr, "direction", 1);
-       op_ptr = uiItemFullO(col, "NODE_OT_output_file_move_active_socket", "",
-                            ICON_TRIA_DOWN, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       op_ptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&op_ptr, "direction", 2);
        
        if (active_input_ptr.data) {
@@ -2166,14 +2161,7 @@ static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), Poi
 
 static void node_composit_buts_switch_view_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
 {
-       PointerRNA op_ptr;
-       wmOperatorType *ot = WM_operatortype_find("NODE_OT_switch_view_update", 1);
-
-       BLI_assert(ot != 0);
-
-       WM_operator_properties_create_ptr(&op_ptr, ot);
-
-       uiItemFullO_ptr(layout, ot, "Update Views", ICON_FILE_REFRESH, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+       uiItemFullO(layout, "NODE_OT_switch_view_update", "Update Views", ICON_FILE_REFRESH, NULL, WM_OP_INVOKE_DEFAULT, 0);
 }
 
 static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
index f0567924eddf23707e08b699439051005d604a40..925298451ce9a2c49b857b18fa60b1a1f2cd2b3e 100644 (file)
@@ -133,6 +133,7 @@ static void node_tree_interface_panel(const bContext *C, Panel *pa)
        int in_out;
        uiLayout *layout = pa->layout, *row, *split, *col;
        PointerRNA ptr, sockptr, opptr;
+       wmOperatorType *ot;
 
        if (!ntree)
                return;
@@ -146,23 +147,25 @@ static void node_tree_interface_panel(const bContext *C, Panel *pa)
        
        split = uiLayoutRow(row, true);
        col = uiLayoutColumn(split, true);
+       ot = WM_operatortype_find("NODE_OT_tree_socket_add", false);
        uiItemL(col, IFACE_("Inputs:"), ICON_NONE);
        uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "inputs", &ptr, "inputs", &ptr, "active_input",
                       NULL, 0, 0, 0, 0);
-       opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       opptr = uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&opptr, "in_out", SOCK_IN);
        
        col = uiLayoutColumn(split, true);
        uiItemL(col, IFACE_("Outputs:"), ICON_NONE);
        uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "outputs", &ptr, "outputs", &ptr, "active_output",
                       NULL, 0, 0, 0, 0);
-       opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       opptr = uiItemFullO_ptr(col, ot, "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&opptr, "in_out", SOCK_OUT);
        
+       ot = WM_operatortype_find("NODE_OT_tree_socket_move", false);
        col = uiLayoutColumn(row, true);
-       opptr = uiItemFullO(col, "NODE_OT_tree_socket_move", "", ICON_TRIA_UP, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       opptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_UP, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&opptr, "direction", 1);
-       opptr = uiItemFullO(col, "NODE_OT_tree_socket_move", "", ICON_TRIA_DOWN, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       opptr = uiItemFullO_ptr(col, ot, "", ICON_TRIA_DOWN, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
        RNA_enum_set(&opptr, "direction", 2);
        
        if (sock) {
index 8c3b9a55089d5421e6fd41577c6534bf57465398..bf220784371680b6f5301008eb85178305a75523 100644 (file)
@@ -2071,74 +2071,62 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                        wmOperatorType *ot = WM_operatortype_find("OUTLINER_OT_parent_drop", false);
                        uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Set Parent To"), ICON_NONE);
                        uiLayout *layout = UI_popup_menu_layout(pup);
-                       
                        PointerRNA ptr;
                        
-                       WM_operator_properties_create_ptr(&ptr, ot);
+                       /* Cannot use uiItemEnumO()... have multiple properties to set. */
+                       ptr = uiItemFullO_ptr(layout, ot, IFACE_("Object"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                        RNA_string_set(&ptr, "parent", parname);
                        RNA_string_set(&ptr, "child", childname);
                        RNA_enum_set(&ptr, "type", PAR_OBJECT);
-                       /* Cannot use uiItemEnumO()... have multiple properties to set. */
-                       uiItemFullO_ptr(layout, ot, IFACE_("Object"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                       
+
                        /* par becomes parent, make the associated menus */
                        if (par->type == OB_ARMATURE) {
-                               WM_operator_properties_create_ptr(&ptr, ot);
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Armature Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Armature Deform"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Empty Groups"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_NAME);
-                               uiItemFullO_ptr(layout, ot, IFACE_("   With Empty Groups"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Envelope Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_ENVELOPE);
-                               uiItemFullO_ptr(layout, ot, IFACE_("   With Envelope Weights"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("   With Automatic Weights"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_ARMATURE_AUTO);
-                               uiItemFullO_ptr(layout, ot, IFACE_("   With Automatic Weights"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Bone"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_BONE);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Bone"),
-                                           0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
                        }
                        else if (par->type == OB_CURVE) {
-                               WM_operator_properties_create_ptr(&ptr, ot);
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Curve Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_CURVE);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Curve Deform"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Follow Path"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_FOLLOW);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Follow Path"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
-                               
-                               WM_operator_properties_create_ptr(&ptr, ot);
+
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Path Constraint"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_PATH_CONST);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Path Constraint"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
                        }
                        else if (par->type == OB_LATTICE) {
-                               WM_operator_properties_create_ptr(&ptr, ot);
+                               ptr = uiItemFullO_ptr(layout, ot, IFACE_("Lattice Deform"), 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
                                RNA_string_set(&ptr, "parent", parname);
                                RNA_string_set(&ptr, "child", childname);
                                RNA_enum_set(&ptr, "type", PAR_LATTICE);
-                               uiItemFullO_ptr(layout, ot, IFACE_("Lattice Deform"), 0, ptr.data, WM_OP_EXEC_DEFAULT, 0);
                        }
                        
                        UI_popup_menu_end(C, pup);
index 351c7ccec1546c96c933880bf64dc794faad792e..34e01405e7e9a4df94dd2a98c0241ee0550e7d30 100644 (file)
@@ -814,10 +814,6 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
        if (dv && dv->totweight) {
                ToolSettings *ts = scene->toolsettings;
 
-               wmOperatorType *ot_weight_set_active = WM_operatortype_find("OBJECT_OT_vertex_weight_set_active", true);
-               wmOperatorType *ot_weight_paste = WM_operatortype_find("OBJECT_OT_vertex_weight_paste", true);
-               wmOperatorType *ot_weight_delete = WM_operatortype_find("OBJECT_OT_vertex_weight_delete", true);
-
                wmOperatorType *ot;
                PointerRNA op_ptr, tools_ptr;
                PointerRNA *but_ptr;
@@ -856,7 +852,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
 
                                        /* The Weight Group Name */
 
-                                       ot = ot_weight_set_active;
+                                       ot = WM_operatortype_find("OBJECT_OT_vertex_weight_set_active", true);
                                        but = uiDefButO_ptr(block, UI_BTYPE_BUT, ot, WM_OP_EXEC_DEFAULT, dg->name,
                                                            xco, yco, (x = UI_UNIT_X * 5), UI_UNIT_Y, "");
                                        but_ptr = UI_but_operator_ptr_get(but);
@@ -882,23 +878,16 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                                        xco += x;
 
                                        /* The weight group paste function */
-
-                                       ot = ot_weight_paste;
-                                       WM_operator_properties_create_ptr(&op_ptr, ot);
-                                       RNA_int_set(&op_ptr, "weight_group", i);
                                        icon = (locked) ? ICON_BLANK1 : ICON_PASTEDOWN;
-                                       uiItemFullO_ptr(row, ot, "", icon, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+                                       op_ptr = uiItemFullO(row, "OBJECT_OT_vertex_weight_paste", "", icon, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       RNA_int_set(&op_ptr, "weight_group", i);
 
                                        /* The weight entry delete function */
-
-                                       ot = ot_weight_delete;
-                                       WM_operator_properties_create_ptr(&op_ptr, ot);
-                                       RNA_int_set(&op_ptr, "weight_group", i);
                                        icon = (locked) ? ICON_LOCKED : ICON_X;
-                                       uiItemFullO_ptr(row, ot, "", icon, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0);
+                                       op_ptr = uiItemFullO(row, "OBJECT_OT_vertex_weight_delete", "", icon, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+                                       RNA_int_set(&op_ptr, "weight_group", i);
 
                                        yco -= UI_UNIT_Y;
-                                       
                                }
                        }
                }
index 9d4c3986678ce599dd8e59d7f5eb55c40e2d5c0d..841b63d4ab846f7d4b9330a09978b6276f0305f4 100644 (file)
@@ -900,7 +900,7 @@ void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
 
 void WM_operator_properties_create(PointerRNA *ptr, const char *opstring)
 {
-       wmOperatorType *ot = WM_operatortype_find(opstring, 0);
+       wmOperatorType *ot = WM_operatortype_find(opstring, false);
 
        if (ot)
                WM_operator_properties_create_ptr(ptr, ot);