Blender  V2.93
action_ops.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <math.h>
25 #include <stdlib.h>
26 
27 #include "DNA_space_types.h"
28 
29 #include "ED_anim_api.h"
30 #include "ED_transform.h"
31 
32 #include "action_intern.h"
33 
34 #include "RNA_access.h"
35 
36 #include "WM_api.h"
37 #include "WM_types.h"
38 
39 /* ************************** registration - operator types **********************************/
40 
42 {
43  /* keyframes */
44  /* selection */
55 
56  /* editing */
72 
75 
79 
82 
87 
89 }
90 
92 {
94  wmOperatorTypeMacro *otmacro;
95 
96  ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move",
97  "Duplicate",
98  "Make a copy of all selected keyframes and move them",
100  WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
101  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
102  RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
103  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
104 }
105 
106 /* ************************** registration - keymaps **********************************/
107 
108 /* --------------- */
109 
111 {
112  /* keymap for all regions */
113  WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
114 
115  /* channels */
116  /* Channels are not directly handled by the Action Editor module,
117  * but are inherited from the Animation module.
118  * All the relevant operations, keymaps, drawing, etc.
119  * can therefore all be found in that module instead, as these
120  * are all used for the Graph-Editor too.
121  */
122 
123  /* keyframes */
124  WM_keymap_ensure(keyconf, "Dopesheet", SPACE_ACTION, 0);
125 }
@ SPACE_ACTION
@ TFM_TIME_DUPLICATE
Definition: ED_transform.h:69
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
void ACTION_OT_layer_prev(wmOperatorType *ot)
Definition: action_data.c:966
void ACTION_OT_push_down(wmOperatorType *ot)
Definition: action_data.c:356
void ACTION_OT_unlink(wmOperatorType *ot)
Definition: action_data.c:674
void ACTION_OT_stash_and_create(wmOperatorType *ot)
Definition: action_data.c:519
void ACTION_OT_stash(wmOperatorType *ot)
Definition: action_data.c:411
void ACTION_OT_new(wmOperatorType *ot)
Definition: action_data.c:283
void ACTION_OT_layer_next(wmOperatorType *ot)
Definition: action_data.c:867
void ACTION_OT_view_selected(wmOperatorType *ot)
Definition: action_edit.c:462
void ACTION_OT_keyframe_type(wmOperatorType *ot)
Definition: action_edit.c:1615
void ACTION_OT_easing_type(wmOperatorType *ot)
Definition: action_edit.c:1422
void ACTION_OT_view_all(wmOperatorType *ot)
Definition: action_edit.c:447
void ACTION_OT_sample(wmOperatorType *ot)
Definition: action_edit.c:1192
void ACTION_OT_previewrange_set(wmOperatorType *ot)
Definition: action_edit.c:295
void ACTION_OT_duplicate(wmOperatorType *ot)
Definition: action_edit.c:956
void ACTION_OT_delete(wmOperatorType *ot)
Definition: action_edit.c:1049
void ACTION_OT_view_frame(wmOperatorType *ot)
Definition: action_edit.c:487
void ACTION_OT_extrapolation_type(wmOperatorType *ot)
Definition: action_edit.c:1323
void ACTION_OT_keyframe_insert(wmOperatorType *ot)
Definition: action_edit.c:876
void ACTION_OT_snap(wmOperatorType *ot)
Definition: action_edit.c:1818
void ACTION_OT_frame_jump(wmOperatorType *ot)
Definition: action_edit.c:1696
void ACTION_OT_paste(wmOperatorType *ot)
Definition: action_edit.c:668
void ACTION_OT_copy(wmOperatorType *ot)
Definition: action_edit.c:593
void ACTION_OT_markers_make_local(wmOperatorType *ot)
Definition: action_edit.c:146
void ACTION_OT_interpolation_type(wmOperatorType *ot)
Definition: action_edit.c:1374
void ACTION_OT_handle_type(wmOperatorType *ot)
Definition: action_edit.c:1509
void ACTION_OT_mirror(wmOperatorType *ot)
Definition: action_edit.c:1948
void ACTION_OT_clean(wmOperatorType *ot)
Definition: action_edit.c:1121
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:41
void action_keymap(wmKeyConfig *keyconf)
Definition: action_ops.c:110
void ED_operatormacros_action(void)
Definition: action_ops.c:91
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:6272
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
wmOperatorType * ot
Definition: wm_files.c:3156
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 *))