Blender  V3.3
Classes
gpencil_edit.c File Reference
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_lasso_2d.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_curve.h"
#include "BKE_gpencil_geom.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_workspace.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "UI_view2d.h"
#include "ED_armature.h"
#include "ED_gpencil.h"
#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_space_api.h"
#include "ED_transform_snap_object_context.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Classes

struct  tJoinStrokes
 
struct  GP_SelectLassoUserData
 

Functions

Stroke Edit Mode Management
static bool gpencil_stroke_edit_poll (bContext *C)
 
static bool gpencil_strokes_edit3d_poll (bContext *C)
 
static bool gpencil_editmode_toggle_poll (bContext *C)
 
static bool gpencil_stroke_not_in_curve_edit_mode (bContext *C)
 
Toggle Edit Mode Operator
static int gpencil_editmode_toggle_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_editmode_toggle (wmOperatorType *ot)
 
Toggle Select Mode Operator
static bool gpencil_selectmode_toggle_poll (bContext *C)
 
static int gpencil_selectmode_toggle_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_selectmode_toggle (wmOperatorType *ot)
 
Toggle Stroke Paint Mode Operator
static bool gpencil_paintmode_toggle_poll (bContext *C)
 
static int gpencil_paintmode_toggle_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_paintmode_toggle (wmOperatorType *ot)
 
Toggle Stroke Sculpt Mode Operator
static bool gpencil_sculptmode_toggle_poll (bContext *C)
 
static int gpencil_sculptmode_toggle_exec (bContext *C, wmOperator *op)
 
Toggle Weight Paint Mode Operator
void GPENCIL_OT_sculptmode_toggle (wmOperatorType *ot)
 
static bool gpencil_weightmode_toggle_poll (bContext *C)
 
static int gpencil_weightmode_toggle_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_weightmode_toggle (wmOperatorType *ot)
 
Toggle Vertex Paint Mode Operator
static bool gpencil_vertexmode_toggle_poll (bContext *C)
 
static int gpencil_vertexmode_toggle_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_vertexmode_toggle (wmOperatorType *ot)
 
Stroke Hide Selection Toggle Operator
static int gpencil_hideselect_toggle_exec (bContext *C, wmOperator *UNUSED(op))
 
void GPENCIL_OT_selection_opacity_toggle (wmOperatorType *ot)
 
Duplicate Selected Strokes Operator
static void gpencil_duplicate_points (bGPdata *gpd, const bGPDstroke *gps, ListBase *new_strokes, const char *layername)
 
static int gpencil_duplicate_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_duplicate (wmOperatorType *ot)
 
Extrude Selected Strokes Operator
static void gpencil_copy_move_point (bGPDstroke *gps, bGPDspoint *temp_points, MDeformVert *temp_dverts, int from_idx, int to_idx, const bool copy)
 
static void gpencil_add_move_points (bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps)
 
static void gpencil_curve_extrude_points (bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, bGPDcurve *gpc)
 
static int gpencil_extrude_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_extrude (wmOperatorType *ot)
 
Copy Selected Strokes Operator
static int gpencil_strokes_copy_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_copy (wmOperatorType *ot)
 
Move To Layer Operator
static int gpencil_move_to_layer_exec (bContext *C, wmOperator *op)
 
static void layer_new_name_get (bGPdata *gpd, char *rname)
 
static int gpencil_move_to_layer_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void GPENCIL_OT_move_to_layer (wmOperatorType *ot)
 
Add Blank Frame Operator
static int gpencil_blank_frame_add_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_blank_frame_add (wmOperatorType *ot)
 
Delete Active Frame Operator
static bool gpencil_actframe_delete_poll (bContext *C)
 
static bool annotation_actframe_delete_poll (bContext *C)
 
static int gpencil_actframe_delete_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_active_frame_delete (wmOperatorType *ot)
 
void GPENCIL_OT_annotation_active_frame_delete (wmOperatorType *ot)
 
Delete All Active Frames
static bool gpencil_actframe_delete_all_poll (bContext *C)
 
static int gpencil_actframe_delete_all_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_active_frames_delete_all (wmOperatorType *ot)
 
