Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-24 09:38:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-24 09:38:20 +0400
commit8be86d32542c13a1ae0642194d1ed5378a1e5b7c (patch)
tree9c99c7441bafba9d255c8d6287a0edc1c14889b9 /source/blender/editors/mesh
parent8fc11f79c5cd198355f8256a0e4f863fd7cd5a82 (diff)
use a search popup for 'blend from shape' tool, suggested by Juan Pablo.
use standard operator panel, since the popup was too easy to cancel by accident, especially with a popup search menu.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index a3252b47051..9bc926598db 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -72,6 +72,7 @@
#include "RE_render_ext.h"
#include "UI_interface.h"
+#include "UI_resources.h"
#include "mesh_intern.h"
@@ -2508,6 +2509,22 @@ static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), Prop
return item;
}
+static void edbm_blend_from_shape_ui(bContext *C, wmOperator *op)
+{
+ uiLayout *layout = op->layout;
+ PointerRNA ptr;
+ Object *obedit = CTX_data_edit_object(C);
+ Mesh *me = obedit->data;
+ PointerRNA ptr_key;
+
+ RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
+ RNA_id_pointer_create((ID *)me->key, &ptr_key);
+
+ uiItemPointerR(layout, &ptr, "shape", &ptr_key, "key_blocks", "", ICON_SHAPEKEY_DATA);
+ uiItemR(layout, &ptr, "blend", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "add", 0, NULL, ICON_NONE);
+}
+
void MESH_OT_blend_from_shape(wmOperatorType *ot)
{
PropertyRNA *prop;
@@ -2520,7 +2537,8 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
/* api callbacks */
ot->exec = edbm_blend_from_shape_exec;
- ot->invoke = WM_operator_props_popup_call;
+// ot->invoke = WM_operator_props_popup_call; /* disable because search popup closes too easily */
+ ot->ui = edbm_blend_from_shape_ui;
ot->poll = ED_operator_editmesh;
/* flags */