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-05 17:03:29 +0300
committerTon Roosendaal <ton@blender.org>2011-03-05 17:03:29 +0300
commit3d0390a518947c7cc3ba08c288e6c9b9654df909 (patch)
tree8520980df22bc8963988f4efa323d37734a947d2 /source
parent3a590b4ec7a2c4f99e104bd2851bf2da46817173 (diff)
Bugfix #26317
Dopesheet: shift+d duplicate is now a macro too, allowing a single undo.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/ED_anim_api.h3
-rw-r--r--source/blender/editors/space_action/action_edit.c3
-rw-r--r--source/blender/editors/space_action/action_ops.c14
-rw-r--r--source/blender/editors/space_api/spacetypes.c1
4 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 67acccd94e2..1ca33e73656 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -588,7 +588,8 @@ void ED_keymap_anim(struct wmKeyConfig *keyconf);
/* space_graph */
void ED_operatormacros_graph(void);
-
+ /* space_action */
+void ED_operatormacros_action(void);
/* ************************************************ */
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index bb1aa1b6444..27148a87471 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -663,9 +663,6 @@ static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
{
actkeys_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_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index 0979d69477b..6c3258e8639 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -88,6 +88,18 @@ void action_operatortypes(void)
WM_operatortype_append(ACTION_OT_markers_make_local);
}
+void ED_operatormacros_action(void)
+{
+ wmOperatorType *ot;
+ wmOperatorTypeMacro *otmacro;
+
+ ot= WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
+ otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+ RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+
+}
+
/* ************************** registration - keymaps **********************************/
static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
@@ -159,7 +171,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
WM_keymap_add_item(keymap, "ACTION_OT_delete", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "ACTION_OT_delete", DELKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "ACTION_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "ACTION_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "ACTION_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);
/* copy/paste */
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 9ae50d04425..8d8cdcc7183 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -128,6 +128,7 @@ void ED_spacetypes_init(void)
ED_operatormacros_object();
ED_operatormacros_file();
ED_operatormacros_graph();
+ ED_operatormacros_action();
/* register dropboxes (can use macros) */
spacetypes = BKE_spacetypes_list();