Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
ED_gpencil.h File Reference

Go to the source code of this file.

Classes

struct  tGPspoint
 

Macros

#define GPENCIL_MINIMUM_JOIN_DIST   20.0f
 
#define GP_PAR_ARMATURE_NAME   0
 
#define GP_PAR_ARMATURE_AUTO   1
 
#define GP_PRIM_DATABUF_SIZE   5
 

Typedefs

typedef enum eGP_ReprojectModes eGP_ReprojectModes
 
typedef enum eGP_TargetObjectMode eGP_TargetObjectMode
 
typedef struct tGPspoint tGPspoint
 

Enumerations

enum  eGP_ReprojectModes {
  GP_REPROJECT_FRONT = 0 , GP_REPROJECT_SIDE , GP_REPROJECT_TOP , GP_REPROJECT_VIEW ,
  GP_REPROJECT_SURFACE , GP_REPROJECT_CURSOR , GP_REPROJECT_KEEP
}
 
enum  eGP_TargetObjectMode { GP_TARGET_OB_NEW = 0 , GP_TARGET_OB_SELECTED = 1 }
 

Functions

struct bGPdata ** ED_gpencil_data_get_pointers (const struct bContext *C, struct PointerRNA *r_ptr)
 
struct bGPdataED_gpencil_data_get_active (const struct bContext *C)
 
struct bGPdataED_gpencil_data_get_active_evaluated (const struct bContext *C)
 
struct bGPdata ** ED_gpencil_data_get_pointers_direct (struct ScrArea *area, struct Object *ob, struct PointerRNA *r_ptr)
 
struct bGPdataED_gpencil_data_get_active_direct (struct ScrArea *area, struct Object *ob)
 
struct bGPdataED_annotation_data_get_active (const struct bContext *C)
 
struct bGPdata ** ED_annotation_data_get_pointers (const struct bContext *C, struct PointerRNA *r_ptr)
 
struct bGPdata ** ED_annotation_data_get_pointers_direct (struct ID *screen_id, struct ScrArea *area, struct Scene *scene, struct PointerRNA *r_ptr)
 
struct bGPdataED_annotation_data_get_active_direct (struct ID *screen_id, struct ScrArea *area, struct Scene *scene)
 
bool ED_gpencil_data_owner_is_annotation (struct PointerRNA *owner_ptr)
 
bool ED_gpencil_has_keyframe_v3d (struct Scene *scene, struct Object *ob, int cfra)
 
bool ED_gpencil_frame_has_selected_stroke (const struct bGPDframe *gpf)
 
bool ED_gpencil_layer_has_selected_stroke (const struct bGPDlayer *gpl, bool is_multiedit)
 
bool ED_gpencil_stroke_can_use_direct (const struct ScrArea *area, const struct bGPDstroke *gps)
 
bool ED_gpencil_stroke_can_use (const struct bContext *C, const struct bGPDstroke *gps)
 
bool ED_gpencil_stroke_material_editable (struct Object *ob, const struct bGPDlayer *gpl, const struct bGPDstroke *gps)
 
bool ED_gpencil_stroke_material_visible (struct Object *ob, const struct bGPDstroke *gps)
 
void ED_keymap_gpencil (struct wmKeyConfig *keyconf)
 
void ED_operatortypes_gpencil (void)
 
void ED_operatormacros_gpencil (void)
 
void ED_gpencil_strokes_copybuf_free (void)
 
void ED_annotation_draw_2dimage (const struct bContext *C)
 
void ED_annotation_draw_view2d (const struct bContext *C, bool onlyv2d)
 
void ED_annotation_draw_view3d (struct Scene *scene, struct Depsgraph *depsgraph, struct View3D *v3d, struct ARegion *region, bool only3d)
 
void ED_annotation_draw_ex (struct Scene *scene, struct bGPdata *gpd, int winx, int winy, int cfra, char spacetype)
 
bool ED_gpencil_layer_frames_looper (struct bGPDlayer *gpl, struct Scene *scene, bool(*gpf_cb)(struct bGPDframe *, struct Scene *))
 
void ED_gpencil_layer_make_cfra_list (struct bGPDlayer *gpl, ListBase *elems, bool onlysel)
 
bool ED_gpencil_layer_frame_select_check (const struct bGPDlayer *gpl)
 
void ED_gpencil_layer_frame_select_set (struct bGPDlayer *gpl, short mode)
 
void ED_gpencil_layer_frames_select_box (struct bGPDlayer *gpl, float min, float max, short select_mode)
 
void ED_gpencil_layer_frames_select_region (struct KeyframeEditData *ked, struct bGPDlayer *gpl, short tool, short select_mode)
 
void ED_gpencil_select_frames (struct bGPDlayer *gpl, short select_mode)
 
void ED_gpencil_select_frame (struct bGPDlayer *gpl, int selx, short select_mode)
 
void ED_gpencil_set_active_channel (struct bGPdata *gpd, struct bGPDlayer *gpl)
 
bool ED_gpencil_layer_frames_delete (struct bGPDlayer *gpl)
 
void ED_gpencil_layer_frames_duplicate (struct bGPDlayer *gpl)
 
void ED_gpencil_layer_merge (struct bGPdata *gpd, struct bGPDlayer *gpl_src, struct bGPDlayer *gpl_dst, bool reverse)
 
void ED_gpencil_layer_frames_keytype_set (struct bGPDlayer *gpl, short type)
 
void ED_gpencil_layer_snap_frames (struct bGPDlayer *gpl, struct Scene *scene, short mode)
 
void ED_gpencil_layer_mirror_frames (struct bGPDlayer *gpl, struct Scene *scene, short mode)
 
void ED_gpencil_anim_copybuf_free (void)
 
