Blender  V3.3
gpencil_ops.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation. */
3 
8 #include <stddef.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 
12 #include "BLI_sys_types.h"
13 
14 #include "BKE_context.h"
15 #include "BKE_paint.h"
16 
17 #include "DNA_brush_types.h"
18 #include "DNA_gpencil_types.h"
19 #include "DNA_object_types.h"
20 #include "DNA_screen_types.h"
21 #include "DNA_space_types.h"
22 
23 #include "WM_api.h"
24 #include "WM_toolsystem.h"
25 #include "WM_types.h"
26 
27 #include "RNA_access.h"
28 
29 #include "ED_gpencil.h"
30 
31 #include "gpencil_intern.h"
32 
33 /* ****************************************** */
34 /* Grease Pencil Keymaps */
35 
36 /* Generic Drawing Keymap - Annotations */
38 {
39  WM_keymap_ensure(keyconf, "Grease Pencil", 0, 0);
40 }
41 
42 /* ==================== */
43 
44 /* Poll callback for stroke editing mode */
46 {
48  return (gpd && (gpd->flag & GP_DATA_STROKE_EDITMODE));
49 }
50 
51 /* Poll callback for stroke curve editing mode */
53 {
56 }
57 
58 /* Poll callback for stroke painting mode */
60 {
61  /* TODO: limit this to mode, but review 2D editors */
63  return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE));
64 }
65 
66 static bool gpencil_stroke_paintmode_poll_with_tool(bContext *C, const char gpencil_tool)
67 {
68  /* TODO: limit this to mode, but review 2D editors */
70  if (!gpd) {
71  return false;
72  }
73 
75  if (!ts || !ts->gp_paint) {
76  return false;
77  }
78 
79  Brush *brush = BKE_paint_brush(&ts->gp_paint->paint);
80  return ((gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) &&
81  WM_toolsystem_active_tool_is_brush(C) && (brush->gpencil_tool == gpencil_tool));
82 }
83 
84 static bool gpencil_stroke_vertexmode_poll_with_tool(bContext *C, const char gpencil_vertex_tool)
85 {
87  if (!gpd) {
88  return false;
89  }
90 
92  if (!ts || !ts->gp_vertexpaint) {
93  return false;
94  }
95 
96  Brush *brush = BKE_paint_brush(&ts->gp_vertexpaint->paint);
97  return ((gpd->flag & GP_DATA_STROKE_VERTEXMODE) && (brush && brush->gpencil_settings) &&
99  (brush->gpencil_vertex_tool == gpencil_vertex_tool));
100 }
101 
102 static bool gpencil_stroke_sculptmode_poll_with_tool(bContext *C, const char gpencil_sculpt_tool)
103 {
105  if (!gpd) {
106  return false;
107  }
108 
110  if (!ts || !ts->gp_sculptpaint) {
111  return false;
112  }
113 
114  Brush *brush = BKE_paint_brush(&ts->gp_sculptpaint->paint);
115  return ((gpd->flag & GP_DATA_STROKE_SCULPTMODE) && (brush && brush->gpencil_settings) &&
117  (brush->gpencil_sculpt_tool == gpencil_sculpt_tool));
118 }
119 
120 static bool gpencil_stroke_weightmode_poll_with_tool(bContext *C, const char gpencil_weight_tool)
121 {
123  if (!gpd) {
124  return false;
125  }
126 
128  if (!ts || !ts->gp_weightpaint) {
129  return false;
130  }
131 
132  Brush *brush = BKE_paint_brush(&ts->gp_weightpaint->paint);
133  return ((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) && (brush && brush->gpencil_settings) &&
135  (brush->gpencil_weight_tool == gpencil_weight_tool));
136 }
137 
138 /* Poll callback for stroke painting (draw brush) */
140 {
142 }
143 
144 /* Poll callback for stroke painting (erase brush) */
146 {
148 }
149 
150 /* Poll callback for stroke painting (fill) */
152 {
154 }
155 
156 /* Poll callback for stroke painting (tint) */
158 {
160 }
161 
162 /* Poll callback for stroke sculpting mode */
164 {
168 
169  /* if not gpencil object and not view3d, need sculpt keys if edit mode */
170  if (area->spacetype != SPACE_VIEW3D) {
171  return ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
172  }
173 
174  if ((ob) && (ob->type == OB_GPENCIL)) {
175  return GPENCIL_SCULPT_MODE(gpd);
176  }
177 
178  return 0;
179 }
180 
181 /* Poll callback for stroke weight paint mode */
183 {
186 
187  if ((ob) && (ob->type == OB_GPENCIL)) {
188  return GPENCIL_WEIGHT_MODE(gpd);
189  }
190 
191  return 0;
192 }
193 
194 /* Poll callback for stroke vertex paint mode */
196 {
199 
200  if ((ob) && (ob->type == OB_GPENCIL)) {
201  return (gpd && (gpd->flag & GP_DATA_STROKE_VERTEXMODE));
202  }
203 
204  return 0;
205 }
206 
207 /* Poll callback for vertex painting (draw) */
209 {
211 }
212 
213 /* Poll callback for vertex painting (blur) */
215 {
217 }
218 
219 /* Poll callback for vertex painting (average) */
221 {
223 }
224 
225 /* Poll callback for vertex painting (smear) */
227 {
229 }
230 
231 /* Poll callback for vertex painting (replace) */
233 {
235 }
236 
237 /* Poll callback for sculpt (Smooth) */
239 {
241 }
242 /* Poll callback for sculpt (Thickness) */
244 {
246 }
247 
248 /* Poll callback for sculpt (Strength) */
250 {
252 }
253 
254 /* Poll callback for sculpt (Grab) */
256 {
258 }
259 
260 /* Poll callback for sculpt (Push) */
262 {
264 }
265 
266 /* Poll callback for sculpt (Twist) */
268 {
270 }
271 
272 /* Poll callback for sculpt (Pinch) */
274 {
276 }
277 /* Poll callback for sculpt (Randomize) */
279 {
281 }
282 
283 /* Poll callback for sculpt (Clone) */
285 {
287 }
288 
289 /* Poll callback for weight paint (Draw) */
291 {
293 }
294 
295 /* Stroke Editing Keymap - Only when editmode is enabled */
297 {
298  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
299 
300  /* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
302 }
303 
304 /* Stroke Curve Editing Keymap - Only when editmode is enabled and in curve edit mode */
306 {
307  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Curve Edit Mode", 0, 0);
308 
309  /* set poll callback - so that this keymap only gets enabled when curve editmode is enabled */
311 }
312 
313 /* keys for draw with a drawing brush (no fill) */
315 {
316  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Draw brush)", 0, 0);
318 }
319 
320 /* keys for draw with a eraser brush (erase) */
322 {
323  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Erase)", 0, 0);
325 }
326 
327 /* keys for draw with a fill brush */
329 {
330  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Fill)", 0, 0);
332 }
333 
334 /* keys for draw with a tint brush */
336 {
337  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Tint)", 0, 0);
339 }
340 
341 /* Stroke Painting Keymap - Only when paintmode is enabled */
343 {
344  /* set poll callback - so that this keymap only gets enabled when stroke paintmode is enabled */
345  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint Mode", 0, 0);
347 }
348 
349 /* Stroke Sculpting Keymap - Only when sculptmode is enabled */
351 {
352  /* set poll callback - so that this keymap only gets enabled when stroke sculptmode is enabled */
353  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt Mode", 0, 0);
355 }
356 
357 /* Stroke Weight Paint Keymap - Only when weight is enabled */
359 {
360  /* set poll callback - so that this keymap only gets enabled when stroke sculptmode is enabled */
361  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Weight Mode", 0, 0);
363 }
364 
366 {
367  /* set poll callback - so that this keymap only gets enabled when stroke vertex is enabled */
368  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex Mode", 0, 0);
370 }
371 
372 /* keys for vertex with a draw brush */
374 {
375  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Draw)", 0, 0);
377 }
378 
379 /* keys for vertex with a blur brush */
381 {
382  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Blur)", 0, 0);
384 }
385 /* keys for vertex with a average brush */
387 {
388  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Average)", 0, 0);
390 }
391 /* keys for vertex with a smear brush */
393 {
394  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Smear)", 0, 0);
396 }
397 /* keys for vertex with a replace brush */
399 {
400  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Vertex (Replace)", 0, 0);
402 }
403 /* keys for sculpt with a smooth brush */
405 {
406  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Smooth)", 0, 0);
408 }
409 /* keys for sculpt with a thickness brush */
411 {
412  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Thickness)", 0, 0);
414 }
415 /* keys for sculpt with a strength brush */
417 {
418  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Strength)", 0, 0);
420 }
421 /* keys for sculpt with a grab brush */
423 {
424  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Grab)", 0, 0);
426 }
427 /* keys for sculpt with a push brush */
429 {
430  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Push)", 0, 0);
432 }
433 /* keys for sculpt with a twist brush */
435 {
436  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Twist)", 0, 0);
438 }
439 /* keys for sculpt with a pinch brush */
441 {
442  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Pinch)", 0, 0);
444 }
445 /* keys for sculpt with a randomize brush */
447 {
448  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Randomize)", 0, 0);
450 }
451 /* keys for sculpt with a clone brush */
453 {
454  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Sculpt (Clone)", 0, 0);
456 }
457 /* keys for weight with a draw brush */
459 {
460  wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Weight (Draw)", 0, 0);
462 }
463 
464 /* ==================== */
465 
467 {
468  ed_keymap_gpencil_general(keyconf);
470  ed_keymap_gpencil_editing(keyconf);
494 }
495 
496 /* ****************************************** */
497 
499 {
500  /* Annotations -------------------- */
501 
503 
504  /* Drawing ----------------------- */
505 
514 
515  /* Guides ----------------------- */
516 
518 
519  /* Editing (Strokes) ------------ */
520 
528 
534 
544 
551 
555 
557 
561 
564 
567 
568  /* Edit stroke editcurve */
569 
572 
573  /* Editing (Buttons) ------------ */
574 
577 
586 
590 
597 
599 
607 
611 
613 #ifdef WITH_POTRACE
615 #endif
638 
642 
645 
648 
649  /* vertex groups */
658 
659  /* color handle */
668 
669  /* Editing (Time) --------------- */
670 
671  /* Interpolation */
675 
676  /* Primitives */
682 
683  /* convert old 2.7 files to 2.8 */
685 
686  /* armatures */
688 }
689 
691 {
693  wmOperatorTypeMacro *otmacro;
694 
695  /* Duplicate + Move = Interactively place newly duplicated strokes */
697  "GPENCIL_OT_duplicate_move",
698  "Duplicate Strokes",
699  "Make copies of the selected Grease Pencil strokes and move them",
701  WM_operatortype_macro_define(ot, "GPENCIL_OT_duplicate");
702  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
703  RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true);
704  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
705  RNA_boolean_set(otmacro->ptr, "mirror", false);
706 
707  /* Extrude + Move = Interactively add new points */
708  ot = WM_operatortype_append_macro("GPENCIL_OT_extrude_move",
709  "Extrude Stroke Points",
710  "Extrude selected points and move them",
712  WM_operatortype_macro_define(ot, "GPENCIL_OT_extrude");
713  otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
714  RNA_boolean_set(otmacro->ptr, "gpencil_strokes", true);
715  RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
716  RNA_boolean_set(otmacro->ptr, "mirror", false);
717 }
718 
719 /* ****************************************** */
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct bGPdata * CTX_data_gpencil_data(const bContext *C)
Definition: context.c:1445
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
Definition: context.c:1282
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:607
@ GPAINT_TOOL_ERASE
@ GPAINT_TOOL_FILL
@ GPAINT_TOOL_DRAW
@ GPAINT_TOOL_TINT
@ GPWEIGHT_TOOL_DRAW
@ GPVERTEX_TOOL_AVERAGE
@ GPVERTEX_TOOL_REPLACE
@ GPVERTEX_TOOL_DRAW
@ GPVERTEX_TOOL_BLUR
@ GPVERTEX_TOOL_SMEAR
@ GPSCULPT_TOOL_GRAB
@ GPSCULPT_TOOL_TWIST
@ GPSCULPT_TOOL_PUSH
@ GPSCULPT_TOOL_STRENGTH
@ GPSCULPT_TOOL_PINCH
@ GPSCULPT_TOOL_SMOOTH
@ GPSCULPT_TOOL_CLONE
@ GPSCULPT_TOOL_THICKNESS
@ GPSCULPT_TOOL_RANDOMIZE
#define GPENCIL_EDIT_MODE(gpd)
#define GPENCIL_WEIGHT_MODE(gpd)
#define GPENCIL_SCULPT_MODE(gpd)
@ GP_DATA_STROKE_WEIGHTMODE
@ GP_DATA_STROKE_VERTEXMODE
@ GP_DATA_STROKE_PAINTMODE
@ GP_DATA_STROKE_SCULPTMODE
@ GP_DATA_STROKE_EDITMODE
#define GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)
Object is a sort of wrapper for general info.
@ OB_GPENCIL
@ SPACE_VIEW3D
#define C
Definition: RandGen.cpp:25
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
void GPENCIL_OT_annotate(wmOperatorType *ot)
void GPENCIL_OT_generate_weights(wmOperatorType *ot)
void GPENCIL_OT_bake_grease_pencil_animation(wmOperatorType *ot)
void GPENCIL_OT_image_to_grease_pencil(wmOperatorType *ot)
void GPENCIL_OT_convert(wmOperatorType *ot)
void GPENCIL_OT_layer_change(wmOperatorType *ot)
void GPENCIL_OT_stroke_arrange(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_smooth(wmOperatorType *ot)
void GPENCIL_OT_layer_remove(wmOperatorType *ot)
Definition: gpencil_data.c:333
void GPENCIL_OT_vertex_group_invert(wmOperatorType *ot)
void GPENCIL_OT_layer_annotation_move(wmOperatorType *ot)
Definition: gpencil_data.c:425
void GPENCIL_OT_material_reveal(wmOperatorType *ot)
void GPENCIL_OT_layer_annotation_remove(wmOperatorType *ot)
Definition: gpencil_data.c:355
void GPENCIL_OT_frame_duplicate(wmOperatorType *ot)
Definition: gpencil_data.c:677
void GPENCIL_OT_layer_isolate(wmOperatorType *ot)
void GPENCIL_OT_lock_all(wmOperatorType *ot)
void GPENCIL_OT_layer_mask_remove(wmOperatorType *ot)
void GPENCIL_OT_stroke_change_color(wmOperatorType *ot)
void GPENCIL_OT_material_set(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_normalize_all(wmOperatorType *ot)
void GPENCIL_OT_material_lock_unused(wmOperatorType *ot)
void GPENCIL_OT_material_select(wmOperatorType *ot)
void GPENCIL_OT_frame_clean_fill(wmOperatorType *ot)
Definition: gpencil_data.c:762
void GPENCIL_OT_brush_reset_all(wmOperatorType *ot)
void GPENCIL_OT_annotation_add(wmOperatorType *ot)
Definition: gpencil_data.c:124
void GPENCIL_OT_vertex_group_normalize(wmOperatorType *ot)
void GPENCIL_OT_layer_add(wmOperatorType *ot)
Definition: gpencil_data.c:245
void GPENCIL_OT_layer_mask_move(wmOperatorType *ot)
void GPENCIL_OT_materials_copy_to_object(wmOperatorType *ot)
void GPENCIL_OT_layer_mask_add(wmOperatorType *ot)
void GPENCIL_OT_reveal(wmOperatorType *ot)
void GPENCIL_OT_layer_duplicate(wmOperatorType *ot)
Definition: gpencil_data.c:492
void GPENCIL_OT_vertex_group_assign(wmOperatorType *ot)
void GPENCIL_OT_layer_merge(wmOperatorType *ot)
void GPENCIL_OT_unlock_all(wmOperatorType *ot)
void GPENCIL_OT_material_lock_all(wmOperatorType *ot)
void GPENCIL_OT_data_unlink(wmOperatorType *ot)
Definition: gpencil_data.c:176
void GPENCIL_OT_brush_reset(wmOperatorType *ot)
void GPENCIL_OT_set_active_material(wmOperatorType *ot)
void GPENCIL_OT_frame_clean_loose(wmOperatorType *ot)
Definition: gpencil_data.c:844
void GPENCIL_OT_hide(wmOperatorType *ot)
void GPENCIL_OT_material_isolate(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_select(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_deselect(wmOperatorType *ot)
void GPENCIL_OT_material_hide(wmOperatorType *ot)
void GPENCIL_OT_layer_duplicate_object(wmOperatorType *ot)
Definition: gpencil_data.c:609
void GPENCIL_OT_layer_annotation_add(wmOperatorType *ot)
Definition: gpencil_data.c:264
void GPENCIL_OT_layer_move(wmOperatorType *ot)
Definition: gpencil_data.c:402
void GPENCIL_OT_material_unlock_all(wmOperatorType *ot)
void GPENCIL_OT_lock_layer(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_remove_from(wmOperatorType *ot)
void GPENCIL_OT_frame_clean_duplicate(wmOperatorType *ot)
Definition: gpencil_data.c:994
void GPENCIL_OT_layer_active(wmOperatorType *ot)
void GPENCIL_OT_recalc_geometry(wmOperatorType *ot)
void GPENCIL_OT_snap_to_cursor(wmOperatorType *ot)
void GPENCIL_OT_stroke_cyclical_set(wmOperatorType *ot)
void GPENCIL_OT_move_to_layer(wmOperatorType *ot)
void GPENCIL_OT_paintmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:428
void GPENCIL_OT_stroke_simplify_fixed(wmOperatorType *ot)
void GPENCIL_OT_copy(wmOperatorType *ot)
void GPENCIL_OT_snap_to_grid(wmOperatorType *ot)
void GPENCIL_OT_active_frame_delete(wmOperatorType *ot)
void GPENCIL_OT_stroke_flip(wmOperatorType *ot)
void GPENCIL_OT_dissolve(wmOperatorType *ot)
void GPENCIL_OT_stroke_simplify(wmOperatorType *ot)
void GPENCIL_OT_snap_cursor_to_selected(wmOperatorType *ot)
void GPENCIL_OT_weightmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:649
void GPENCIL_OT_stroke_split(wmOperatorType *ot)
void GPENCIL_OT_blank_frame_add(wmOperatorType *ot)
void GPENCIL_OT_annotation_active_frame_delete(wmOperatorType *ot)
void GPENCIL_OT_stroke_trim(wmOperatorType *ot)
void GPENCIL_OT_editmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:231
void GPENCIL_OT_active_frames_delete_all(wmOperatorType *ot)
void GPENCIL_OT_delete(wmOperatorType *ot)
void GPENCIL_OT_stroke_merge_by_distance(wmOperatorType *ot)
void GPENCIL_OT_vertexmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:760
void GPENCIL_OT_stroke_apply_thickness(wmOperatorType *ot)
void GPENCIL_OT_paste(wmOperatorType *ot)
void GPENCIL_OT_stroke_caps_set(wmOperatorType *ot)
void GPENCIL_OT_stroke_normalize(wmOperatorType *ot)
void GPENCIL_OT_stroke_separate(wmOperatorType *ot)
void GPENCIL_OT_selection_opacity_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:810
void GPENCIL_OT_stroke_cutter(wmOperatorType *ot)
void GPENCIL_OT_duplicate(wmOperatorType *ot)
void GPENCIL_OT_stroke_sample(wmOperatorType *ot)
void GPENCIL_OT_stroke_smooth(wmOperatorType *ot)
void GPENCIL_OT_selectmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:313
void GPENCIL_OT_extrude(wmOperatorType *ot)
void GPENCIL_OT_reproject(wmOperatorType *ot)
void GPENCIL_OT_sculptmode_toggle(wmOperatorType *ot)
Definition: gpencil_edit.c:541
void GPENCIL_OT_stroke_join(wmOperatorType *ot)
void GPENCIL_OT_stroke_subdivide(wmOperatorType *ot)
void GPENCIL_OT_stroke_enter_editcurve_mode(wmOperatorType *ot)
void GPENCIL_OT_stroke_editcurve_set_handle_type(wmOperatorType *ot)
void GPENCIL_OT_fill(wmOperatorType *ot)
void GPENCIL_OT_select_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_interpolate(struct wmOperatorType *ot)
void GPENCIL_OT_select_lasso(struct wmOperatorType *ot)
void GPENCIL_OT_weight_paint(struct wmOperatorType *ot)
void GPENCIL_OT_select_more(struct wmOperatorType *ot)
void GPENCIL_OT_select_random(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_merge(struct wmOperatorType *ot)
void GPENCIL_OT_sculpt_paint(struct wmOperatorType *ot)
void GPENCIL_OT_material_to_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_reset_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_reset_transform_fill(struct wmOperatorType *ot)
Definition: gpencil_uv.c:516
void GPENCIL_OT_primitive_curve(struct wmOperatorType *ot)
void GPENCIL_OT_transform_fill(struct wmOperatorType *ot)
Definition: gpencil_uv.c:427
void GPENCIL_OT_select_first(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_circle(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_box(struct wmOperatorType *ot)
void GPENCIL_OT_select(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_hsv(struct wmOperatorType *ot)
void GPENCIL_OT_select_linked(struct wmOperatorType *ot)
void GPENCIL_OT_select_grouped(struct wmOperatorType *ot)
void GPENCIL_OT_trace_image(struct wmOperatorType *ot)
void GPENCIL_OT_draw(struct wmOperatorType *ot)
void GPENCIL_OT_guide_rotate(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_polyline(struct wmOperatorType *ot)
void GPENCIL_OT_select_box(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_levels(struct wmOperatorType *ot)
void GPENCIL_OT_interpolate_sequence(struct wmOperatorType *ot)
void GPENCIL_OT_bake_mesh_animation(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_set(struct wmOperatorType *ot)
void GPENCIL_OT_interpolate_reverse(struct wmOperatorType *ot)
void GPENCIL_OT_extract_palette_vertex(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_brightness_contrast(struct wmOperatorType *ot)
void GPENCIL_OT_convert_old_files(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_merge_material(struct wmOperatorType *ot)
void GPENCIL_OT_select_circle(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_paint(struct wmOperatorType *ot)
void GPENCIL_OT_select_alternate(struct wmOperatorType *ot)
void GPENCIL_OT_select_last(struct wmOperatorType *ot)
void GPENCIL_OT_select_less(struct wmOperatorType *ot)
void GPENCIL_OT_select_all(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_line(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_invert(struct wmOperatorType *ot)
static void ed_keymap_gpencil_vertexpainting_average(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:386
static bool gpencil_stroke_paintmode_tint_poll(bContext *C)
Definition: gpencil_ops.c:157
static void ed_keymap_gpencil_sculptpainting_grab(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:422
static bool gpencil_stroke_vertexmode_blur_poll(bContext *C)
Definition: gpencil_ops.c:214
void ED_operatormacros_gpencil(void)
Definition: gpencil_ops.c:690
static void ed_keymap_gpencil_sculptpainting_thickness(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:410
static bool gpencil_stroke_vertexmode_smear_poll(bContext *C)
Definition: gpencil_ops.c:226
static bool gpencil_stroke_sculptmode_thickness_poll(bContext *C)
Definition: gpencil_ops.c:243
static bool gpencil_stroke_sculptmode_push_poll(bContext *C)
Definition: gpencil_ops.c:261
static void ed_keymap_gpencil_sculptpainting_push(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:428
static void ed_keymap_gpencil_painting_draw(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:314
static void ed_keymap_gpencil_sculptpainting_twist(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:434
static bool gpencil_stroke_editmode_curve_poll(bContext *C)
Definition: gpencil_ops.c:52
static bool gpencil_stroke_paintmode_draw_poll(bContext *C)
Definition: gpencil_ops.c:139
static bool gpencil_stroke_weightmode_poll(bContext *C)
Definition: gpencil_ops.c:182
static bool gpencil_stroke_paintmode_poll_with_tool(bContext *C, const char gpencil_tool)
Definition: gpencil_ops.c:66
static bool gpencil_stroke_sculptmode_grab_poll(bContext *C)
Definition: gpencil_ops.c:255
static bool gpencil_stroke_vertexmode_average_poll(bContext *C)
Definition: gpencil_ops.c:220
static bool gpencil_stroke_paintmode_fill_poll(bContext *C)
Definition: gpencil_ops.c:151
static void ed_keymap_gpencil_painting_tint(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:335
static void ed_keymap_gpencil_sculptpainting_strength(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:416
static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:296
static void ed_keymap_gpencil_painting_erase(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:321
static void ed_keymap_gpencil_vertexpainting_smear(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:392
static bool gpencil_stroke_paintmode_poll(bContext *C)
Definition: gpencil_ops.c:59
static bool gpencil_stroke_weightmode_poll_with_tool(bContext *C, const char gpencil_weight_tool)
Definition: gpencil_ops.c:120
static bool gpencil_stroke_vertexmode_poll_with_tool(bContext *C, const char gpencil_vertex_tool)
Definition: gpencil_ops.c:84
static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:37
static bool gpencil_stroke_vertexmode_poll(bContext *C)
Definition: gpencil_ops.c:195
static bool gpencil_stroke_vertexmode_draw_poll(bContext *C)
Definition: gpencil_ops.c:208
static bool gpencil_stroke_editmode_poll(bContext *C)
Definition: gpencil_ops.c:45
static void ed_keymap_gpencil_vertexpainting(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:365
static void ed_keymap_gpencil_sculptpainting_pinch(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:440
static void ed_keymap_gpencil_painting_fill(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:328
void ED_operatortypes_gpencil(void)
Definition: gpencil_ops.c:498
static bool gpencil_stroke_sculptmode_smooth_poll(bContext *C)
Definition: gpencil_ops.c:238
static bool gpencil_stroke_sculptmode_twist_poll(bContext *C)
Definition: gpencil_ops.c:267
static bool gpencil_stroke_sculptmode_strength_poll(bContext *C)
Definition: gpencil_ops.c:249
static bool gpencil_stroke_sculptmode_poll(bContext *C)
Definition: gpencil_ops.c:163
static bool gpencil_stroke_vertexmode_replace_poll(bContext *C)
Definition: gpencil_ops.c:232
void ED_keymap_gpencil(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:466
static bool gpencil_stroke_paintmode_erase_poll(bContext *C)
Definition: gpencil_ops.c:145
static bool gpencil_stroke_sculptmode_pinch_poll(bContext *C)
Definition: gpencil_ops.c:273
static bool gpencil_stroke_sculptmode_randomize_poll(bContext *C)
Definition: gpencil_ops.c:278
static void ed_keymap_gpencil_sculpting(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:350
static void ed_keymap_gpencil_vertexpainting_blur(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:380
static bool gpencil_stroke_weightmode_draw_poll(bContext *C)
Definition: gpencil_ops.c:290
static void ed_keymap_gpencil_sculptpainting_smooth(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:404
static void ed_keymap_gpencil_curve_editing(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:305
static void ed_keymap_gpencil_sculptpainting_clone(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:452
static void ed_keymap_gpencil_painting(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:342
static void ed_keymap_gpencil_weightpainting_draw(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:458
static void ed_keymap_gpencil_vertexpainting_replace(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:398
static void ed_keymap_gpencil_weightpainting(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:358
static bool gpencil_stroke_sculptmode_clone_poll(bContext *C)
Definition: gpencil_ops.c:284
static bool gpencil_stroke_sculptmode_poll_with_tool(bContext *C, const char gpencil_sculpt_tool)
Definition: gpencil_ops.c:102
static void ed_keymap_gpencil_vertexpainting_draw(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:373
static void ed_keymap_gpencil_sculptpainting_randomize(wmKeyConfig *keyconf)
Definition: gpencil_ops.c:446
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
char gpencil_weight_tool
char gpencil_vertex_tool
struct BrushGpencilSettings * gpencil_settings
char gpencil_sculpt_tool
char gpencil_tool
GpWeightPaint * gp_weightpaint
GpPaint * gp_paint
GpSculptPaint * gp_sculptpaint
GpVertexPaint * gp_vertexpaint
bool(* poll)(struct bContext *)
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 *))
bool WM_toolsystem_active_tool_is_brush(const bContext *C)