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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-03-04 19:02:42 +0300
committerTon Roosendaal <ton@blender.org>2011-03-04 19:02:42 +0300
commit7006038b02c797a5e485518b8137ea2738290528 (patch)
tree3c06460706d2ea546d0c13233adbb7c29d43e8f5 /source
parent9834aea0318089f5cbf526c3b7997b795dcdd920 (diff)
Bugfix #26317
Shift+D in graph editor was an operator calling internally an operator. Better is to make it a Macro, then Undos and Esc work nicely. Note for API users: the operator "graph.duplicate" will now just copy the selection and not run transform. Nicer too :)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/ED_anim_api.h4
-rw-r--r--source/blender/editors/space_api/spacetypes.c3
-rw-r--r--source/blender/editors/space_graph/graph_edit.c3
-rw-r--r--source/blender/editors/space_graph/graph_ops.c15
4 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index d19d3549fad..67acccd94e2 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -585,6 +585,10 @@ void ED_keymap_animchannels(struct wmKeyConfig *keyconf);
/* generic time editing */
void ED_operatortypes_anim(void);
void ED_keymap_anim(struct wmKeyConfig *keyconf);
+
+ /* space_graph */
+void ED_operatormacros_graph(void);
+
/* ************************************************ */
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 5fa4205565f..9ae50d04425 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -127,7 +127,8 @@ void ED_spacetypes_init(void)
ED_operatormacros_node();
ED_operatormacros_object();
ED_operatormacros_file();
-
+ ED_operatormacros_graph();
+
/* register dropboxes (can use macros) */
spacetypes = BKE_spacetypes_list();
for(type=spacetypes->first; type; type=type->next) {
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index c3a6ac7ce12..d3e53a11c10 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -781,9 +781,6 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
graphkeys_duplicate_exec(C, op);
-
- RNA_int_set(op->ptr, "mode", TFM_TIME_DUPLICATE);
- WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 0c0cfbf2cf3..b1dae57b574 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -269,6 +269,19 @@ void graphedit_operatortypes(void)
WM_operatortype_append(GRAPH_OT_fmodifier_paste);
}
+void ED_operatormacros_graph(void)
+{
+ wmOperatorType *ot;
+ wmOperatorTypeMacro *otmacro;
+
+ ot= WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
+ otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+ RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+
+}
+
+
/* ************************** registration - keymaps **********************************/
static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
@@ -361,7 +374,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
WM_keymap_add_item(keymap, "GRAPH_OT_delete", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_delete", DELKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "GRAPH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "GRAPH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
/* insertkey */
WM_keymap_add_item(keymap, "GRAPH_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);