Delete Operator
static int gpencil_delete_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_delete (wmOperatorType *ot)
 
Dissolve Operator
static int gpencil_dissolve_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_dissolve (wmOperatorType *ot)
 
Snapping Selection to Grid Operator
static bool gpencil_snap_poll (bContext *C)
 
static int gpencil_snap_to_grid (bContext *C, wmOperator *UNUSED(op))
 
void GPENCIL_OT_snap_to_grid (wmOperatorType *ot)
 
Snapping Selection to Cursor Operator
static int gpencil_snap_to_cursor (bContext *C, wmOperator *op)
 
void GPENCIL_OT_snap_to_cursor (wmOperatorType *ot)
 
Snapping Cursor to Selection Operator
static bool gpencil_stroke_points_centroid (Depsgraph *depsgraph, bContext *C, Object *obact, bGPdata *gpd, float r_centroid[3], float r_min[3], float r_max[3], size_t *count)
 
static int gpencil_snap_cursor_to_sel (bContext *C, wmOperator *op)
 
void GPENCIL_OT_snap_cursor_to_selected (wmOperatorType *ot)
 
Apply Layer Thickness Change to Strokes Operator
static int gpencil_stroke_apply_thickness_exec (bContext *C, wmOperator *UNUSED(op))
 
void GPENCIL_OT_stroke_apply_thickness (wmOperatorType *ot)
 
Stroke Flip Operator
static int gpencil_stroke_flip_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_flip (wmOperatorType *ot)
 
Stroke Re-project Operator
static int gpencil_strokes_reproject_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_reproject (wmOperatorType *ot)
 
static int gpencil_recalc_geometry_exec (bContext *C, wmOperator *UNUSED(op))
 
void GPENCIL_OT_recalc_geometry (wmOperatorType *ot)
 
Stroke Subdivide Operator
static void gpencil_smooth_stroke (bContext *C, wmOperator *op)
 
static int gpencil_count_subdivision_cuts (bGPDstroke *gps)
 
static void gpencil_stroke_subdivide (bGPDstroke *gps, const int cuts)
 
static int gpencil_stroke_subdivide_exec (bContext *C, wmOperator *op)
 
static bool gpencil_subdivide_curve_edit_poll_property (const bContext *C, wmOperator *UNUSED(op), const PropertyRNA *prop)
 
void GPENCIL_OT_stroke_subdivide (wmOperatorType *ot)
 
static int gpencil_stroke_simplify_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_simplify (wmOperatorType *ot)
 
static int gpencil_stroke_simplify_fixed_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_simplify_fixed (wmOperatorType *ot)
 
static int gpencil_stroke_sample_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_sample (wmOperatorType *ot)
 
Stroke Trim Operator
static int gpencil_stroke_trim_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_trim (wmOperatorType *ot)
 
Stroke Split Operator
static int gpencil_stroke_split_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_split (wmOperatorType *ot)
 
Stroke Smooth Operator
static int gpencil_stroke_smooth_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_smooth (wmOperatorType *ot)
 
Merge By Distance Operator
static bool gpencil_merge_by_distance_poll (bContext *C)
 
static int gpencil_merge_by_distance_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_merge_by_distance (wmOperatorType *ot)
 

Paste Selected Strokes Operator

enum  eGP_PasteMode { GP_COPY_BY_LAYER = -1 , GP_COPY_TO_ACTIVE = 1 }
 
typedef enum eGP_PasteMode eGP_PasteMode
 
static bool gpencil_strokes_paste_poll (bContext *C)
 
static int gpencil_strokes_paste_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_paste (wmOperatorType *ot)
 

Delete/Dissolve Utilities

enum  eGP_DeleteMode { GP_DELETEOP_POINTS = 0 , GP_DELETEOP_STROKES = 1 , GP_DELETEOP_FRAME = 2 }
 
enum  eGP_DissolveMode { GP_DISSOLVE_POINTS = 0 , GP_DISSOLVE_BETWEEN = 1 , GP_DISSOLVE_UNSELECT = 2 }
 
typedef enum eGP_DeleteMode eGP_DeleteMode
 
typedef enum eGP_DissolveMode eGP_DissolveMode
 