bool ED_gpencil_anim_copybuf_copy (struct bAnimContext *ac)
 
bool ED_gpencil_anim_copybuf_paste (struct bAnimContext *ac, short copy_mode)
 
int ED_gpencil_session_active (void)
 
int ED_undo_gpencil_step (struct bContext *C, int step)
 
bool ED_gpencil_add_armature (const struct bContext *C, struct ReportList *reports, struct Object *ob, struct Object *ob_arm)
 
bool ED_gpencil_add_armature_weights (const struct bContext *C, struct ReportList *reports, struct Object *ob, struct Object *ob_arm, int mode)
 
bool ED_gpencil_add_lattice_modifier (const struct bContext *C, struct ReportList *reports, struct Object *ob, struct Object *ob_latt)
 
void ED_gpencil_reset_layers_parent (struct Depsgraph *depsgraph, struct Object *obact, struct bGPdata *gpd)
 
void ED_gpencil_brush_draw_eraser (struct Brush *brush, int x, int y)
 
void ED_gpencil_stroke_init_data (struct bGPDstroke *gps, const float *array, int totpoints, const float mat[4][4])
 
void ED_gpencil_create_blank (struct bContext *C, struct Object *ob, float mat[4][4])
 
void ED_gpencil_create_monkey (struct bContext *C, struct Object *ob, float mat[4][4])
 
void ED_gpencil_create_stroke (struct bContext *C, struct Object *ob, float mat[4][4])
 
void ED_gpencil_create_lineart (struct bContext *C, struct Object *ob)
 
struct ObjectED_gpencil_add_object (struct bContext *C, const float loc[3], unsigned short local_view_bits)
 
void ED_gpencil_add_defaults (struct bContext *C, struct Object *ob)
 
void ED_gpencil_setup_modes (struct bContext *C, struct bGPdata *gpd, int newmode)
 
bool ED_object_gpencil_exit (struct Main *bmain, struct Object *ob)
 
void ED_gpencil_project_stroke_to_plane (const struct Scene *scene, const struct Object *ob, const struct RegionView3D *rv3d, struct bGPDlayer *gpl, struct bGPDstroke *gps, const float origin[3], int axis)
 
void ED_gpencil_project_point_to_plane (const struct Scene *scene, const struct Object *ob, struct bGPDlayer *gpl, const struct RegionView3D *rv3d, const float origin[3], int axis, struct bGPDspoint *pt)
 
void ED_gpencil_drawing_reference_get (const struct Scene *scene, const struct Object *ob, char align_flag, float r_vec[3])
 
void ED_gpencil_project_stroke_to_view (struct bContext *C, struct bGPDlayer *gpl, struct bGPDstroke *gps)
 
void ED_gpencil_stroke_reproject (struct Depsgraph *depsgraph, const struct GP_SpaceConversion *gsc, struct SnapObjectContext *sctx, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps, eGP_ReprojectModes mode, bool keep_original)
 
void ED_gpencil_toggle_brush_cursor (struct bContext *C, bool enable, void *customdata)
 
void ED_gpencil_vgroup_assign (struct bContext *C, struct Object *ob, float weight)
 
void ED_gpencil_vgroup_remove (struct bContext *C, struct Object *ob)
 
void ED_gpencil_vgroup_select (struct bContext *C, struct Object *ob)
 
void ED_gpencil_vgroup_deselect (struct bContext *C, struct Object *ob)
 
int ED_gpencil_join_objects_exec (struct bContext *C, struct wmOperator *op)
 
void ED_gpencil_tpoint_to_point (struct ARegion *region, float origin[3], const struct tGPspoint *tpt, struct bGPDspoint *pt)
 
void ED_gpencil_update_color_uv (struct Main *bmain, struct Material *mat)
 
int ED_gpencil_select_stroke_segment (struct bGPdata *gpd, struct bGPDlayer *gpl, struct bGPDstroke *gps, struct bGPDspoint *pt, bool select, bool insert, float scale, float r_hita[3], float r_hitb[3])
 
void ED_gpencil_select_toggle_all (struct bContext *C, int action)
 
void ED_gpencil_select_curve_toggle_all (struct bContext *C, int action)
 
struct tGPspointED_gpencil_sbuffer_ensure (struct tGPspoint *buffer_array, int *buffer_size, int *buffer_used, bool clear)
 
void ED_gpencil_sbuffer_update_eval (struct bGPdata *gpd, struct Object *ob_eval)
 
void ED_gpencil_tag_scene_gpencil (struct Scene *scene)
 
void ED_gpencil_fill_vertex_color_set (struct ToolSettings *ts, struct Brush *brush, struct bGPDstroke *gps)
 
void ED_gpencil_point_vertex_color_set (struct ToolSettings *ts, struct Brush *brush, struct bGPDspoint *pt, struct tGPspoint *tpt)
 
void ED_gpencil_sbuffer_vertex_color_set (struct Depsgraph *depsgraph, struct Object *ob, struct ToolSettings *ts, struct Brush *brush, struct Material *material, float random_color[3], float pen_pressure)
 
void ED_gpencil_init_random_settings (struct Brush *brush, const int mval[2], struct GpRandomSettings *random_settings)
 
bool ED_gpencil_stroke_check_collision (const struct GP_SpaceConversion *gsc, struct bGPDstroke *gps, const float mval[2], int radius, const float diff_mat[4][4])
 
bool ED_gpencil_stroke_point_is_inside (const struct bGPDstroke *gps, const struct GP_SpaceConversion *gsc, const int mval[2], const float diff_mat[4][4])
 
void ED_gpencil_projected_2d_bound_box (const struct GP_SpaceConversion *gsc, const struct bGPDstroke *gps, const float diff_mat[4][4], float r_min[2], float r_max[2])
 
