From 2e3e044d27e90dc87bdce6af9cef77d9543e4d89 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 19:56:13 +0000 Subject: RNA * Enums can now be dynamically created in the _itemf callback, using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking for enum items now need to potentially free the items. * This callback now also gets context, this was added specifically for operators. This doesn't fit design well at all, needed to do some ugly hacks, but can't find a good solution at the moment. * All enums must have a default list of items too, even with an _itemf callback, for docs and fallback in case there is no context. * Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation. * Also changes some operator properties that were enums to booleas (unselected, deselect), to make them consistent with other ops. --- source/blender/editors/mesh/editmesh.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/mesh/editmesh.c') diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index a680fb5d07a..cdd51a72f4f 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1606,13 +1606,13 @@ static int mesh_separate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Base *base= CTX_data_active_base(C); - int retval= 0; + int retval= 0, type= RNA_enum_get(op->ptr, "type"); - if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")) + if(type == 0) retval= mesh_separate_selected(scene, base); - else if(RNA_enum_is_equal(op->ptr, "type", "MATERIAL")) + else if(type == 1) retval= mesh_separate_material (scene, base); - else if(RNA_enum_is_equal(op->ptr, "type", "LOOSE")) + else if(type == 2) retval= mesh_separate_loose(scene, base); if(retval) { -- cgit v1.2.3