static int gpencil_delete_selected_strokes (bContext *C)
 
static bool gpencil_dissolve_selected_curve_points (bContext *C, bGPdata *gpd, eGP_DissolveMode mode)
 
static bool gpencil_dissolve_selected_stroke_points (bContext *C, bGPdata *gpd, eGP_DissolveMode mode)
 
static int gpencil_dissolve_selected_points (bContext *C, eGP_DissolveMode mode)
 
static int gpencil_delete_selected_points (bContext *C)
 
int gpencil_delete_selected_point_wrap (bContext *C)
 

Stroke Toggle Cyclic Operator

enum  { GP_STROKE_CYCLIC_CLOSE = 1 , GP_STROKE_CYCLIC_OPEN = 2 , GP_STROKE_CYCLIC_TOGGLE = 3 }
 
static int gpencil_stroke_cyclical_set_exec (bContext *C, wmOperator *op)
 
static bool gpencil_cyclical_set_curve_edit_poll_property (const bContext *C, wmOperator *UNUSED(op), const PropertyRNA *prop)
 
void GPENCIL_OT_stroke_cyclical_set (wmOperatorType *ot)
 

Stroke Toggle Flat Caps Operator

enum  { GP_STROKE_CAPS_TOGGLE_BOTH = 0 , GP_STROKE_CAPS_TOGGLE_START = 1 , GP_STROKE_CAPS_TOGGLE_END = 2 , GP_STROKE_CAPS_TOGGLE_DEFAULT = 3 }
 
static int gpencil_stroke_caps_set_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_caps_set (wmOperatorType *ot)
 

Stroke Separate Operator

enum  eGP_SeparateModes { GP_SEPARATE_POINT = 0 , GP_SEPARATE_STROKE , GP_SEPARATE_LAYER }
 
typedef enum eGP_SeparateModes eGP_SeparateModes
 
static int gpencil_stroke_separate_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_separate (wmOperatorType *ot)
 

Stroke Normalize Operator

enum  eGP_NormalizeMode { GP_NORMALIZE_THICKNESS = 0 , GP_NORMALIZE_OPACITY }
 
typedef enum eGP_NormalizeMode eGP_NormalizeMode
 
static bool gpencil_stroke_normalize_poll (bContext *C)
 
static void gpencil_stroke_normalize_ui (bContext *UNUSED(C), wmOperator *op)
 
static int gpencil_stroke_normalize_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_normalize (wmOperatorType *ot)
 

Stroke Join Operator

typedef struct tJoinStrokes tJoinStrokes
 
static int gpencil_get_nearest_stroke_index (tJoinStrokes *strokes_list, const bGPDstroke *gps, const int totstrokes)
 
static int gpencil_stroke_join_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_join (wmOperatorType *ot)
 

Stroke Cutter Operator

typedef bool(* GPencilTestFn) (bGPDstroke *gps, bGPDspoint *pt, const GP_SpaceConversion *gsc, const float diff_mat[4][4], void *user_data)
 
static bool gpencil_test_lasso (bGPDstroke *gps, bGPDspoint *pt, const GP_SpaceConversion *gsc, const float diff_mat[4][4], void *user_data)
 
static void gpencil_cutter_dissolve (bGPdata *gpd, bGPDlayer *hit_layer, bGPDstroke *hit_stroke, const bool flat_caps)
 
static int gpencil_cutter_lasso_select (bContext *C, wmOperator *op, GPencilTestFn is_inside_fn, void *user_data)
 
static bool gpencil_cutter_poll (bContext *C)
 
static int gpencil_cutter_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_cutter (wmOperatorType *ot)
 
bool ED_object_gpencil_exit (struct Main *bmain, Object *ob)
 

Copy/Paste Strokes Utilities

Grease Pencil stroke data copy/paste buffer:

  • The copy operation collects all segments of selected strokes, dumping "ready to be copied" copies of the strokes into the buffer.
  • The paste operation makes a copy of those elements, and adds them to the active layer. This effectively flattens down the strokes from several different layers into a single layer.
ListBase gpencil_strokes_copypastebuf = {NULL, NULL}
 
static GHashgpencil_strokes_copypastebuf_colors = NULL
 
