diff options
33 files changed, 159 insertions, 118 deletions
diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py index f175ca06f28..92fbdaee989 100644 --- a/release/scripts/templates/operator.py +++ b/release/scripts/templates/operator.py @@ -19,6 +19,11 @@ class ExportSomeData(bpy.types.Operator): path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default= True) + type = bpy.props.EnumProperty(items=(('OPT_A', "First Option", "Description one"), ('OPT_B', "Second Option", "Description two.")), + name="Example Enum", + description="Choose between two items", + default='OPT_A') + def poll(self, context): return context.active_object != None @@ -39,13 +44,18 @@ class ExportSomeData(bpy.types.Operator): # File selector wm.add_fileselect(self) # will run self.execute() return {'RUNNING_MODAL'} - elif 0: + elif True: + # search the enum + wm.invoke_search_popup(self) + return {'RUNNING_MODAL'} + elif False: # Redo popup return wm.invoke_props_popup(self, event) # - elif 0: + elif False: return self.execute(context) + bpy.types.register(ExportSomeData) # Only needed if you want to add into a dynamic menu @@ -53,4 +63,4 @@ menu_func = lambda self, context: self.layout.operator("export.some_data", text= bpy.types.INFO_MT_file_export.append(menu_func) if __name__ == "__main__": - bpy.ops.export.some_data(path="/tmp/test.ply") + bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply")
\ No newline at end of file diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 530e9179474..fffc546394d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1260,7 +1260,7 @@ void ANIM_OT_channels_setting_enable (wmOperatorType *ot) /* flag-setting mode */ RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_ADD, "Mode", ""); /* setting to set */ - RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } void ANIM_OT_channels_setting_disable (wmOperatorType *ot) @@ -1282,7 +1282,7 @@ void ANIM_OT_channels_setting_disable (wmOperatorType *ot) /* flag-setting mode */ RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_CLEAR, "Mode", ""); /* setting to set */ - RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } void ANIM_OT_channels_setting_toggle (wmOperatorType *ot) @@ -1304,7 +1304,7 @@ void ANIM_OT_channels_setting_toggle (wmOperatorType *ot) /* flag-setting mode */ RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", ""); /* setting to set */ - RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } // XXX currently, this is a separate operator, but perhaps we could in future specify in keymaps whether to call invoke or exec? diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 410da6662aa..cf7cd3e1f27 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1384,7 +1384,7 @@ void ARMATURE_OT_flags_set (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); RNA_def_enum(ot->srna, "mode", prop_bone_setting_modes, 0, "Mode", ""); } @@ -1404,7 +1404,7 @@ void POSE_OT_flags_set (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_bone_setting_types, 0, "Type", ""); RNA_def_enum(ot->srna, "mode", prop_bone_setting_modes, 0, "Mode", ""); } @@ -2164,7 +2164,7 @@ void ARMATURE_OT_calculate_roll(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", ""); } /* **************** undo for armatures ************** */ @@ -3200,7 +3200,7 @@ void ARMATURE_OT_merge (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", merge_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", merge_types, 0, "Type", ""); } /* ************** END Add/Remove stuff in editmode ************ */ @@ -3973,7 +3973,7 @@ void ARMATURE_OT_parent_clear(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_editarm_clear_parent_types, 0, "ClearType", "What way to clear parenting"); + ot->prop= RNA_def_enum(ot->srna, "type", prop_editarm_clear_parent_types, 0, "ClearType", "What way to clear parenting"); } /* **************** Selections ******************/ @@ -5559,7 +5559,7 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* settings */ - RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with."); + ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with."); } diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 0837e9cb48a..f4cf907ed4b 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -519,7 +519,8 @@ void POSELIB_OT_pose_remove (wmOperatorType *ot) /* properties */ prop= RNA_def_enum(ot->srna, "pose", prop_poses_dummy_types, 0, "Pose", "The pose to remove"); - RNA_def_enum_funcs(prop, poselib_stored_pose_itemf); + RNA_def_enum_funcs(prop, poselib_stored_pose_itemf); + ot->prop= prop; } static int poselib_rename_invoke (bContext *C, wmOperator *op, wmEvent *evt) diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index df5f551fb0c..d26238150ca 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1617,7 +1617,7 @@ void POSE_OT_autoside_names (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* settings */ - RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with."); + ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with."); } /* ********************************************** */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f61596f397f..948448411bf 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2581,7 +2581,7 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, CU_POLY, "Type", "Spline type"); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, CU_POLY, "Type", "Spline type"); } /***************** set handle type operator *******************/ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index e5a0cd0f8cb..8926f63ceaa 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -594,7 +594,7 @@ void GPENCIL_OT_convert (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", ""); } /* ************************************************ */ diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index a286c0ad8e8..cdd5cee881f 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1504,7 +1504,7 @@ void MESH_OT_separate(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_separate_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_separate_types, 0, "Type", ""); } diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 412a733dee0..d73ce1a1214 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1304,6 +1304,7 @@ void MESH_OT_select_similar(wmOperatorType *ot) /* properties */ prop= RNA_def_enum(ot->srna, "type", prop_similar_types, SIMVERT_NORMAL, "Type", ""); RNA_def_enum_funcs(prop, select_similar_type_itemf); + ot->prop= prop; } /* ******************************************* */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index e41d60783fe..92b4800ccfd 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5881,6 +5881,7 @@ void MESH_OT_merge(wmOperatorType *ot) /* properties */ prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use."); RNA_def_enum_funcs(prop, merge_type_itemf); + ot->prop= prop; RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge."); } @@ -6082,7 +6083,7 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance."); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance."); } /********************** Region/Loop Operators *************************/ diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 9740a1cba01..9e9619a30ea 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -384,7 +384,7 @@ void OBJECT_OT_effector_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", ""); ED_object_add_generic_props(ot, TRUE); } @@ -806,7 +806,7 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", lamp_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", lamp_type_items, 0, "Type", ""); ED_object_add_generic_props(ot, FALSE); } @@ -1360,7 +1360,7 @@ void OBJECT_OT_convert(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to."); + ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to."); RNA_def_boolean(ot->srna, "keep_original", 0, "Keep Original", "Keep original objects instead of replacing them."); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 19ba5f7b32b..497b5e82e26 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1218,7 +1218,7 @@ void OBJECT_OT_constraint_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); } void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) @@ -1237,7 +1237,7 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); } void POSE_OT_constraint_add(wmOperatorType *ot) @@ -1256,7 +1256,7 @@ void POSE_OT_constraint_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); } void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) @@ -1275,7 +1275,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); } /************************ IK Constraint operators *********************/ diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 313ffe79c66..c9730e3490b 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -612,6 +612,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) /* properties */ prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to remove."); RNA_def_enum_funcs(prop, hook_mod_itemf); + ot->prop= prop; } static int object_hook_reset_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index a44ad47b94f..eec8104f29b 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -558,6 +558,7 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) /* properties */ prop= RNA_def_enum(ot->srna, "type", modifier_type_items, eModifierType_Subsurf, "Type", ""); RNA_def_enum_funcs(prop, modifier_add_itemf); + ot->prop= prop; } /************************ remove modifier operator *********************/ diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 5cf11771004..fbee03e3a30 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -286,7 +286,6 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt) /* create operator menu item with relevant properties filled in */ props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); - RNA_string_set(&props_ptr, "object", ob->id.name+2); /* present the menu and be done... */ uiPupMenuEnd(C, pup); @@ -337,8 +336,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) /* depsgraph flushes are needed for the new data */ DAG_scene_sort(scene); DAG_id_flush_update(&newob->id, OB_RECALC); - - WM_event_add_notifier(C, NC_OBJECT, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, newob); } else { BKE_report(op->reports, RPT_ERROR, "No object to make proxy for"); @@ -358,7 +356,7 @@ static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *ptr, GroupObject *go; if(!ob || !ob->dup_group) - return &DummyRNA_NULL_items; + return DummyRNA_NULL_items; memset(&item_tmp, 0, sizeof(item_tmp)); @@ -396,6 +394,7 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot) RNA_def_string(ot->srna, "object", "", 19, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for."); prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, 0, "Type", "Group object"); /* XXX, relies on hard coded ID at the moment */ RNA_def_enum_funcs(prop, proxy_group_object_itemf); + ot->prop= prop; } /********************** Clear Parent Operator ******************* */ @@ -452,7 +451,7 @@ void OBJECT_OT_parent_clear(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", ""); } /* ******************** Make Parent Operator *********************** */ @@ -893,7 +892,7 @@ void OBJECT_OT_track_clear(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_clear_track_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_clear_track_types, 0, "Type", ""); } /************************** Make Track Operator *****************************/ @@ -986,7 +985,7 @@ void OBJECT_OT_track_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_make_track_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_make_track_types, 0, "Type", ""); } /************************** Move to Layer Operator *****************************/ @@ -1768,7 +1767,7 @@ void OBJECT_OT_make_local(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); } static int make_single_user_exec(bContext *C, wmOperator *op) @@ -1819,7 +1818,7 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); RNA_def_boolean(ot->srna, "object", 0, "Object", "Make single user objects"); RNA_def_boolean(ot->srna, "obdata", 0, "Object Data", "Make single user object data"); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index b3a160dfff4..c671a81bc71 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -157,7 +157,7 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", ""); } /*********************** Selection by Links *********************/ @@ -318,7 +318,7 @@ void OBJECT_OT_select_linked(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", ""); } /*********************** Selected Grouped ********************/ @@ -619,7 +619,7 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first."); - RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); } /************************* Select by Layer **********************/ diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 43382562a8a..9e4cc012171 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1040,6 +1040,7 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", ""); + } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 84b70e0a690..4e31dffd3da 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1882,5 +1882,6 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) /* properties */ 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; } diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index b7a97d1131a..50a1bffbf30 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -97,7 +97,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", ""); } static int rule_del_exec(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index f0870ca9764..eb03d3954d2 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2586,7 +2586,7 @@ void PARTICLE_OT_delete(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys."); + ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys."); } /*************************** mirror operator **************************/ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e45c8bc48ee..912ac98aee4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3764,7 +3764,7 @@ void SCENE_OT_new(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); } /********************* delete scene operator *********************/ diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 6dcd3049c0e..d94d5bec490 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -513,7 +513,7 @@ void ACTION_OT_keyframe_insert (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", ""); } /* ******************** Duplicate Keyframes Operator ************************* */ @@ -872,7 +872,7 @@ void ACTION_OT_extrapolation_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", ""); } /* ******************** Set Interpolation-Type Operator *********************** */ @@ -943,7 +943,7 @@ void ACTION_OT_interpolation_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", ""); } /* ******************** Set Handle-Type Operator *********************** */ @@ -1032,7 +1032,7 @@ void ACTION_OT_handle_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); } /* ******************** Set Keyframe-Type Operator *********************** */ @@ -1103,7 +1103,7 @@ void ACTION_OT_keyframe_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", ""); } /* ************************************************************************** */ @@ -1268,7 +1268,7 @@ void ACTION_OT_snap (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", ""); } /* ******************** Mirror Keyframes Operator *********************** */ @@ -1385,7 +1385,7 @@ void ACTION_OT_mirror (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", ""); } /* ************************************************************************** */ diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 9b4ec3882de..eda2b2021e5 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -78,16 +78,16 @@ static void console_line_color(unsigned char *fg, int type) { switch(type) { case CONSOLE_LINE_OUTPUT: - UI_GetThemeColor3ubv(TH_CONSOLE_OUTPUT, fg); + UI_GetThemeColor3ubv(TH_CONSOLE_OUTPUT, (char *)fg); break; case CONSOLE_LINE_INPUT: - UI_GetThemeColor3ubv(TH_CONSOLE_INPUT, fg); + UI_GetThemeColor3ubv(TH_CONSOLE_INPUT, (char *)fg); break; case CONSOLE_LINE_INFO: - UI_GetThemeColor3ubv(TH_CONSOLE_INFO, fg); + UI_GetThemeColor3ubv(TH_CONSOLE_INFO, (char *)fg); break; case CONSOLE_LINE_ERROR: - UI_GetThemeColor3ubv(TH_CONSOLE_ERROR, fg); + UI_GetThemeColor3ubv(TH_CONSOLE_ERROR, (char *)fg); break; } } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 2adf783b338..db63499d645 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -497,7 +497,7 @@ void GRAPH_OT_keyframe_insert (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_graphkeys_insertkey_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_insertkey_types, 0, "Type", ""); } /* ******************** Click-Insert Keyframes Operator ************************* */ @@ -1270,7 +1270,7 @@ void GRAPH_OT_extrapolation_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", ""); } /* ******************** Set Interpolation-Type Operator *********************** */ @@ -1339,7 +1339,7 @@ void GRAPH_OT_interpolation_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", beztriple_interpolation_mode_items, 0, "Type", ""); } /* ******************** Set Handle-Type Operator *********************** */ @@ -1427,7 +1427,7 @@ void GRAPH_OT_handle_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); } /* ************************************************************************** */ @@ -1697,7 +1697,7 @@ void GRAPH_OT_snap (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_graphkeys_snap_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_snap_types, 0, "Type", ""); } /* ******************** Mirror Keyframes Operator *********************** */ @@ -1814,7 +1814,7 @@ void GRAPH_OT_mirror (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", ""); } /* ******************** Smooth Keyframes Operator *********************** */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 4422bc2d158..a54627ec0d8 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1484,7 +1484,7 @@ void NLA_OT_snap (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", ""); } /* *********************************************** */ diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 9e9b0075f0f..97f1d34f673 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -3319,7 +3319,7 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot) ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", ""); } /* **************************************** */ @@ -3377,7 +3377,7 @@ void OUTLINER_OT_group_operation(wmOperatorType *ot) ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_group_op_types, 0, "Group Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_group_op_types, 0, "Group Operation", ""); } /* **************************************** */ @@ -3443,7 +3443,7 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot) ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", ""); } /* **************************************** */ @@ -3514,7 +3514,7 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", ""); } diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 66d2fe1ef7b..2ff45ea600e 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -1089,7 +1089,6 @@ void VIEW3D_OT_snap_selected_to_center(wmOperatorType *ot) static int snap_curs_to_center(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); - RegionView3D *rv3d= CTX_wm_region_data(C); View3D *v3d= CTX_wm_view3d(C); float *curs; curs= give_cursor(scene, v3d); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 0601d0b296e..14f0e860576 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -130,7 +130,7 @@ void TRANSFORM_OT_snap_type(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* props */ - RNA_def_enum(ot->srna, "type", snap_element_items, 0, "Type", "Set the snap element type"); + ot->prop= RNA_def_enum(ot->srna, "type", snap_element_items, 0, "Type", "Set the snap element type"); } diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 9ed6046ecd0..c69e706e28d 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -144,18 +144,42 @@ static void rna_Operator_report(wmOperator *op, int type, char *msg) BKE_report(op->reports, type, msg); } +/* since event isnt needed... */ +static int rna_Operator_enum_search_invoke(bContext *C, wmOperator *op) +{ + WM_enum_search_invoke(C, op, NULL); +} + #else +static void rna_generic_op_invoke(FunctionRNA *func, int use_event, int use_ret) +{ + PropertyRNA *parm; + + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); + parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + if(use_event) { + parm= RNA_def_pointer(func, "event", "Event", "", "Event."); + RNA_def_property_flag(parm, PROP_REQUIRED); + } + + if(use_ret) { + parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); + RNA_def_property_flag(parm, PROP_ENUM_FLAG); + RNA_def_function_return(func, parm); + } +} + void RNA_api_wm(StructRNA *srna) { FunctionRNA *func; PropertyRNA *parm; func= RNA_def_function(srna, "add_fileselect", "WM_event_add_fileselect"); - RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Show up the file selector."); - parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); - RNA_def_property_flag(parm, PROP_REQUIRED); + rna_generic_op_invoke(func, 0, 0); func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add"); parm= RNA_def_string(func, "name", "", 0, "Name", ""); @@ -165,24 +189,17 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); - RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Operator popup invoke."); - parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "event", "Event", "", "Event."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name? - RNA_def_property_flag(parm, PROP_ENUM_FLAG); - RNA_def_function_return(func, parm); + rna_generic_op_invoke(func, 1, 1); + /* invoke enum */ + func= RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke"); + rna_generic_op_invoke(func, 0, 1); /* invoke functions, for use with python */ func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup"); - RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Operator popup invoke."); - parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); - RNA_def_property_flag(parm, PROP_REQUIRED); + rna_generic_op_invoke(func, 0, 0); parm= RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX); parm= RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX); } diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 0b855a9cacb..ebe063b7c6f 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -65,6 +65,16 @@ void operator_wrapper(wmOperatorType *ot, void *userdata) ot->srna= srna; /* restore */ operator_properties_init(ot); + + { /* XXX - not nice, set the first enum as searchable, should have a way for python to set */ + PointerRNA ptr; + PropertyRNA *prop; + + RNA_pointer_create(NULL, ot->srna, NULL, &ptr); + prop = RNA_struct_find_property(&ptr, "type"); + if(prop) + ot->prop= prop; + } } void macro_wrapper(wmOperatorType *ot, void *userdata) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index ace638914dc..a4f61b7292d 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4011,6 +4011,9 @@ int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) order= PyDict_GetItemString(class_dict, "order"); + if(order==NULL) + PyErr_Clear(); + if(order && PyList_Check(order)) { for(pos= 0; pos<PyList_GET_SIZE(order); pos++) { key= PyList_GET_ITEM(order, pos); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index ee82fccc864..eb8139ad62e 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -390,6 +390,10 @@ typedef struct wmOperatorType { /* rna for properties */ struct StructRNA *srna; + /* rna property to use for generic invoke functions. + * menus, enum search... etc */ + PropertyRNA *prop; + /* struct wmOperatorTypeMacro */ ListBase macro; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 278c597ab4a..79f36ca0513 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -597,27 +597,15 @@ void WM_operator_properties_free(PointerRNA *ptr) /* invoke callback, uses enum property named "type" */ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) { - PropertyRNA *prop; + PropertyRNA *prop= op->type->prop; uiPopupMenu *pup; uiLayout *layout; - prop= RNA_struct_find_property(op->ptr, "type"); - - if(!prop) { - RNA_STRUCT_BEGIN(op->ptr, findprop) { - if(RNA_property_type(findprop) == PROP_ENUM) { - prop= findprop; - break; - } - } - RNA_STRUCT_END; - } - if(prop==NULL) { - printf("WM_menu_invoke: %s has no \"type\" enum property\n", op->type->idname); + printf("WM_menu_invoke: %s has no enum property set\n", op->type->idname); } else if (RNA_property_type(prop) != PROP_ENUM) { - printf("WM_menu_invoke: %s \"type\" is not an enum property\n", op->type->idname); + printf("WM_menu_invoke: %s \"%s\" is not an enum property\n", op->type->idname, RNA_property_identifier(prop)); } else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) { return op->type->exec(C, op); @@ -633,45 +621,47 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) } -/* ENUM Search popup */ +/* generic enum search invoke popup */ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, char *str, uiSearchItems *items) { wmOperatorType *ot = (wmOperatorType *)arg_ot; - PointerRNA ptr; - PropertyRNA *prop; - - /* enum */ - EnumPropertyItem *item, *item_array; - int free, found; - - RNA_pointer_create(NULL, ot->srna, NULL, &ptr); - prop = RNA_struct_find_property(&ptr, "type"); // XXX, SHOULD NOT USE HARD CODED VALUE + PropertyRNA *prop= ot->prop; - RNA_property_enum_items((bContext *)C, &ptr, prop, &item_array, NULL, &free); - - for(item= item_array; item->identifier; item++) { - /* note: need to give the intex rather then the dientifier because the enum can be freed */ - if(BLI_strcasestr(item->name, str)) - if(0==uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0)) - break; + if(prop==NULL) { + printf("WM_enum_search_invoke: %s has no enum property set\n", ot->idname); } + else if (RNA_property_type(prop) != PROP_ENUM) { + printf("WM_enum_search_invoke: %s \"%s\" is not an enum property\n", ot->idname, RNA_property_identifier(prop)); + } + else { + PointerRNA ptr; - found= (item->identifier != NULL); /* could be alloc'd, assign before free */ + EnumPropertyItem *item, *item_array; + int free; - if(free) - MEM_freeN(item_array); + RNA_pointer_create(NULL, ot->srna, NULL, &ptr); + RNA_property_enum_items((bContext *)C, &ptr, prop, &item_array, NULL, &free); + for(item= item_array; item->identifier; item++) { + /* note: need to give the intex rather then the dientifier because the enum can be freed */ + if(BLI_strcasestr(item->name, str)) + if(0==uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0)) + break; + } + + if(free) + MEM_freeN(item_array); + } } static void operator_enum_call_cb(struct bContext *C, void *arg1, void *arg2) { wmOperatorType *ot= arg1; - int enum_value= GET_INT_FROM_POINTER(arg2); if(ot) { PointerRNA props_ptr; WM_operator_properties_create_ptr(&props_ptr, ot); - RNA_enum_set(&props_ptr, "type", enum_value); // XXX, SHOULD NOT USE HARD CODED VALUE + RNA_property_enum_set(&props_ptr, ot->prop, GET_INT_FROM_POINTER(arg2)); WM_operator_name_call(C, ot->idname, WM_OP_EXEC_DEFAULT, &props_ptr); WM_operator_properties_free(&props_ptr); } @@ -684,12 +674,14 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) wmWindow *win= CTX_wm_window(C); uiBlock *block; uiBut *but; + wmOperator *op= (wmOperator *)arg_op; block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); + //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, 19, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isnt so easy... but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 180, 19, 0, 0, ""); - uiButSetSearchFunc(but, operator_enum_search_cb, ((wmOperator *)arg_op)->type, operator_enum_call_cb, NULL); + uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 180, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); |