struct bGPDstrokeED_gpencil_stroke_nearest_to_ends (struct bContext *C, const struct GP_SpaceConversion *gsc, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps, const float ctrl1[2], const float ctrl2[2], float radius, int *r_index)
 
void ED_gpencil_stroke_extremes_to2d (const struct GP_SpaceConversion *gsc, const float diff_mat[4][4], struct bGPDstroke *gps, float r_ctrl1[2], float r_ctrl2[2])
 
struct bGPDstrokeED_gpencil_stroke_join_and_trim (struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, struct bGPDstroke *gps_dst, int pt_index)
 
void ED_gpencil_stroke_close_by_distance (struct bGPDstroke *gps, float threshold)
 

Macro Definition Documentation

◆ GP_PAR_ARMATURE_AUTO

#define GP_PAR_ARMATURE_AUTO   1

Definition at line 367 of file ED_gpencil.h.

◆ GP_PAR_ARMATURE_NAME

#define GP_PAR_ARMATURE_NAME   0

Definition at line 366 of file ED_gpencil.h.

◆ GP_PRIM_DATABUF_SIZE

#define GP_PRIM_DATABUF_SIZE   5

Number of values defining each point in the built-in data buffers for primitives.

Definition at line 388 of file ED_gpencil.h.

◆ GPENCIL_MINIMUM_JOIN_DIST

#define GPENCIL_MINIMUM_JOIN_DIST   20.0f

Definition at line 49 of file ED_gpencil.h.

Typedef Documentation

◆ eGP_ReprojectModes

◆ eGP_TargetObjectMode

◆ tGPspoint

typedef struct tGPspoint tGPspoint

Enumeration Type Documentation

◆ eGP_ReprojectModes

Enumerator
GP_REPROJECT_FRONT 
GP_REPROJECT_SIDE 
GP_REPROJECT_TOP 
GP_REPROJECT_VIEW 
GP_REPROJECT_SURFACE 
GP_REPROJECT_CURSOR 
GP_REPROJECT_KEEP 

Definition at line 52 of file ED_gpencil.h.

◆ eGP_TargetObjectMode

Enumerator
GP_TARGET_OB_NEW 
GP_TARGET_OB_SELECTED 

Definition at line 68 of file ED_gpencil.h.

Function Documentation

◆ ED_annotation_data_get_active()

struct bGPdata* ED_annotation_data_get_active ( const struct bContext C)

Get the active Grease Pencil data-block