static GHashgpencil_strokes_copypastebuf_colors_material_to_name_create (Main *bmain)
 
static void gpencil_strokes_copypastebuf_colors_material_to_name_free (GHash *ma_to_name)
 
static GHashgpencil_strokes_copypastebuf_colors_name_to_material_create (Main *bmain)
 
static void gpencil_strokes_copypastebuf_colors_name_to_material_free (GHash *name_to_ma)
 
void ED_gpencil_strokes_copybuf_free (void)
 
GHashgpencil_copybuf_validate_colormap (bContext *C)
 

Detailed Description

Operators for editing Grease Pencil strokes.

Definition in file gpencil_edit.c.

Typedef Documentation

◆ eGP_DeleteMode

◆ eGP_DissolveMode

◆ eGP_NormalizeMode

◆ eGP_PasteMode

◆ eGP_SeparateModes

◆ GPencilTestFn

typedef bool(* GPencilTestFn) (bGPDstroke *gps, bGPDspoint *pt, const GP_SpaceConversion *gsc, const float diff_mat[4][4], void *user_data)

Definition at line 5072 of file gpencil_edit.c.

◆ tJoinStrokes

typedef struct tJoinStrokes tJoinStrokes

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GP_STROKE_CYCLIC_CLOSE 
GP_STROKE_CYCLIC_OPEN 
GP_STROKE_CYCLIC_TOGGLE 

Definition at line 3242 of file gpencil_edit.c.

◆ anonymous enum

anonymous enum
Enumerator
GP_STROKE_CAPS_TOGGLE_BOTH 
GP_STROKE_CAPS_TOGGLE_START 
GP_STROKE_CAPS_TOGGLE_END 
GP_STROKE_CAPS_TOGGLE_DEFAULT 

Definition at line 3394 of file gpencil_edit.c.

◆ eGP_DeleteMode

Enumerator
GP_DELETEOP_POINTS 
GP_DELETEOP_STROKES 
GP_DELETEOP_FRAME 

Definition at line 2205 of file gpencil_edit.c.

◆ eGP_DissolveMode

Enumerator
GP_DISSOLVE_POINTS 
GP_DISSOLVE_BETWEEN 
GP_DISSOLVE_UNSELECT 

Definition at line 2214 of file gpencil_edit.c.

◆ eGP_NormalizeMode

Enumerator
GP_NORMALIZE_THICKNESS 
GP_NORMALIZE_OPACITY 

Definition at line 5456 of file gpencil_edit.c.

◆ eGP_PasteMode

Enumerator
GP_COPY_BY_LAYER 
GP_COPY_TO_ACTIVE 

Definition at line 1626 of file gpencil_edit.c.

◆ eGP_SeparateModes

Enumerator
GP_SEPARATE_POINT 
GP_SEPARATE_STROKE 
GP_SEPARATE_LAYER 

Definition at line 4582 of file gpencil_edit.c.

Function Documentation

◆ annotation_actframe_delete_poll()

static bool annotation_actframe_delete_poll ( bContext C)
static

◆ ED_gpencil_strokes_copybuf_free()

void ED_gpencil_strokes_copybuf_free ( void  )

◆ ED_object_gpencil_exit()

bool ED_object_gpencil_exit ( struct Main bmain,
Object ob 
)

◆ gpencil_actframe_delete_all_exec()

static int gpencil_actframe_delete_all_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_actframe_delete_all_poll()

static bool gpencil_actframe_delete_all_poll ( bContext C)
static

◆ gpencil_actframe_delete_exec()

static int gpencil_actframe_delete_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_actframe_delete_poll()

static bool gpencil_actframe_delete_poll ( bContext C)
static

◆ gpencil_add_move_points()

static void gpencil_add_move_points ( bGPdata gpd,
bGPDframe gpf,
bGPDstroke gps 
)
static

◆ gpencil_blank_frame_add_exec()

static int gpencil_blank_frame_add_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_copy_move_point()

static void gpencil_copy_move_point ( bGPDstroke gps,
bGPDspoint temp_points,
MDeformVert temp_dverts,
int  from_idx,
int  to_idx,
const bool  copy 
)
static

