Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / gpencil / gpencil_ops.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2009, Blender Foundation, Joshua Leung
19  * This is a new part of Blender
20  *
21  * Contributor(s): Joshua Leung, Antonio Vazquez
22  *
23  * ***** END GPL LICENSE BLOCK *****
24  */
25
26 /** \file blender/editors/gpencil/gpencil_ops.c
27  *  \ingroup edgpencil
28  */
29
30
31 #include <stdlib.h>
32 #include <stddef.h>
33 #include <stdio.h>
34
35 #include "BLI_sys_types.h"
36
37 #include "BKE_context.h"
38
39 #include "DNA_gpencil_types.h"
40
41 #include "WM_api.h"
42 #include "WM_types.h"
43
44 #include "RNA_access.h"
45
46 #include "ED_gpencil.h"
47 #include "ED_object.h"
48 #include "ED_transform.h"
49
50 #include "gpencil_intern.h"
51
52 /* ****************************************** */
53 /* Grease Pencil Keymaps */
54
55 /* Generic Drawing Keymap */
56 static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
57 {
58         wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil", 0, 0);
59         wmKeyMapItem *kmi;
60
61         /* Draw  --------------------------------------- */
62         /* draw */
63         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY);
64         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
65         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
66
67         /* draw - straight lines */
68         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY);
69         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT);
70         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
71
72         /* draw - poly lines */
73         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, KM_CTRL, DKEY);
74         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_POLY);
75         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
76
77         /* erase */
78         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, 0, DKEY);
79         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_ERASER);
80         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
81
82         /* Tablet Mappings for Drawing ------------------ */
83         /* For now, only support direct drawing using the eraser, as most users using a tablet
84          * may still want to use that as their primary pointing device!
85          */
86 #if 0
87         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", TABLET_STYLUS, KM_PRESS, 0, 0);
88         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
89         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
90 #endif
91
92         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", TABLET_ERASER, KM_PRESS, 0, 0);
93         RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_ERASER);
94         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
95
96         /* Viewport Tools ------------------------------- */
97
98         /* Enter EditMode */
99         WM_keymap_add_item(keymap, "GPENCIL_OT_editmode_toggle", TABKEY, KM_PRESS, 0, DKEY);
100
101         /* Pie Menu - For standard tools */
102         WM_keymap_add_menu_pie(keymap, "GPENCIL_MT_pie_tool_palette", QKEY, KM_PRESS, 0, DKEY);
103         WM_keymap_add_menu_pie(keymap, "GPENCIL_MT_pie_settings_palette", WKEY, KM_PRESS, 0, DKEY);
104
105         /* Add Blank Frame */
106         /* XXX: BKEY or NKEY? BKEY is easier to reach from DKEY, so we'll use that for now */
107         WM_keymap_add_item(keymap, "GPENCIL_OT_blank_frame_add", BKEY, KM_PRESS, 0, DKEY);
108
109         /* Delete Active Frame - For easier video tutorials/review sessions */
110         /* NOTE: This works even when not in EditMode */
111         WM_keymap_add_item(keymap, "GPENCIL_OT_active_frames_delete_all", XKEY, KM_PRESS, 0, DKEY);
112 }
113
114 /* ==================== */
115
116 /* Poll callback for stroke editing mode */
117 static int gp_stroke_editmode_poll(bContext *C)
118 {
119         bGPdata *gpd = CTX_data_gpencil_data(C);
120         return (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE));
121 }
122
123 /* Stroke Editing Keymap - Only when editmode is enabled */
124 static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
125 {
126         wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
127         wmKeyMapItem *kmi;
128
129         /* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
130         keymap->poll = gp_stroke_editmode_poll;
131
132         /* ----------------------------------------------- */
133
134         /* Exit EditMode */
135         WM_keymap_add_item(keymap, "GPENCIL_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0);
136
137         /* Pie Menu - For settings/tools easy access */
138         WM_keymap_add_menu_pie(keymap, "GPENCIL_MT_pie_sculpt", EKEY, KM_PRESS, 0, DKEY);
139
140         /* Brush Settings */
141         /* NOTE: We cannot expose these in the standard keymap, as they will interfere with regular hotkeys
142          *       in other modes. However, when we are dealing with Stroke Edit Mode, we know for certain
143          *       that the only data being edited is that of the Grease Pencil strokes
144          */
145
146         /* CTRL + FKEY = Eraser Radius */
147         kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0);
148         RNA_string_set(kmi->ptr, "data_path_primary", "user_preferences.edit.grease_pencil_eraser_radius");
149
150         /* Interpolation */
151         WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate", EKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
152         WM_keymap_add_item(keymap, "GPENCIL_OT_interpolate_sequence", EKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
153
154         /* Sculpting ------------------------------------- */
155
156         /* Brush-Based Editing:
157          *   EKEY + LMB                          = Single stroke, draw immediately
158          *        + Other Modifiers (Ctrl/Shift) = Invert, Smooth, etc.
159          *
160          * For the modal version, use D+E -> Sculpt
161          */
162         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, 0, EKEY);
163         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
164
165         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_CTRL, EKEY);
166         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
167         /*RNA_boolean_set(kmi->ptr, "use_invert", true);*/
168
169         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_brush_paint", LEFTMOUSE, KM_PRESS, KM_SHIFT, EKEY);
170         RNA_boolean_set(kmi->ptr, "wait_for_input", false);
171         /*RNA_boolean_set(kmi->ptr, "use_smooth", true);*/
172
173
174         /* Shift-FKEY = Sculpt Strength */
175         kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
176         RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.strength");
177
178         /* FKEY = Sculpt Brush Size */
179         kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0);
180         RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_sculpt.brush.size");
181
182
183         /* Selection ------------------------------------- */
184         /* select all */
185         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_all", AKEY, KM_PRESS, 0, 0);
186         RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
187
188         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
189         RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
190
191         /* circle select */
192         WM_keymap_add_item(keymap, "GPENCIL_OT_select_circle", CKEY, KM_PRESS, 0, 0);
193
194         /* border select */
195         WM_keymap_add_item(keymap, "GPENCIL_OT_select_border", BKEY, KM_PRESS, 0, 0);
196
197         /* lasso select */
198         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0);
199         RNA_boolean_set(kmi->ptr, "deselect", false);
200         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL, 0);
201         RNA_boolean_set(kmi->ptr, "deselect", true);
202
203         /* In the Node Editor, lasso select needs ALT modifier too (as somehow CTRL+LMB drag gets taken for "cut" quite early)
204          * There probably isn't too much harm adding this for other editors too as part of standard GP editing keymap. This hotkey
205          * combo doesn't seem to see much use under standard scenarios?
206          */
207         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_ALT, 0);
208         RNA_boolean_set(kmi->ptr, "deselect", false);
209         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL | KM_ALT, 0);
210         RNA_boolean_set(kmi->ptr, "deselect", true);
211
212         /* normal select */
213         WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
214
215         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
216         RNA_boolean_set(kmi->ptr, "extend", true);
217         RNA_boolean_set(kmi->ptr, "toggle", true);
218
219         /* whole stroke select */
220         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
221         RNA_boolean_set(kmi->ptr, "entire_strokes", true);
222
223         /* select linked */
224         /* NOTE: While LKEY is redundant, not having it breaks the mode illusion too much */
225         WM_keymap_add_item(keymap, "GPENCIL_OT_select_linked", LKEY, KM_PRESS, 0, 0);
226         WM_keymap_add_item(keymap, "GPENCIL_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
227
228         /* select grouped */
229         WM_keymap_add_item(keymap, "GPENCIL_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
230
231         /* select more/less */
232         WM_keymap_add_item(keymap, "GPENCIL_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
233         WM_keymap_add_item(keymap, "GPENCIL_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
234
235         /* Editing ----------------------------------------- */
236
237         /* duplicate and move selected points */
238         WM_keymap_add_item(keymap, "GPENCIL_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
239
240         /* delete */
241         WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_gpencil_delete", XKEY, KM_PRESS, 0, 0);
242         WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_gpencil_delete", DELKEY, KM_PRESS, 0, 0);
243
244         WM_keymap_add_item(keymap, "GPENCIL_OT_dissolve", XKEY, KM_PRESS, KM_CTRL, 0);
245         WM_keymap_add_item(keymap, "GPENCIL_OT_dissolve", DELKEY, KM_PRESS, KM_CTRL, 0);
246
247         WM_keymap_add_item(keymap, "GPENCIL_OT_active_frames_delete_all", XKEY, KM_PRESS, KM_SHIFT, 0);
248
249         /* menu edit specials */
250         WM_keymap_add_menu(keymap, "GPENCIL_MT_gpencil_edit_specials", WKEY, KM_PRESS, 0, 0);
251
252         /* join strokes */
253         WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_join", JKEY, KM_PRESS, KM_CTRL, 0);
254
255         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_join", JKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
256         RNA_enum_set(kmi->ptr, "type", GP_STROKE_JOINCOPY);
257
258         /* copy + paste */
259         WM_keymap_add_item(keymap, "GPENCIL_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
260         WM_keymap_add_item(keymap, "GPENCIL_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
261
262 #ifdef __APPLE__
263         WM_keymap_add_item(keymap, "GPENCIL_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
264         WM_keymap_add_item(keymap, "GPENCIL_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
265 #endif
266
267         /* snap */
268         WM_keymap_add_menu(keymap, "GPENCIL_MT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
269
270
271         /* convert to geometry */
272         WM_keymap_add_item(keymap, "GPENCIL_OT_convert", CKEY, KM_PRESS, KM_ALT, 0);
273
274
275         /* Show/Hide */
276         /* NOTE: These are available only in EditMode now, since they clash with general-purpose hotkeys */
277         WM_keymap_add_item(keymap, "GPENCIL_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
278
279         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_hide", HKEY, KM_PRESS, 0, 0);
280         RNA_boolean_set(kmi->ptr, "unselected", false);
281
282         kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
283         RNA_boolean_set(kmi->ptr, "unselected", true);
284
285         WM_keymap_add_item(keymap, "GPENCIL_OT_selection_opacity_toggle", HKEY, KM_PRESS, KM_CTRL, 0);
286
287         /* Isolate Layer */
288         WM_keymap_add_item(keymap, "GPENCIL_OT_layer_isolate", PADASTERKEY, KM_PRESS, 0, 0);
289
290         /* Move to Layer */
291         WM_keymap_add_item(keymap, "GPENCIL_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
292
293         /* Transform Tools */
294         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_translate", GKEY, KM_PRESS, 0, 0);
295
296         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_translate", EVT_TWEAK_S, KM_ANY, 0, 0);
297
298         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_rotate", RKEY, KM_PRESS, 0, 0);
299
300         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_resize", SKEY, KM_PRESS, 0, 0);
301
302         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
303
304         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_bend", WKEY, KM_PRESS, KM_SHIFT, 0);
305
306         WM_keymap_add_item(keymap, "TRANSFORM_OT_tosphere", SKEY, KM_PRESS, KM_ALT | KM_SHIFT, 0);
307
308         WM_keymap_add_item(keymap, "TRANSFORM_OT_shear", SKEY, KM_PRESS, KM_ALT | KM_CTRL | KM_SHIFT, 0);
309
310         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0);
311         RNA_enum_set(kmi->ptr, "mode", TFM_GPENCIL_SHRINKFATTEN);
312
313         /* Proportional Editing */
314         ED_keymap_proportional_cycle(keyconf, keymap);
315         ED_keymap_proportional_editmode(keyconf, keymap, true);
316 }
317
318 /* ==================== */
319
320 void ED_keymap_gpencil(wmKeyConfig *keyconf)
321 {
322         ed_keymap_gpencil_general(keyconf);
323         ed_keymap_gpencil_editing(keyconf);
324 }
325
326 /* ****************************************** */
327
328 void ED_operatortypes_gpencil(void)
329 {
330         /* Drawing ----------------------- */
331
332         WM_operatortype_append(GPENCIL_OT_draw);
333
334         /* Editing (Strokes) ------------ */
335
336         WM_operatortype_append(GPENCIL_OT_editmode_toggle);
337         WM_operatortype_append(GPENCIL_OT_selection_opacity_toggle);
338
339         WM_operatortype_append(GPENCIL_OT_select);
340         WM_operatortype_append(GPENCIL_OT_select_all);
341         WM_operatortype_append(GPENCIL_OT_select_circle);
342         WM_operatortype_append(GPENCIL_OT_select_border);
343         WM_operatortype_append(GPENCIL_OT_select_lasso);
344
345         WM_operatortype_append(GPENCIL_OT_select_linked);
346         WM_operatortype_append(GPENCIL_OT_select_grouped);
347         WM_operatortype_append(GPENCIL_OT_select_more);
348         WM_operatortype_append(GPENCIL_OT_select_less);
349         WM_operatortype_append(GPENCIL_OT_select_first);
350         WM_operatortype_append(GPENCIL_OT_select_last);
351
352         WM_operatortype_append(GPENCIL_OT_duplicate);
353         WM_operatortype_append(GPENCIL_OT_delete);
354         WM_operatortype_append(GPENCIL_OT_dissolve);
355         WM_operatortype_append(GPENCIL_OT_copy);
356         WM_operatortype_append(GPENCIL_OT_paste);
357
358         WM_operatortype_append(GPENCIL_OT_move_to_layer);
359         WM_operatortype_append(GPENCIL_OT_layer_change);
360
361         WM_operatortype_append(GPENCIL_OT_snap_to_grid);
362         WM_operatortype_append(GPENCIL_OT_snap_to_cursor);
363         WM_operatortype_append(GPENCIL_OT_snap_cursor_to_selected);
364
365         WM_operatortype_append(GPENCIL_OT_reproject);
366
367         WM_operatortype_append(GPENCIL_OT_brush_paint);
368
369         /* Editing (Buttons) ------------ */
370
371         WM_operatortype_append(GPENCIL_OT_data_add);
372         WM_operatortype_append(GPENCIL_OT_data_unlink);
373
374         WM_operatortype_append(GPENCIL_OT_layer_add);
375         WM_operatortype_append(GPENCIL_OT_layer_remove);
376         WM_operatortype_append(GPENCIL_OT_layer_move);
377         WM_operatortype_append(GPENCIL_OT_layer_duplicate);
378
379         WM_operatortype_append(GPENCIL_OT_hide);
380         WM_operatortype_append(GPENCIL_OT_reveal);
381         WM_operatortype_append(GPENCIL_OT_lock_all);
382         WM_operatortype_append(GPENCIL_OT_unlock_all);
383         WM_operatortype_append(GPENCIL_OT_layer_isolate);
384         WM_operatortype_append(GPENCIL_OT_layer_merge);
385
386         WM_operatortype_append(GPENCIL_OT_blank_frame_add);
387
388         WM_operatortype_append(GPENCIL_OT_active_frame_delete);
389         WM_operatortype_append(GPENCIL_OT_active_frames_delete_all);
390
391         WM_operatortype_append(GPENCIL_OT_convert);
392
393         WM_operatortype_append(GPENCIL_OT_stroke_arrange);
394         WM_operatortype_append(GPENCIL_OT_stroke_change_color);
395         WM_operatortype_append(GPENCIL_OT_stroke_lock_color);
396         WM_operatortype_append(GPENCIL_OT_stroke_apply_thickness);
397         WM_operatortype_append(GPENCIL_OT_stroke_cyclical_set);
398         WM_operatortype_append(GPENCIL_OT_stroke_join);
399         WM_operatortype_append(GPENCIL_OT_stroke_flip);
400         WM_operatortype_append(GPENCIL_OT_stroke_subdivide);
401
402         WM_operatortype_append(GPENCIL_OT_palette_add);
403         WM_operatortype_append(GPENCIL_OT_palette_remove);
404         WM_operatortype_append(GPENCIL_OT_palette_change);
405         WM_operatortype_append(GPENCIL_OT_palette_lock_layer);
406         WM_operatortype_append(GPENCIL_OT_palettecolor_add);
407         WM_operatortype_append(GPENCIL_OT_palettecolor_remove);
408         WM_operatortype_append(GPENCIL_OT_palettecolor_isolate);
409         WM_operatortype_append(GPENCIL_OT_palettecolor_hide);
410         WM_operatortype_append(GPENCIL_OT_palettecolor_reveal);
411         WM_operatortype_append(GPENCIL_OT_palettecolor_lock_all);
412         WM_operatortype_append(GPENCIL_OT_palettecolor_unlock_all);
413         WM_operatortype_append(GPENCIL_OT_palettecolor_move);
414         WM_operatortype_append(GPENCIL_OT_palettecolor_select);
415         WM_operatortype_append(GPENCIL_OT_palettecolor_copy);
416
417         WM_operatortype_append(GPENCIL_OT_brush_add);
418         WM_operatortype_append(GPENCIL_OT_brush_remove);
419         WM_operatortype_append(GPENCIL_OT_brush_change);
420         WM_operatortype_append(GPENCIL_OT_brush_move);
421         WM_operatortype_append(GPENCIL_OT_brush_presets_create);
422         WM_operatortype_append(GPENCIL_OT_brush_copy);
423         WM_operatortype_append(GPENCIL_OT_brush_select);
424
425         /* Editing (Time) --------------- */
426
427         /* Interpolation */
428         WM_operatortype_append(GPENCIL_OT_interpolate);
429         WM_operatortype_append(GPENCIL_OT_interpolate_sequence);
430         WM_operatortype_append(GPENCIL_OT_interpolate_reverse);
431 }
432
433 void ED_operatormacros_gpencil(void)
434 {
435         wmOperatorType *ot;
436         wmOperatorTypeMacro *otmacro;
437
438         /* Duplicate + Move = Interactively place newly duplicated strokes */
439         ot = WM_operatortype_append_macro("GPENCIL_OT_duplicate_move", "Duplicate Strokes",
440                                           "Make copies of the selected Grease Pencil strokes and move them",
441                                           OPTYPE_UNDO | OPTYPE_REGISTER);
442         WM_operatortype_macro_define(ot, "GPENCIL_OT_duplicate");
443         otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
444         RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true);
445
446 }
447
448 /* ****************************************** */