Blender  V3.3
Functions | Variables
editaction_gpencil.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_utildefines.h"
#include "DNA_gpencil_types.h"
#include "DNA_scene_types.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
#include "BKE_report.h"
#include "ED_anim_api.h"
#include "ED_gpencil.h"
#include "ED_keyframes_edit.h"
#include "ED_markers.h"
#include "WM_api.h"
#include "DEG_depsgraph.h"

Go to the source code of this file.

Functions

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)
 
static void gpencil_frame_select (bGPDframe *gpf, short select_mode)
 
void ED_gpencil_select_frames (bGPDlayer *gpl, short select_mode)
 
void ED_gpencil_layer_frame_select_set (bGPDlayer *gpl, short mode)
 
void ED_gpencil_select_frame (bGPDlayer *gpl, int selx, short select_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_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_anim_copybuf_free (void)
 
bool ED_gpencil_anim_copybuf_copy (bAnimContext *ac)
 
bool ED_gpencil_anim_copybuf_paste (bAnimContext *ac, const short offset_mode)
 
static bool gpencil_frame_snap_nearest (bGPDframe *UNUSED(gpf), Scene *UNUSED(scene))
 
static bool gpencil_frame_snap_nearestsec (bGPDframe *gpf, Scene *scene)
 
static bool gpencil_frame_snap_cframe (bGPDframe *gpf, Scene *scene)
 
static bool gpencil_frame_snap_nearmarker (bGPDframe *gpf, Scene *scene)
 
void ED_gpencil_layer_snap_frames (bGPDlayer *gpl, Scene *scene, short mode)
 
static bool gpencil_frame_mirror_cframe (bGPDframe *gpf, Scene *scene)
 
static bool gpencil_frame_mirror_yaxis (bGPDframe *gpf, Scene *UNUSED(scene))
 
static bool gpencil_frame_mirror_xaxis (bGPDframe *gpf, Scene *UNUSED(scene))
 
static bool gpencil_frame_mirror_marker (bGPDframe *gpf, Scene *scene)
 
void ED_gpencil_layer_mirror_frames (bGPDlayer *gpl, Scene *scene, short mode)
 

Variables

static ListBase gpencil_anim_copybuf = {NULL, NULL}
 
static int gpencil_anim_copy_firstframe = 999999999
 
static int gpencil_anim_copy_lastframe = -999999999
 
static int gpencil_anim_copy_cfra = 0
 

Function Documentation

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

bool ED_gpencil_layer_frame_select_check ( const bGPDlayer gpl)

◆ 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 ( bGPDlayer gpl,
Scene scene,
bool(*)(bGPDframe *, Scene *)  gpf_cb 
)

◆ 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_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_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_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_set_active_channel()

void ED_gpencil_set_active_channel ( struct bGPdata gpd,
struct bGPDlayer gpl 
)

◆ gpencil_frame_mirror_cframe()

static bool gpencil_frame_mirror_cframe ( bGPDframe gpf,
Scene scene 
)
static

◆ gpencil_frame_mirror_marker()

static bool gpencil_frame_mirror_marker ( bGPDframe gpf,
Scene scene 
)
static

◆ gpencil_frame_mirror_xaxis()

static bool gpencil_frame_mirror_xaxis ( bGPDframe gpf,
Scene UNUSEDscene 
)
static

◆ gpencil_frame_mirror_yaxis()

static bool gpencil_frame_mirror_yaxis ( bGPDframe gpf,
Scene UNUSEDscene 
)
static

◆ gpencil_frame_select()

static void gpencil_frame_select ( bGPDframe gpf,
short  select_mode 
)
static

◆ gpencil_frame_snap_cframe()

static bool gpencil_frame_snap_cframe ( bGPDframe gpf,
Scene scene 
)
static

◆ gpencil_frame_snap_nearest()

static bool gpencil_frame_snap_nearest ( bGPDframe UNUSEDgpf,
Scene UNUSEDscene 
)
static

Definition at line 499 of file editaction_gpencil.c.

References blender::math::floor(), and GP_FRAME_SELECT.

Referenced by ED_gpencil_layer_snap_frames().

◆ gpencil_frame_snap_nearestsec()

static bool gpencil_frame_snap_nearestsec ( bGPDframe gpf,
Scene scene 
)
static

◆ gpencil_frame_snap_nearmarker()

static bool gpencil_frame_snap_nearmarker ( bGPDframe gpf,
Scene scene 
)
static

Variable Documentation

◆ gpencil_anim_copy_cfra

int gpencil_anim_copy_cfra = 0
static

◆ gpencil_anim_copy_firstframe

int gpencil_anim_copy_firstframe = 999999999
static

◆ gpencil_anim_copy_lastframe

int gpencil_anim_copy_lastframe = -999999999
static

◆ gpencil_anim_copybuf

ListBase gpencil_anim_copybuf = {NULL, NULL}
static