◆ gpencil_copybuf_validate_colormap()

GHash* gpencil_copybuf_validate_colormap ( struct bContext C)

◆ gpencil_count_subdivision_cuts()

static int gpencil_count_subdivision_cuts ( bGPDstroke gps)
static

◆ gpencil_curve_extrude_points()

static void gpencil_curve_extrude_points ( bGPdata gpd,
bGPDframe gpf,
bGPDstroke gps,
bGPDcurve gpc 
)
static

◆ gpencil_cutter_dissolve()

static void gpencil_cutter_dissolve ( bGPdata gpd,
bGPDlayer hit_layer,
bGPDstroke hit_stroke,
const bool  flat_caps 
)
static

◆ gpencil_cutter_exec()

static int gpencil_cutter_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_cutter_lasso_select()

static int gpencil_cutter_lasso_select ( bContext C,
wmOperator op,
GPencilTestFn  is_inside_fn,
void user_data 
)
static

◆ gpencil_cutter_poll()

static bool gpencil_cutter_poll ( bContext C)
static

◆ gpencil_cyclical_set_curve_edit_poll_property()

static bool gpencil_cyclical_set_curve_edit_poll_property ( const bContext C,
wmOperator UNUSEDop,
const PropertyRNA prop 
)
static

◆ gpencil_delete_exec()

static int gpencil_delete_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_delete_selected_point_wrap()

int gpencil_delete_selected_point_wrap ( bContext C)

Simple wrapper to external call.

Definition at line 2693 of file gpencil_edit.c.

References C, and gpencil_delete_selected_points().

Referenced by gpencil_generic_select_exec().

◆ gpencil_delete_selected_points()

static int gpencil_delete_selected_points ( bContext C)
static

◆ gpencil_delete_selected_strokes()

static int gpencil_delete_selected_strokes ( bContext C)
static

◆ gpencil_dissolve_exec()

static int gpencil_dissolve_exec ( bContext C,
wmOperator op 
)
static

Definition at line 2767 of file gpencil_edit.c.

References C, gpencil_dissolve_selected_points(), wmOperator::ptr, and RNA_enum_get().

Referenced by GPENCIL_OT_dissolve().

◆ gpencil_dissolve_selected_curve_points()

static bool gpencil_dissolve_selected_curve_points ( bContext C,
bGPdata gpd,
eGP_DissolveMode  mode 
)
static

◆ gpencil_dissolve_selected_points()

static int gpencil_dissolve_selected_points ( bContext C,
eGP_DissolveMode  mode 
)
static

◆ gpencil_dissolve_selected_stroke_points()

static bool gpencil_dissolve_selected_stroke_points ( bContext C,
bGPdata gpd,
eGP_DissolveMode  mode 
)
static

◆ gpencil_duplicate_exec()

static int gpencil_duplicate_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_duplicate_points()

static void gpencil_duplicate_points ( bGPdata gpd,
const bGPDstroke gps,
ListBase new_strokes,
const char *  layername 
)
static

◆ gpencil_editmode_toggle_exec()

static int gpencil_editmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_editmode_toggle_poll()

static bool gpencil_editmode_toggle_poll ( bContext C)
static

◆ gpencil_extrude_exec()

static int gpencil_extrude_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_get_nearest_stroke_index()

static int gpencil_get_nearest_stroke_index ( tJoinStrokes strokes_list,
const bGPDstroke gps,
const int  totstrokes 
)
static

◆ gpencil_hideselect_toggle_exec()

static int gpencil_hideselect_toggle_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ gpencil_merge_by_distance_exec()

static int gpencil_merge_by_distance_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_merge_by_distance_poll()

static bool gpencil_merge_by_distance_poll ( bContext C)
static

◆ gpencil_move_to_layer_exec()

static int gpencil_move_to_layer_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_move_to_layer_invoke()

static int gpencil_move_to_layer_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ GPENCIL_OT_active_frame_delete()

void GPENCIL_OT_active_frame_delete ( wmOperatorType ot)

◆ GPENCIL_OT_active_frames_delete_all()

void GPENCIL_OT_active_frames_delete_all ( wmOperatorType ot)

