Blender V5.0
ED_gpencil_legacy.hh File Reference

Go to the source code of this file.

Classes

struct  tGPspoint

Functions

bGPdataED_annotation_data_get_active (const bContext *C)
bGPdata ** ED_annotation_data_get_pointers (const bContext *C, PointerRNA *r_ptr)
bGPdata ** ED_annotation_data_get_pointers_direct (ID *screen_id, ScrArea *area, Scene *scene, PointerRNA *r_ptr)
bGPdataED_annotation_data_get_active_direct (ID *screen_id, ScrArea *area, Scene *scene)
bool ED_gpencil_stroke_can_use_direct (const ScrArea *area, const bGPDstroke *gps)
void ED_keymap_gpencil_legacy (wmKeyConfig *keyconf)
void ED_operatortypes_gpencil_legacy ()
void ED_annotation_draw_2dimage (const bContext *C)
void ED_annotation_draw_view2d (const bContext *C, bool onlyv2d)
void ED_annotation_draw_view3d (Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
void ED_annotation_draw_ex (Scene *scene, bGPdata *gpd, int winx, int winy, int cfra, char spacetype)
bool ED_gpencil_layer_frames_looper (bGPDlayer *gpl, Scene *scene, bool(*gpf_cb)(bGPDframe *, Scene *))
void ED_gpencil_layer_make_cfra_list (bGPDlayer *gpl, ListBase *elems, bool onlysel)
bool ED_gpencil_layer_frame_select_check (const bGPDlayer *gpl)
void ED_gpencil_layer_frame_select_set (bGPDlayer *gpl, short mode)
void ED_gpencil_layer_frames_select_box (bGPDlayer *gpl, float min, float max, short select_mode)
void ED_gpencil_layer_frames_select_region (KeyframeEditData *ked, bGPDlayer *gpl, short tool, short select_mode)
void ED_gpencil_select_frames (bGPDlayer *gpl, short select_mode)
void ED_gpencil_select_frame (bGPDlayer *gpl, int selx, short select_mode)
void ED_gpencil_set_active_channel (bGPdata *gpd, bGPDlayer *gpl)
bool ED_gpencil_layer_frames_delete (bGPDlayer *gpl)
void ED_gpencil_layer_frames_duplicate (bGPDlayer *gpl)
void ED_gpencil_layer_frames_keytype_set (bGPDlayer *gpl, short type)
void ED_gpencil_layer_snap_frames (bGPDlayer *gpl, Scene *scene, short mode)
void ED_gpencil_layer_mirror_frames (bGPDlayer *gpl, Scene *scene, short mode)
void ED_gpencil_anim_copybuf_free ()
bool ED_gpencil_anim_copybuf_copy (bAnimContext *ac)
bool ED_gpencil_anim_copybuf_paste (bAnimContext *ac, short offset_mode)
tGPspointED_gpencil_sbuffer_ensure (tGPspoint *buffer_array, int *buffer_size, int *buffer_used, bool clear)

Function Documentation

◆ ED_annotation_data_get_active()

bGPdata * ED_annotation_data_get_active ( const 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.

Definition at line 167 of file gpencil_utils.cc.

References C, and ED_annotation_data_get_pointers().

Referenced by annotation_actframe_delete_poll(), ED_annotation_draw_2dimage(), ED_annotation_draw_view2d(), gpencil_actframe_delete_exec(), gpencil_active_layer_annotation_poll(), gpencil_layer_move_exec(), and gpencil_layer_remove_exec().

◆ ED_annotation_data_get_active_direct()

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

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

Definition at line 161 of file gpencil_utils.cc.

References ED_annotation_data_get_pointers_direct().

Referenced by screen_ctx_active_annotation_layer(), and screen_ctx_annotation_data().

◆ ED_annotation_data_get_pointers()

◆ ED_annotation_data_get_pointers_direct()

◆ ED_annotation_draw_2dimage()

◆ ED_annotation_draw_ex()

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

◆ ED_annotation_draw_view2d()

void ED_annotation_draw_view2d ( const 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.

Definition at line 849 of file annotate_draw.cc.

References annotation_draw_data_all(), C, RenderData::cfra, CTX_data_scene(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), ED_annotation_data_get_active(), ED_screen_animation_playing(), ELEM, GP_DRAWDATA_IEDITHACK, GP_DRAWDATA_NO_ONIONS, GP_DRAWDATA_NOSTATUS, GP_DRAWDATA_ONLYV2D, Scene::r, SPACE_CLIP, SPACE_IMAGE, ScrArea::spacetype, ARegion::winx, and ARegion::winy.

Referenced by clip_draw_grease_pencil(), drw_callbacks_post_scene_2D(), blender::ed::space_node::node_draw_space(), and blender::ed::vse::sequencer_draw_gpencil_overlay().

◆ ED_annotation_draw_view3d()

void ED_annotation_draw_view3d ( Scene * scene,
Depsgraph * depsgraph,
View3D * v3d,
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 892 of file annotate_draw.cc.

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, RegionView3D::persp, Scene::r, ARegion::regiondata, round_fl_to_int(), RV3D_CAMOB, View3D::spacetype, V3D_HIDE_OVERLAYS, ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by drw_callbacks_post_scene().

◆ ED_gpencil_anim_copybuf_copy()

◆ ED_gpencil_anim_copybuf_free()

void ED_gpencil_anim_copybuf_free ( )

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

Definition at line 305 of file editaction_gpencil.cc.

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()

◆ ED_gpencil_layer_frame_select_check()

bool ED_gpencil_layer_frame_select_check ( const bGPDlayer * gpl)

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

Definition at line 92 of file editaction_gpencil.cc.

References bGPDlayer::frames, GP_FRAME_SELECT, and LISTBASE_FOREACH.

Referenced by deselect_action_keys(), and duplicate_action_keys().

◆ ED_gpencil_layer_frame_select_set()

void ED_gpencil_layer_frame_select_set ( bGPDlayer * gpl,
short mode )

Set all/none/invert select.

Definition at line 143 of file editaction_gpencil.cc.

References ED_gpencil_select_frames().

Referenced by deselect_action_keys().

◆ ED_gpencil_layer_frames_delete()

bool ED_gpencil_layer_frames_delete ( bGPDlayer * gpl)

Delete selected frames.

Definition at line 231 of file editaction_gpencil.cc.

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

Referenced by delete_action_keys().

◆ ED_gpencil_layer_frames_duplicate()

void ED_gpencil_layer_frames_duplicate ( bGPDlayer * gpl)

Duplicate selected frames from given gp-layer.

Definition at line 251 of file editaction_gpencil.cc.

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

Referenced by duplicate_action_keys().

◆ ED_gpencil_layer_frames_keytype_set()

void ED_gpencil_layer_frames_keytype_set ( 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 274 of file editaction_gpencil.cc.

References bGPDlayer::frames, GP_FRAME_SELECT, and LISTBASE_FOREACH.

Referenced by setkeytype_action_keys().

◆ ED_gpencil_layer_frames_looper()

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

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

Definition at line 43 of file editaction_gpencil.cc.

References bGPDlayer::frames, and LISTBASE_FOREACH.

Referenced by ED_gpencil_layer_mirror_frames(), and ED_gpencil_layer_snap_frames().

◆ ED_gpencil_layer_frames_select_box()

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

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

Definition at line 169 of file editaction_gpencil.cc.

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

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 ( KeyframeEditData * ked,
bGPDlayer * gpl,
short tool,
short select_mode )

◆ ED_gpencil_layer_make_cfra_list()

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

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

Definition at line 67 of file editaction_gpencil.cc.

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

Referenced by columnselect_action_keys().

◆ ED_gpencil_layer_mirror_frames()

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

◆ ED_gpencil_layer_snap_frames()

◆ ED_gpencil_sbuffer_ensure()

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

Ensure the tGPspoint buffer (while drawing stroke) size is enough to save all points of the stroke.

Definition at line 262 of file gpencil_utils.cc.

References clear(), GP_STROKE_BUFFER_CHUNK, MEM_calloc_arrayN(), and MEM_recallocN.

Referenced by annotation_session_validatebuffer(), and annotation_stroke_addpoint().

◆ ED_gpencil_select_frame()

void ED_gpencil_select_frame ( 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 154 of file editaction_gpencil.cc.

References BKE_gpencil_layer_frame_find(), and gpencil_frame_select().

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

◆ ED_gpencil_select_frames()

void ED_gpencil_select_frames ( bGPDlayer * gpl,
short select_mode )

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

Definition at line 130 of file editaction_gpencil.cc.

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

Referenced by actkeys_mselect_channel_only(), and ED_gpencil_layer_frame_select_set().

◆ ED_gpencil_set_active_channel()

void ED_gpencil_set_active_channel ( bGPdata * gpd,
bGPDlayer * gpl )

◆ ED_gpencil_stroke_can_use_direct()

bool ED_gpencil_stroke_can_use_direct ( const ScrArea * area,
const 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?.

Definition at line 193 of file gpencil_utils.cc.

References ELEM, bGPDstroke::flag, GP_STROKE_2DIMAGE, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, SPACE_IMAGE, SPACE_PROPERTIES, SPACE_VIEW3D, and ScrArea::spacetype.

Referenced by annotation_stroke_doeraser().

◆ ED_keymap_gpencil_legacy()

void ED_keymap_gpencil_legacy ( wmKeyConfig * keyconf)

Definition at line 20 of file gpencil_ops.cc.

References RGN_TYPE_WINDOW, SPACE_EMPTY, and WM_keymap_ensure().

Referenced by ED_spacetypes_keymap().

◆ ED_operatortypes_gpencil_legacy()