Blender  V3.3
action_ops.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #include <math.h>
9 #include <stdlib.h>
10 
11 #include "DNA_space_types.h"
12 
13 #include "ED_anim_api.h"
14 #include "ED_transform.h"
15 
16 #include "action_intern.h"
17 
18 #include "RNA_access.h"
19 
20 #include "WM_api.h"
21 #include "WM_types.h"
22 
23 /* ************************** registration - operator types **********************************/
24 
26 {
27  /* keyframes */
28  /* selection */
39 
40  /* editing */
56 
59 
63 
66 
71 
73 }
74 
76 {
78  wmOperatorTypeMacro *otmacro;
79 
80  ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move",
81  "Duplicate",
82  "Make a copy of all selected keyframes and move them",
84  WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
85  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
86  RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
87  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
88 }
89 
90 /* ************************** registration - keymaps **********************************/
91 
92 /* --------------- */
93 
94 void action_keymap(wmKeyConfig *keyconf)
95 {
96  /* keymap for all regions */
97  WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
98 
99  /* channels */
100  /* Channels are not directly handled by the Action Editor module,
101  * but are inherited from the Animation module.
102  * All the relevant operations, keymaps, drawing, etc.
103  * can therefore all be found in that module instead, as these
104  * are all used for the Graph-Editor too.
105  */
106 
107  /* keyframes */
108  WM_keymap_ensure(keyconf, "Dopesheet", SPACE_ACTION, 0);
109 }
@ SPACE_ACTION
@ TFM_TIME_DUPLICATE
Definition: ED_transform.h:54
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
void ACTION_OT_layer_prev(wmOperatorType *ot)
Definition: action_data.c:971
void ACTION_OT_push_down(wmOperatorType *ot)
Definition: action_data.c:358
void ACTION_OT_unlink(wmOperatorType *ot)
Definition: action_data.c:676
void ACTION_OT_stash_and_create(wmOperatorType *ot)
Definition: action_data.c:521
void ACTION_OT_stash(wmOperatorType *ot)
Definition: action_data.c:413
void ACTION_OT_new(wmOperatorType *ot)
Definition: action_data.c:278
void ACTION_OT_layer_next(wmOperatorType *ot)
Definition: action_data.c:872
void ACTION_OT_view_selected(wmOperatorType *ot)
Definition: action_edit.c:447
void ACTION_OT_keyframe_type(wmOperatorType *ot)
Definition: action_edit.c:1603
void ACTION_OT_easing_type(wmOperatorType *ot)
Definition: action_edit.c:1428
void ACTION_OT_view_all(wmOperatorType *ot)
Definition: action_edit.c:432
void ACTION_OT_sample(wmOperatorType *ot)
Definition: action_edit.c:1195
void ACTION_OT_previewrange_set(wmOperatorType *ot)
Definition: action_edit.c:280
void ACTION_OT_duplicate(wmOperatorType *ot)
Definition: action_edit.c:965
void ACTION_OT_delete(wmOperatorType *ot)
Definition: action_edit.c:1052
void ACTION_OT_view_frame(wmOperatorType *ot)
Definition: action_edit.c:472
void ACTION_OT_extrapolation_type(wmOperatorType *ot)
Definition: action_edit.c:1326
void ACTION_OT_keyframe_insert(wmOperatorType *ot)
Definition: action_edit.c:885
void ACTION_OT_snap(wmOperatorType *ot)
Definition: action_edit.c:1831
void ACTION_OT_frame_jump(wmOperatorType *ot)
Definition: action_edit.c:1709
void ACTION_OT_paste(wmOperatorType *ot)
Definition: action_edit.c:677
void ACTION_OT_copy(wmOperatorType *ot)
Definition: action_edit.c:583
void ACTION_OT_markers_make_local(wmOperatorType *ot)
Definition: action_edit.c:130
void ACTION_OT_interpolation_type(wmOperatorType *ot)
Definition: action_edit.c:1378
void ACTION_OT_handle_type(wmOperatorType *ot)
Definition: action_edit.c:1515
void ACTION_OT_mirror(wmOperatorType *ot)
Definition: action_edit.c:1955
void ACTION_OT_clean(wmOperatorType *ot)
Definition: action_edit.c:1124
void ACTION_OT_select_box(struct wmOperatorType *ot)
void ACTION_OT_clickselect(struct wmOperatorType *ot)
void ACTION_OT_select_all(struct wmOperatorType *ot)
void ACTION_OT_select_circle(struct wmOperatorType *ot)
void ACTION_OT_select_more(struct wmOperatorType *ot)
void ACTION_OT_select_column(struct wmOperatorType *ot)
void ACTION_OT_select_less(struct wmOperatorType *ot)
void ACTION_OT_select_lasso(struct wmOperatorType *ot)
void ACTION_OT_select_linked(struct wmOperatorType *ot)
void ACTION_OT_select_leftright(struct wmOperatorType *ot)
void action_operatortypes(void)
Definition: action_ops.c:25
void action_keymap(wmKeyConfig *keyconf)
Definition: action_ops.c:94
void ED_operatormacros_action(void)
Definition: action_ops.c:75
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:5015
wmOperatorType * ot
Definition: wm_files.c:3479
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))