◆ GPENCIL_OT_annotation_active_frame_delete()

void GPENCIL_OT_annotation_active_frame_delete ( wmOperatorType ot)

◆ GPENCIL_OT_blank_frame_add()

void GPENCIL_OT_blank_frame_add ( wmOperatorType ot)

◆ GPENCIL_OT_copy()

void GPENCIL_OT_copy ( wmOperatorType ot)

◆ GPENCIL_OT_delete()

void GPENCIL_OT_delete ( wmOperatorType ot)

◆ GPENCIL_OT_dissolve()

void GPENCIL_OT_dissolve ( wmOperatorType ot)

◆ GPENCIL_OT_duplicate()

void GPENCIL_OT_duplicate ( wmOperatorType ot)

◆ GPENCIL_OT_editmode_toggle()

void GPENCIL_OT_editmode_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_extrude()

void GPENCIL_OT_extrude ( wmOperatorType ot)

◆ GPENCIL_OT_move_to_layer()

void GPENCIL_OT_move_to_layer ( wmOperatorType ot)

◆ GPENCIL_OT_paintmode_toggle()

void GPENCIL_OT_paintmode_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_paste()

void GPENCIL_OT_paste ( wmOperatorType ot)

◆ GPENCIL_OT_recalc_geometry()

void GPENCIL_OT_recalc_geometry ( wmOperatorType ot)

◆ GPENCIL_OT_reproject()

void GPENCIL_OT_reproject ( wmOperatorType ot)

◆ GPENCIL_OT_sculptmode_toggle()

void GPENCIL_OT_sculptmode_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_selection_opacity_toggle()

void GPENCIL_OT_selection_opacity_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_selectmode_toggle()

void GPENCIL_OT_selectmode_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_snap_cursor_to_selected()

void GPENCIL_OT_snap_cursor_to_selected ( wmOperatorType ot)

◆ GPENCIL_OT_snap_to_cursor()

void GPENCIL_OT_snap_to_cursor ( wmOperatorType ot)

◆ GPENCIL_OT_snap_to_grid()

void GPENCIL_OT_snap_to_grid ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_apply_thickness()

void GPENCIL_OT_stroke_apply_thickness ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_caps_set()

void GPENCIL_OT_stroke_caps_set ( struct wmOperatorType ot)

◆ GPENCIL_OT_stroke_cutter()

void GPENCIL_OT_stroke_cutter ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_cyclical_set()

void GPENCIL_OT_stroke_cyclical_set ( struct wmOperatorType ot)

◆ GPENCIL_OT_stroke_flip()

void GPENCIL_OT_stroke_flip ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_join()

void GPENCIL_OT_stroke_join ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_merge_by_distance()

void GPENCIL_OT_stroke_merge_by_distance ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_normalize()

void GPENCIL_OT_stroke_normalize ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_sample()

void GPENCIL_OT_stroke_sample ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_separate()

void GPENCIL_OT_stroke_separate ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_simplify()

void GPENCIL_OT_stroke_simplify ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_simplify_fixed()

void GPENCIL_OT_stroke_simplify_fixed ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_smooth()

void GPENCIL_OT_stroke_smooth ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_split()

void GPENCIL_OT_stroke_split ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_subdivide()

void GPENCIL_OT_stroke_subdivide ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_trim()

void GPENCIL_OT_stroke_trim ( wmOperatorType ot)

◆ GPENCIL_OT_vertexmode_toggle()

void GPENCIL_OT_vertexmode_toggle ( wmOperatorType ot)

◆ GPENCIL_OT_weightmode_toggle()

void GPENCIL_OT_weightmode_toggle ( wmOperatorType ot)

◆ gpencil_paintmode_toggle_exec()

static int gpencil_paintmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_paintmode_toggle_poll()

static bool gpencil_paintmode_toggle_poll ( bContext C)
static

◆ gpencil_recalc_geometry_exec()

static int gpencil_recalc_geometry_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ gpencil_sculptmode_toggle_exec()

static int gpencil_sculptmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_sculptmode_toggle_poll()

static bool gpencil_sculptmode_toggle_poll ( bContext C)
static

◆ gpencil_selectmode_toggle_exec()