Note
This is the original (#G.main) copy of the data-block, stored in files. Do not use for reading evaluated copies of GP Objects data.

◆ ED_annotation_data_get_active_direct()

struct bGPdata* ED_annotation_data_get_active_direct ( struct ID screen_id,
struct ScrArea area,
struct Scene scene 
)

Get the active Grease Pencil data-block, when context is not available.

Definition at line 236 of file gpencil_utils.c.

References blender::compositor::area(), ED_annotation_data_get_pointers_direct(), NULL, and scene.

Referenced by screen_ctx_active_annotation_layer(), and screen_ctx_annotation_data().

◆ ED_annotation_data_get_pointers()

struct bGPdata** ED_annotation_data_get_pointers ( const struct bContext C,
struct PointerRNA r_ptr 
)

Get pointer to active Grease Pencil data-block, and an RNA-pointer to trace back to whatever owns it.

◆ ED_annotation_data_get_pointers_direct()

struct bGPdata** ED_annotation_data_get_pointers_direct ( struct ID screen_id,
struct ScrArea area,
struct Scene scene,
struct PointerRNA r_ptr 
)

◆ ED_annotation_draw_2dimage()

void ED_annotation_draw_2dimage ( const struct bContext C)

Draw grease-pencil sketches to specified 2d-view that uses ibuf corrections.

◆ ED_annotation_draw_ex()

void ED_annotation_draw_ex ( struct Scene scene,
struct bGPdata gpd,
int  winx,
int  winy,
int  cfra,
char  spacetype 
)

◆ ED_annotation_draw_view2d()

void ED_annotation_draw_view2d ( const struct bContext C,
bool  onlyv2d 
)

Draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly.

Note
This gets called twice - first time with onlyv2d=true to draw 'canvas' strokes, second time with onlyv2d=false for screen-aligned strokes.

◆ ED_annotation_draw_view3d()

void ED_annotation_draw_view3d ( struct Scene scene,
struct Depsgraph depsgraph,
struct View3D v3d,
struct ARegion region,
bool  only3d 
)

Draw annotations sketches to specified 3d-view assuming that matrices are already set correctly. NOTE: this gets called twice - first time with only3d=true to draw 3d-strokes, second time with only3d=false for screen-aligned strokes.

Definition at line 884 of file annotate_draw.c.

References annotation_draw_data_all(), RenderData::cfra, depsgraph, ED_view3d_calc_camera_border(), View3D::flag2, G, G_FLAG_RENDER_VIEWPORT, GP_DRAWDATA_NOSTATUS, GP_DRAWDATA_ONLY3D, Scene::gpd, NULL, RegionView3D::persp, Scene::r, ARegion::regiondata, round_fl_to_int(), RV3D_CAMOB, scene, View3D::spacetype, V3D_HIDE_OVERLAYS, ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by DRW_draw_callbacks_post_scene().

◆ ED_gpencil_add_armature()

bool ED_gpencil_add_armature ( const struct bContext C,
struct ReportList reports,
struct Object ob,
struct Object ob_arm 
)

◆ ED_gpencil_add_armature_weights()

bool ED_gpencil_add_armature_weights ( const struct bContext C,
struct ReportList reports,
struct Object ob,
struct Object ob_arm,
int  mode 
)

◆ ED_gpencil_add_defaults()

void ED_gpencil_add_defaults ( struct bContext C,
struct Object ob 
)

◆ ED_gpencil_add_lattice_modifier()

bool ED_gpencil_add_lattice_modifier ( const struct bContext C,
struct ReportList reports,
struct Object ob,
struct Object ob_latt 
)

Add Lattice modifier using Parent operator. Parent GPencil object to Lattice.

◆ ED_gpencil_add_object()

struct Object* ED_gpencil_add_object ( struct bContext C,
const float  loc[3],
unsigned short  local_view_bits 
)

◆ ED_gpencil_anim_copybuf_copy()

bool ED_gpencil_anim_copybuf_copy ( struct bAnimContext ac)

◆ ED_gpencil_anim_copybuf_free()

void ED_gpencil_anim_copybuf_free ( void  )

This function frees any MEM_calloc'ed copy/paste buffer data.

Definition at line 306 of file editaction_gpencil.c.

References BKE_gpencil_free_layers(), BLI_listbase_clear(), gpencil_anim_copy_cfra, gpencil_anim_copy_firstframe, gpencil_anim_copy_lastframe, and gpencil_anim_copybuf.

Referenced by ED_gpencil_anim_copybuf_copy(), and WM_exit_ex().

◆ ED_gpencil_anim_copybuf_paste()

bool ED_gpencil_anim_copybuf_paste ( struct bAnimContext ac,
short  copy_mode 
)

◆ ED_gpencil_brush_draw_eraser()

void ED_gpencil_brush_draw_eraser ( struct Brush brush,
int  x,
int  y 
)

◆ ED_gpencil_create_blank()

void ED_gpencil_create_blank ( struct bContext C,
struct Object ob,
float  mat[4][4] 
)

Add a Simple empty object with one layer and one color.

◆ ED_gpencil_create_lineart()

void ED_gpencil_create_lineart ( struct bContext C,
struct Object ob 
)

◆ ED_gpencil_create_monkey()

void ED_gpencil_create_monkey ( struct bContext C,
struct Object ob,
float  mat[4][4] 
)

◆ ED_gpencil_create_stroke()

void ED_gpencil_create_stroke ( struct bContext C,
struct Object ob,
float  mat[4][4] 
)

◆ ED_gpencil_data_get_active()

struct bGPdata* ED_gpencil_data_get_active ( const struct bContext C)

Get the active Grease Pencil data-block

◆ ED_gpencil_data_get_active_direct()

struct bGPdata* ED_gpencil_data_get_active_direct ( struct ScrArea area,
struct Object ob 
)

◆ ED_gpencil_data_get_active_evaluated()

struct bGPdata* ED_gpencil_data_get_active_evaluated ( const struct bContext C)

Get the evaluated copy of the active Grease Pencil data-block (where applicable)

  • For the 3D View (i.e. "GP Objects"), this gives the evaluated copy of the GP data-block (i.e. a copy of the active GP data-block for the active object, where modifiers have been applied). This is needed to correctly work with "Copy-on-Write".
  • For all other editors (i.e. "GP Annotations"), this just gives the active data-block like for ED_gpencil_data_get_active()

◆ ED_gpencil_data_get_pointers()

struct bGPdata** ED_gpencil_data_get_pointers ( const struct bContext C,
struct PointerRNA r_ptr 
)

Get pointer to active Grease Pencil data-block, and an RNA-pointer to trace back to whatever owns it.

◆ ED_gpencil_data_get_pointers_direct()

struct bGPdata** ED_gpencil_data_get_pointers_direct ( struct ScrArea area,
struct Object ob,
struct PointerRNA r_ptr 
)

Context independent (i.e. each required part is passed in instead).

Get pointer to active Grease Pencil data-block, and an RNA-pointer to trace back to whatever owns it, when context info is not available.

Definition at line 85 of file gpencil_utils.c.

References blender::compositor::area(), Object::data, Object::id, NULL, OB_GPENCIL, RNA_id_pointer_create(), SPACE_INFO, SPACE_PROPERTIES, SPACE_TOPBAR, SPACE_VIEW3D, and Object::type.

Referenced by ED_gpencil_data_get_active_direct(), ED_gpencil_data_get_pointers(), and screen_ctx_gpencil_data_owner().

◆ ED_gpencil_data_owner_is_annotation()

bool ED_gpencil_data_owner_is_annotation ( struct PointerRNA owner_ptr)

Utility to check whether the r_ptr output of ED_gpencil_data_get_pointers() is for annotation usage.

Definition at line 270 of file gpencil_utils.c.

References PointerRNA::type.

Referenced by annotation_session_initdata(), and gpencil_session_initdata().

◆ ED_gpencil_drawing_reference_get()

void ED_gpencil_drawing_reference_get ( const struct Scene scene,
const struct Object ob,
char  align_flag,
float  r_vec[3] 
)

Get drawing reference point for conversion or projection of the stroke

Parameters
r_vecReference point found

◆ ED_gpencil_fill_vertex_color_set()

void ED_gpencil_fill_vertex_color_set ( struct ToolSettings ts,
struct Brush brush,
struct bGPDstroke gps 
)

◆ ED_gpencil_frame_has_selected_stroke()

bool ED_gpencil_frame_has_selected_stroke ( const struct bGPDframe gpf)

◆ ED_gpencil_has_keyframe_v3d()

bool ED_gpencil_has_keyframe_v3d ( struct Scene scene,
struct Object ob,
int  cfra 
)

Check whether there's an active GP keyframe on the current frame.

◆ ED_gpencil_init_random_settings()

void ED_gpencil_init_random_settings ( struct Brush brush,
const int  mval[2],
struct GpRandomSettings random_settings 
)

◆ ED_gpencil_join_objects_exec()

int ED_gpencil_join_objects_exec ( struct bContext C,
struct wmOperator op 
)

Join objects called from OBJECT_OT_join.

Definition at line 2817 of file gpencil_data.c.

References bGPdata::adt, Object::adt, ADT_MERGECOPY_KEEP_DST, GpencilModifierTypeInfo::bakeModifier, BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_fcurves_main_cb(), BKE_gpencil_layer_duplicate(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_material(), BKE_gpencil_modifier_get_info(), BKE_gpencil_object_material_ensure(), BKE_object_defgroup_unique_name(), BKE_object_material_len_p(), BKE_report(), BLI_addtail(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_str_new(), BLI_listbase_count(), BLI_listbase_is_empty(), BLI_strdup(), BLI_uniquename(), C, copy_m3_m4(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), Object::data, DATA_, MDeformWeight::def_nr, DEG_id_tag_update(), DEG_relations_tag_update(), depsgraph, MDeformVert::dw, ED_object_base_free_and_unlink(), bGPDlayer::frames, GPENCIL_ANY_MODE, gpencil_joined_fix_animdata_cb(), bGPdata::id, Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, if(), bGPDlayer::info, invert_m3_m3_safe_ortho(), invert_m4_m4_safe_ortho(), bGPdata::layers, LISTBASE_FOREACH, Object::loc, MEM_dupallocN, MEM_freeN, mul_m3_v3(), mul_v3_m3v3(), mul_v3_m4v3(), tJoinGPencil_AdtFixData::names_map, NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, NULL, OB_GPENCIL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, RPT_WARNING, scene, tJoinGPencil_AdtFixData::src_gpd, sub_v3_v3(), sub_v3_v3v3(), tJoinGPencil_AdtFixData::tar_gpd, Object::type, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, WM_event_add_notifier(), and bGPDspoint::x.

Referenced by object_join_exec().

◆ ED_gpencil_layer_frame_select_check()

bool ED_gpencil_layer_frame_select_check ( const struct bGPDlayer gpl)

Check if one of the frames in this layer is selected.

◆ ED_gpencil_layer_frame_select_set()

void ED_gpencil_layer_frame_select_set ( struct bGPDlayer gpl,
short  mode 
)

Set all/none/invert select.

Definition at line 144 of file editaction_gpencil.c.

References ED_gpencil_select_frames(), and NULL.

Referenced by deselect_action_keys().

◆ ED_gpencil_layer_frames_delete()

bool ED_gpencil_layer_frames_delete ( struct bGPDlayer gpl)

Delete selected frames.

Definition at line 232 of file editaction_gpencil.c.

References BKE_gpencil_layer_frame_delete(), bGPDlayer::frames, GP_FRAME_SELECT, LISTBASE_FOREACH_MUTABLE, and NULL.

Referenced by delete_action_keys().

◆ ED_gpencil_layer_frames_duplicate()

void ED_gpencil_layer_frames_duplicate ( struct bGPDlayer gpl)

Duplicate selected frames from given gp-layer.

Definition at line 252 of file editaction_gpencil.c.

References BKE_gpencil_frame_duplicate(), BLI_insertlinkafter(), bGPDlayer::frames, GP_FRAME_SELECT, LISTBASE_FOREACH_MUTABLE, and NULL.

Referenced by duplicate_action_keys().

◆ ED_gpencil_layer_frames_keytype_set()

void ED_gpencil_layer_frames_keytype_set ( struct bGPDlayer gpl,
short  type 
)

Set keyframe type for selected frames from given gp-layer

Parameters
typeThe type of keyframe (eBezTriple_KeyframeType) to set selected frames to.

Definition at line 275 of file editaction_gpencil.c.

References bGPDlayer::frames, GP_FRAME_SELECT, LISTBASE_FOREACH, NULL, and type.

Referenced by setkeytype_action_keys().

◆ ED_gpencil_layer_frames_looper()

bool ED_gpencil_layer_frames_looper ( struct bGPDlayer gpl,
struct Scene scene,
bool(*)(struct bGPDframe *, struct Scene *)  gpf_cb 
)

Loops over the GP-frames for a GP-layer, and applies the given callback.

◆ ED_gpencil_layer_frames_select_box()

void ED_gpencil_layer_frames_select_box ( struct bGPDlayer gpl,
float  min,
float  max,
short  select_mode 
)

Select the frames in this layer that occur within the bounds specified.

Definition at line 170 of file editaction_gpencil.c.

References bGPDlayer::frames, gpencil_frame_select(), IN_RANGE, LISTBASE_FOREACH, max, min, and NULL.

Referenced by actkeys_select_leftright(), box_select_elem(), and markers_selectkeys_between().

◆ ED_gpencil_layer_frames_select_region()

void ED_gpencil_layer_frames_select_region ( struct KeyframeEditData ked,
struct bGPDlayer gpl,
short  tool,
short  select_mode 
)

◆ ED_gpencil_layer_has_selected_stroke()

bool ED_gpencil_layer_has_selected_stroke ( const struct bGPDlayer gpl,
bool  is_multiedit 
)

◆ ED_gpencil_layer_make_cfra_list()

void ED_gpencil_layer_make_cfra_list ( struct bGPDlayer gpl,
ListBase elems,
bool  onlysel 
)

Make a listing all the gp-frames in a layer as cfraelems.

Definition at line 68 of file editaction_gpencil.c.

References BLI_addtail(), CfraElem::cfra, ELEM, float(), bGPDlayer::frames, GP_FRAME_SELECT, LISTBASE_FOREACH, MEM_callocN, NULL, and CfraElem::sel.

Referenced by columnselect_action_keys().

◆ ED_gpencil_layer_merge()

void ED_gpencil_layer_merge ( struct bGPdata gpd,
struct bGPDlayer gpl_src,
struct bGPDlayer gpl_dst,
bool  reverse 
)

◆ ED_gpencil_layer_mirror_frames()

void ED_gpencil_layer_mirror_frames ( struct bGPDlayer gpl,
struct Scene scene,
short  mode 
)

◆ ED_gpencil_layer_snap_frames()

void ED_gpencil_layer_snap_frames ( struct bGPDlayer gpl,
struct Scene scene,
short  mode 
)

◆ ED_gpencil_point_vertex_color_set()

void ED_gpencil_point_vertex_color_set ( struct ToolSettings ts,
struct Brush brush,
struct bGPDspoint pt,
struct tGPspoint tpt 
)

◆ ED_gpencil_project_point_to_plane()

void ED_gpencil_project_point_to_plane ( const struct Scene scene,
const struct Object ob,
struct bGPDlayer gpl,
const struct RegionView3D rv3d,
const float  origin[3],
int  axis,
struct bGPDspoint pt 
)

Reproject given point to a plane locked to axis to avoid stroke offset

Parameters
ptPoint to affect (used for input & output).

◆ ED_gpencil_project_stroke_to_plane()

void ED_gpencil_project_stroke_to_plane ( const struct Scene scene,
const struct Object ob,
const struct RegionView3D rv3d,
struct bGPDlayer gpl,
struct bGPDstroke gps,
const float  origin[3],
int  axis 
)

Reproject all points of the stroke to a plane locked to axis to avoid stroke offset

◆ ED_gpencil_project_stroke_to_view()

void ED_gpencil_project_stroke_to_view ( struct bContext C,
struct bGPDlayer gpl,
struct bGPDstroke gps 
)

◆ ED_gpencil_projected_2d_bound_box()

void ED_gpencil_projected_2d_bound_box ( const struct GP_SpaceConversion gsc,
const struct bGPDstroke gps,
const float  diff_mat[4][4],
float  r_min[2],
float  r_max[2] 
)

Get the bigger 2D bound box points.

◆ ED_gpencil_reset_layers_parent()

void ED_gpencil_reset_layers_parent ( struct Depsgraph depsgraph,
struct Object obact,
struct bGPdata gpd 
)

◆ ED_gpencil_sbuffer_ensure()

struct tGPspoint* ED_gpencil_sbuffer_ensure ( struct tGPspoint buffer_array,
int *  buffer_size,
int *  buffer_used,
bool  clear 
)

◆ ED_gpencil_sbuffer_update_eval()

void ED_gpencil_sbuffer_update_eval ( struct bGPdata gpd,
struct Object ob_eval 
)

◆ ED_gpencil_sbuffer_vertex_color_set()

void ED_gpencil_sbuffer_vertex_color_set ( struct Depsgraph depsgraph,
struct Object ob,
struct ToolSettings ts,
struct Brush brush,
struct Material material,
float  random_color[3],
float  pen_pressure 
)

◆ ED_gpencil_select_curve_toggle_all()

void ED_gpencil_select_curve_toggle_all ( struct bContext C,
int  action 
)

◆ ED_gpencil_select_frame()

void ED_gpencil_select_frame ( struct bGPDlayer gpl,
int  selx,
short  select_mode 
)

Select the frame in this layer that occurs on this frame (there should only be one at most).

Definition at line 155 of file editaction_gpencil.c.

References BKE_gpencil_layer_frame_find(), gpencil_frame_select(), and NULL.

Referenced by actkeys_mselect_column(), actkeys_mselect_single(), and columnselect_action_keys().

◆ ED_gpencil_select_frames()

void ED_gpencil_select_frames ( struct bGPDlayer gpl,
short  select_mode 
)

Set all/none/invert select (like above, but with SELECT_* modes).

Definition at line 131 of file editaction_gpencil.c.

References bGPDlayer::frames, gpencil_frame_select(), LISTBASE_FOREACH, and NULL.

Referenced by actkeys_mselect_channel_only(), and ED_gpencil_layer_frame_select_set().

◆ ED_gpencil_select_stroke_segment()

int ED_gpencil_select_stroke_segment ( struct bGPdata gpd,
struct bGPDlayer gpl,
struct bGPDstroke gps,
struct bGPDspoint pt,
bool  select,
bool  insert,
float  scale,
float  r_hita[3],
float  r_hitb[3] 
)

◆ ED_gpencil_select_toggle_all()

void ED_gpencil_select_toggle_all ( struct bContext C,
int  action 
)

◆ ED_gpencil_session_active()

int ED_gpencil_session_active ( void  )

◆ ED_gpencil_set_active_channel()

void ED_gpencil_set_active_channel ( struct bGPdata gpd,
struct bGPDlayer gpl 
)

◆ ED_gpencil_setup_modes()

void ED_gpencil_setup_modes ( struct bContext C,
struct bGPdata gpd,
int  newmode 
)

◆ ED_gpencil_stroke_can_use()

bool ED_gpencil_stroke_can_use ( const struct bContext C,
const struct bGPDstroke gps 
)

◆ ED_gpencil_stroke_can_use_direct()

bool ED_gpencil_stroke_can_use_direct ( const struct ScrArea area,
const struct bGPDstroke gps 
)

Check whether given stroke can be edited given the supplied context. TODO: do we need additional flags for screen-space vs data-space?.

◆ ED_gpencil_stroke_check_collision()

bool ED_gpencil_stroke_check_collision ( const struct GP_SpaceConversion gsc,
struct bGPDstroke gps,
const float  mval[2],
int  radius,
const float  diff_mat[4][4] 
)

Check if the stroke collides with brush.

◆ ED_gpencil_stroke_close_by_distance()

void ED_gpencil_stroke_close_by_distance ( struct bGPDstroke gps,
float  threshold 
)

◆ ED_gpencil_stroke_extremes_to2d()

void ED_gpencil_stroke_extremes_to2d ( const struct GP_SpaceConversion gsc,
const float  diff_mat[4][4],
struct bGPDstroke gps,
float  r_ctrl1[2],
float  r_ctrl2[2] 
)

Get extremes of stroke in 2D using current view.

◆ ED_gpencil_stroke_init_data()

void ED_gpencil_stroke_init_data ( struct bGPDstroke gps,
const float array,
int  totpoints,
const float  mat[4][4] 
)

Populate stroke with point data from data buffers.

Parameters
gpsGrease pencil stroke
arrayFlat array of point data values. Each entry has GP_PRIM_DATABUF_SIZE values.
totpointsTotal of points
mat4x4 transform matrix to transform points into the right coordinate space.

Definition at line 28 of file gpencil_add_monkey.c.

References GP_PRIM_DATABUF_SIZE, mul_m4_v3(), bGPDstroke::points, bGPDspoint::pressure, bGPDspoint::strength, x, bGPDspoint::x, bGPDspoint::y, and bGPDspoint::z.

Referenced by ED_gpencil_create_monkey(), and ED_gpencil_create_stroke().

◆ ED_gpencil_stroke_join_and_trim()

struct bGPDstroke* ED_gpencil_stroke_join_and_trim ( struct bGPdata gpd,
struct bGPDframe gpf,
struct bGPDstroke gps,
struct bGPDstroke gps_dst,
int  pt_index 
)

◆ ED_gpencil_stroke_material_editable()

bool ED_gpencil_stroke_material_editable ( struct Object ob,
const struct bGPDlayer gpl,
const struct bGPDstroke gps 
)

◆ ED_gpencil_stroke_material_visible()

bool ED_gpencil_stroke_material_visible ( struct Object ob,
const struct bGPDstroke gps 
)

◆ ED_gpencil_stroke_nearest_to_ends()

struct bGPDstroke* ED_gpencil_stroke_nearest_to_ends ( struct bContext C,
const struct GP_SpaceConversion gsc,
struct bGPDlayer gpl,
struct bGPDframe gpf,
struct bGPDstroke gps,
const float  ctrl1[2],
const float  ctrl2[2],
float  radius,
int *  r_index 
)

◆ ED_gpencil_stroke_point_is_inside()

bool ED_gpencil_stroke_point_is_inside ( const struct bGPDstroke gps,
const struct GP_SpaceConversion gsc,
const int  mval[2],
const float  diff_mat[4][4] 
)

Check if a point is inside of the stroke.

Parameters
gpsStroke to check.
gscSpace conversion data.
mvalRegion relative cursor position.
diff_matView matrix.
Returns
True if the point is inside.

◆ ED_gpencil_stroke_reproject()

void ED_gpencil_stroke_reproject ( struct Depsgraph depsgraph,
const struct GP_SpaceConversion gsc,
struct SnapObjectContext sctx,
struct bGPDlayer gpl,
struct bGPDframe gpf,
struct bGPDstroke gps,
eGP_ReprojectModes  mode,
bool  keep_original 
)

Reproject selected strokes.

◆ ED_gpencil_strokes_copybuf_free()

void ED_gpencil_strokes_copybuf_free ( void  )

◆ ED_gpencil_tag_scene_gpencil()

void ED_gpencil_tag_scene_gpencil ( struct Scene scene)

◆ ED_gpencil_toggle_brush_cursor()

void ED_gpencil_toggle_brush_cursor ( struct bContext C,
bool  enable,
void customdata 
)

◆ ED_gpencil_tpoint_to_point()

void ED_gpencil_tpoint_to_point ( struct ARegion region,
float  origin[3],
const struct tGPspoint tpt,
struct bGPDspoint pt 
)

Convert 2d tGPspoint to 3d bGPDspoint.

◆ ED_gpencil_update_color_uv()

void ED_gpencil_update_color_uv ( struct Main bmain,
struct Material mat 
)

◆ ED_gpencil_vgroup_assign()

void ED_gpencil_vgroup_assign ( struct bContext C,
struct Object ob,
float  weight 
)

◆ ED_gpencil_vgroup_deselect()

void ED_gpencil_vgroup_deselect ( struct bContext C,
struct Object ob 
)

◆ ED_gpencil_vgroup_remove()

void ED_gpencil_vgroup_remove ( struct bContext C,
struct Object ob 
)

◆ ED_gpencil_vgroup_select()

void ED_gpencil_vgroup_select ( struct bContext C,
struct Object ob 
)

◆ ED_keymap_gpencil()

void ED_keymap_gpencil ( struct wmKeyConfig keyconf)

◆ ED_object_gpencil_exit()

bool ED_object_gpencil_exit ( struct Main bmain,
struct Object ob 
)

◆ ED_operatormacros_gpencil()

void ED_operatormacros_gpencil ( void  )

◆ ED_operatortypes_gpencil()

void ED_operatortypes_gpencil ( void  )

Definition at line 498 of file gpencil_ops.c.

References GPENCIL_OT_active_frame_delete(), GPENCIL_OT_active_frames_delete_all(), GPENCIL_OT_annotate(), GPENCIL_OT_annotation_active_frame_delete(), GPENCIL_OT_annotation_add(), GPENCIL_OT_bake_grease_pencil_animation(), GPENCIL_OT_bake_mesh_animation(), GPENCIL_OT_blank_frame_add(), GPENCIL_OT_brush_reset(), GPENCIL_OT_brush_reset_all(), GPENCIL_OT_convert(), GPENCIL_OT_convert_old_files(), GPENCIL_OT_copy(), GPENCIL_OT_data_unlink(), GPENCIL_OT_delete(), GPENCIL_OT_dissolve(), GPENCIL_OT_draw(), GPENCIL_OT_duplicate(), GPENCIL_OT_editmode_toggle(), GPENCIL_OT_extract_palette_vertex(), GPENCIL_OT_extrude(), GPENCIL_OT_fill(), GPENCIL_OT_frame_clean_duplicate(), GPENCIL_OT_frame_clean_fill(), GPENCIL_OT_frame_clean_loose(), GPENCIL_OT_frame_duplicate(), GPENCIL_OT_generate_weights(), GPENCIL_OT_guide_rotate(), GPENCIL_OT_hide(), GPENCIL_OT_image_to_grease_pencil(), GPENCIL_OT_interpolate(), GPENCIL_OT_interpolate_reverse(), GPENCIL_OT_interpolate_sequence(), GPENCIL_OT_layer_active(), GPENCIL_OT_layer_add(), GPENCIL_OT_layer_annotation_add(), GPENCIL_OT_layer_annotation_move(), GPENCIL_OT_layer_annotation_remove(), GPENCIL_OT_layer_change(), GPENCIL_OT_layer_duplicate(), GPENCIL_OT_layer_duplicate_object(), GPENCIL_OT_layer_isolate(), GPENCIL_OT_layer_mask_add(), GPENCIL_OT_layer_mask_move(), GPENCIL_OT_layer_mask_remove(), GPENCIL_OT_layer_merge(), GPENCIL_OT_layer_move(), GPENCIL_OT_layer_remove(), GPENCIL_OT_lock_all(), GPENCIL_OT_lock_layer(), GPENCIL_OT_material_hide(), GPENCIL_OT_material_isolate(), GPENCIL_OT_material_lock_all(), GPENCIL_OT_material_lock_unused(), GPENCIL_OT_material_reveal(), GPENCIL_OT_material_select(), GPENCIL_OT_material_set(), GPENCIL_OT_material_to_vertex_color(), GPENCIL_OT_material_unlock_all(), GPENCIL_OT_materials_copy_to_object(), GPENCIL_OT_move_to_layer(), GPENCIL_OT_paintmode_toggle(), GPENCIL_OT_paste(), GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), GPENCIL_OT_primitive_polyline(), GPENCIL_OT_recalc_geometry(), GPENCIL_OT_reproject(), GPENCIL_OT_reset_transform_fill(), GPENCIL_OT_reveal(), GPENCIL_OT_sculpt_paint(), GPENCIL_OT_sculptmode_toggle(), GPENCIL_OT_select(), GPENCIL_OT_select_all(), GPENCIL_OT_select_alternate(), GPENCIL_OT_select_box(), GPENCIL_OT_select_circle(), GPENCIL_OT_select_first(), GPENCIL_OT_select_grouped(), GPENCIL_OT_select_lasso(), GPENCIL_OT_select_last(), GPENCIL_OT_select_less(), GPENCIL_OT_select_linked(), GPENCIL_OT_select_more(), GPENCIL_OT_select_random(), GPENCIL_OT_select_vertex_color(), GPENCIL_OT_selection_opacity_toggle(), GPENCIL_OT_selectmode_toggle(), GPENCIL_OT_set_active_material(), GPENCIL_OT_snap_cursor_to_selected(), GPENCIL_OT_snap_to_cursor(), GPENCIL_OT_snap_to_grid(), GPENCIL_OT_stroke_apply_thickness(), GPENCIL_OT_stroke_arrange(), GPENCIL_OT_stroke_caps_set(), GPENCIL_OT_stroke_change_color(), GPENCIL_OT_stroke_cutter(), GPENCIL_OT_stroke_cyclical_set(), GPENCIL_OT_stroke_editcurve_set_handle_type(), GPENCIL_OT_stroke_enter_editcurve_mode(), GPENCIL_OT_stroke_flip(), GPENCIL_OT_stroke_join(), GPENCIL_OT_stroke_merge(), GPENCIL_OT_stroke_merge_by_distance(), GPENCIL_OT_stroke_merge_material(), GPENCIL_OT_stroke_normalize(), GPENCIL_OT_stroke_reset_vertex_color(), GPENCIL_OT_stroke_sample(), GPENCIL_OT_stroke_separate(), GPENCIL_OT_stroke_simplify(), GPENCIL_OT_stroke_simplify_fixed(), GPENCIL_OT_stroke_smooth(), GPENCIL_OT_stroke_split(), GPENCIL_OT_stroke_subdivide(), GPENCIL_OT_stroke_trim(), GPENCIL_OT_trace_image(), GPENCIL_OT_transform_fill(), GPENCIL_OT_unlock_all(), GPENCIL_OT_vertex_color_brightness_contrast(), GPENCIL_OT_vertex_color_hsv(), GPENCIL_OT_vertex_color_invert(), GPENCIL_OT_vertex_color_levels(), GPENCIL_OT_vertex_color_set(), GPENCIL_OT_vertex_group_assign(), GPENCIL_OT_vertex_group_deselect(), GPENCIL_OT_vertex_group_invert(), GPENCIL_OT_vertex_group_normalize(), GPENCIL_OT_vertex_group_normalize_all(), GPENCIL_OT_vertex_group_remove_from(), GPENCIL_OT_vertex_group_select(), GPENCIL_OT_vertex_group_smooth(), GPENCIL_OT_vertex_paint(), GPENCIL_OT_vertexmode_toggle(), GPENCIL_OT_weight_paint(), GPENCIL_OT_weightmode_toggle(), and WM_operatortype_append().

Referenced by ED_spacetypes_init().

◆ ED_undo_gpencil_step()

int ED_undo_gpencil_step ( struct bContext C,
int  step 
)