static int gpencil_selectmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_selectmode_toggle_poll()

static bool gpencil_selectmode_toggle_poll ( bContext C)
static

◆ gpencil_smooth_stroke()

static void gpencil_smooth_stroke ( bContext C,
wmOperator op 
)
static

◆ gpencil_snap_cursor_to_sel()

static int gpencil_snap_cursor_to_sel ( bContext C,
wmOperator op 
)
static

◆ gpencil_snap_poll()

static bool gpencil_snap_poll ( bContext C)
static

◆ gpencil_snap_to_cursor()

static int gpencil_snap_to_cursor ( bContext C,
wmOperator op 
)
static

◆ gpencil_snap_to_grid()

static int gpencil_snap_to_grid ( bContext C,
wmOperator UNUSEDop 
)
static

◆ gpencil_stroke_apply_thickness_exec()

static int gpencil_stroke_apply_thickness_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ gpencil_stroke_caps_set_exec()

static int gpencil_stroke_caps_set_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_cyclical_set_exec()

static int gpencil_stroke_cyclical_set_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_edit_poll()

static bool gpencil_stroke_edit_poll ( bContext C)
static

◆ gpencil_stroke_flip_exec()

static int gpencil_stroke_flip_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_join_exec()

static int gpencil_stroke_join_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_normalize_exec()

static int gpencil_stroke_normalize_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_normalize_poll()

static bool gpencil_stroke_normalize_poll ( bContext C)
static

◆ gpencil_stroke_normalize_ui()

static void gpencil_stroke_normalize_ui ( bContext UNUSEDC,
wmOperator op 
)
static

◆ gpencil_stroke_not_in_curve_edit_mode()

static bool gpencil_stroke_not_in_curve_edit_mode ( bContext C)
static

◆ gpencil_stroke_points_centroid()

static bool gpencil_stroke_points_centroid ( Depsgraph depsgraph,
bContext C,
Object obact,
bGPdata gpd,
float  r_centroid[3],
float  r_min[3],
float  r_max[3],
size_t *  count 
)
static

◆ gpencil_stroke_sample_exec()

static int gpencil_stroke_sample_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_separate_exec()

static int gpencil_stroke_separate_exec ( bContext C,
wmOperator op 
)
static

Definition at line 4591 of file gpencil_edit.c.

References Object::actcol, BKE_defgroup_copy_list(), BKE_gpencil_data_addnew(), BKE_gpencil_layer_active_get(), BKE_gpencil_layer_active_set(), BKE_gpencil_layer_addnew(), BKE_gpencil_layer_copy_settings(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_mask_cleanup_all_layers(), BKE_gpencil_layer_mask_copy(), BKE_gpencil_material(), BKE_gpencil_object_material_ensure(), BKE_gpencil_stroke_delete_tagged_points(), BKE_gpencil_stroke_duplicate(), BKE_gpencil_stroke_select_index_reset(), BKE_object_material_slot_remove(), BKE_object_material_slot_used(), BKE_report(), BLI_addtail(), BLI_listbase_is_single(), BLI_remlink(), bool, C, CTX_data_active_base(), CTX_data_active_gpencil_layer(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), ED_gpencil_data_get_active(), ED_gpencil_layer_has_selected_stroke(), ED_gpencil_stroke_can_use(), ED_gpencil_stroke_material_editable(), ED_object_add_duplicate(), ED_outliner_select_sync_from_object_tag(), ELEM, ListBase::first, bGPDspoint::flag, bGPDlayer::frames, GP_FRAME_SELECT, GP_GETFRAME_ADD_NEW, GP_SEPARATE_LAYER, GP_SEPARATE_POINT, GP_SEPARATE_STROKE, GP_SPOINT_SELECT, GP_STROKE_SELECT, GPENCIL_CURVE_EDIT_SESSIONS_ON, GPENCIL_MULTIEDIT_SESSIONS_ON, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, id_us_min(), bGPdata::layers, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, bGPDstroke::mat_nr, Object::mode, NA_EDITED, NA_SELECTED, ID::name, NC_GPENCIL, NC_OBJECT, ND_DATA, ND_DRAW, bGPDframe::next, bGPDlayer::next, NULL, OB_MODE_OBJECT, Base::object, OPERATOR_CANCELLED, OPERATOR_FINISHED, bGPDstroke::points, bGPDlayer::prev, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RPT_ERROR, scene, bGPDframe::strokes, Object::totcol, USER_DUP_ACT, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, and WM_event_add_notifier().

Referenced by GPENCIL_OT_stroke_separate().

◆ gpencil_stroke_simplify_exec()

static int gpencil_stroke_simplify_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_simplify_fixed_exec()

static int gpencil_stroke_simplify_fixed_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_smooth_exec()

static int gpencil_stroke_smooth_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_split_exec()

static int gpencil_stroke_split_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_subdivide()

static void gpencil_stroke_subdivide ( bGPDstroke gps,
const int  cuts 
)
static

◆ gpencil_stroke_subdivide_exec()

static int gpencil_stroke_subdivide_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_trim_exec()

static int gpencil_stroke_trim_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_strokes_copy_exec()

static int gpencil_strokes_copy_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_strokes_copypastebuf_colors_material_to_name_create()

static GHash* gpencil_strokes_copypastebuf_colors_material_to_name_create ( Main bmain)
static

◆ gpencil_strokes_copypastebuf_colors_material_to_name_free()

static void gpencil_strokes_copypastebuf_colors_material_to_name_free ( GHash ma_to_name)
static

Definition at line 1394 of file gpencil_edit.c.

References BLI_ghash_free(), MEM_freeN, and NULL.

Referenced by gpencil_strokes_copy_exec().

◆ gpencil_strokes_copypastebuf_colors_name_to_material_create()

static GHash* gpencil_strokes_copypastebuf_colors_name_to_material_create ( Main bmain)
static

◆ gpencil_strokes_copypastebuf_colors_name_to_material_free()

static void gpencil_strokes_copypastebuf_colors_name_to_material_free ( GHash name_to_ma)
static

Definition at line 1411 of file gpencil_edit.c.

References BLI_ghash_free(), MEM_freeN, and NULL.

Referenced by gpencil_copybuf_validate_colormap().

◆ gpencil_strokes_edit3d_poll()

static bool gpencil_strokes_edit3d_poll ( bContext C)
static

◆ gpencil_strokes_paste_exec()

static int gpencil_strokes_paste_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_strokes_paste_poll()

static bool gpencil_strokes_paste_poll ( bContext C)
static

◆ gpencil_strokes_reproject_exec()

static int gpencil_strokes_reproject_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_subdivide_curve_edit_poll_property()

static bool gpencil_subdivide_curve_edit_poll_property ( const bContext C,
wmOperator UNUSEDop,
const PropertyRNA prop 
)
static

◆ gpencil_test_lasso()

static bool gpencil_test_lasso ( bGPDstroke gps,
bGPDspoint pt,
const GP_SpaceConversion gsc,
const float  diff_mat[4][4],
void user_data 
)
static

◆ gpencil_vertexmode_toggle_exec()

static int gpencil_vertexmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_vertexmode_toggle_poll()

static bool gpencil_vertexmode_toggle_poll ( bContext C)
static

◆ gpencil_weightmode_toggle_exec()

static int gpencil_weightmode_toggle_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_weightmode_toggle_poll()

static bool gpencil_weightmode_toggle_poll ( bContext C)
static

◆ layer_new_name_get()

static void layer_new_name_get ( bGPdata gpd,
char *  rname 
)
static

Variable Documentation

◆ gpencil_strokes_copypastebuf

ListBase gpencil_strokes_copypastebuf = {NULL, NULL}

list of bGPDstroke instances

Note
is exposed within the editors/gpencil module so that other tools can use it too.

Definition at line 1373 of file gpencil_edit.c.

Referenced by ED_gpencil_strokes_copybuf_free(), gpencil_brush_clone_add(), gpencil_brush_clone_init(), gpencil_sculpt_brush_init(), gpencil_strokes_copy_exec(), gpencil_strokes_paste_exec(), and gpencil_strokes_paste_poll().

◆ gpencil_strokes_copypastebuf_colors

GHash* gpencil_strokes_copypastebuf_colors = NULL
static