|
Blender V4.3
|
#include <cmath>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_utildefines.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_scene_types.h"#include "BKE_gpencil_legacy.h"#include "ED_anim_api.hh"#include "ED_gpencil_legacy.hh"#include "ED_keyframes_edit.hh"#include "ED_markers.hh"#include "WM_api.hh"#include "DEG_depsgraph.hh"Go to the source code of this file.
Variables | |
| static ListBase | gpencil_anim_copybuf = {nullptr, nullptr} |
| static int | gpencil_anim_copy_firstframe = 999999999 |
| static int | gpencil_anim_copy_lastframe = -999999999 |
| static int | gpencil_anim_copy_cfra = 0 |
| bool ED_gpencil_anim_copybuf_copy | ( | bAnimContext * | ac | ) |
This function adds data to the copy/paste buffer, freeing existing data first Only the selected GP-layers get their selected keyframes copied.
Returns whether the copy operation was successful or not.
Definition at line 316 of file editaction_gpencil.cc.
References ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_LIST_VISIBLE, ANIMFILTER_NODUPLIS, ANIMTYPE_GPLAYER, BKE_gpencil_frame_duplicate(), BLI_addtail(), BLI_assert, BLI_listbase_is_empty(), BLI_movelisttolist(), bAnimContext::data, bAnimContext::datatype, ED_gpencil_anim_copybuf_free(), filter(), ListBase::first, bGPDlayer::frames, GP_FRAME_SELECT, gpencil_anim_copy_cfra, gpencil_anim_copy_firstframe, gpencil_anim_copy_lastframe, gpencil_anim_copybuf, bGPDlayer::info, LISTBASE_FOREACH, MEM_callocN, bAnimContext::scene, and STRNCPY.
Referenced by actkeys_copy_exec().
| void ED_gpencil_anim_copybuf_free | ( | ) |
This function frees any MEM_calloc'ed copy/paste buffer data.
Definition at line 306 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().
| bool ED_gpencil_anim_copybuf_paste | ( | bAnimContext * | ac, |
| short | offset_mode ) |
Pastes keyframes from buffer, and reports success.
Definition at line 384 of file editaction_gpencil.cc.
References ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FOREDIT, ANIMFILTER_LIST_VISIBLE, ANIMFILTER_NODUPLIS, ANIMFILTER_SEL, ANIMTYPE_GPLAYER, BKE_gpencil_layer_frame_delete(), BKE_gpencil_layer_frame_get(), BKE_gpencil_stroke_duplicate(), BLI_addtail(), BLI_listbase_is_empty(), bAnimContext::data, bAnimContext::datatype, DEG_id_tag_update(), filter(), ListBase::first, bGPDframe::framenum, bGPDlayer::frames, GP_GETFRAME_ADD_NEW, gpencil_anim_copy_cfra, gpencil_anim_copy_firstframe, gpencil_anim_copy_lastframe, gpencil_anim_copybuf, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, bGPDlayer::info, bGPDframe::key_type, KEYFRAME_PASTE_OFFSET_CFRA_END, KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE, KEYFRAME_PASTE_OFFSET_CFRA_START, KEYFRAME_PASTE_OFFSET_NONE, ListBase::last, LISTBASE_FOREACH, bGPDlayer::next, bAnimContext::scene, STREQ, and bGPDframe::strokes.
Referenced by actkeys_paste_exec().
| 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().
| 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().
| bool ED_gpencil_layer_frames_delete | ( | bGPDlayer * | gpl | ) |
Delete selected frames.
Definition at line 232 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().
| void ED_gpencil_layer_frames_duplicate | ( | bGPDlayer * | gpl | ) |
Duplicate selected frames from given gp-layer.
Definition at line 252 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().
| void ED_gpencil_layer_frames_keytype_set | ( | bGPDlayer * | gpl, |
| short | type ) |
Set keyframe type for selected frames from given gp-layer
| type | The type of keyframe (eBezTriple_KeyframeType) to set selected frames to. |
Definition at line 275 of file editaction_gpencil.cc.
References bGPDlayer::frames, GP_FRAME_SELECT, and LISTBASE_FOREACH.
Referenced by setkeytype_action_keys().
| 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().
| 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, and min.
Referenced by actkeys_select_leftright(), box_select_elem(), and markers_selectkeys_between().
| void ED_gpencil_layer_frames_select_region | ( | KeyframeEditData * | ked, |
| bGPDlayer * | gpl, | ||
| short | tool, | ||
| short | select_mode ) |
Select the frames in this layer that occur within the lasso/circle region specified.
Definition at line 183 of file editaction_gpencil.cc.
References BEZT_OK_CHANNEL_CIRCLE, BEZT_OK_CHANNEL_LASSO, KeyframeEditData::channel_y, KeyframeEditData::data, bGPDlayer::frames, gpencil_frame_select(), keyframe_region_circle_test(), keyframe_region_lasso_test(), and LISTBASE_FOREACH.
Referenced by region_select_elem().
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().
Mirror selected gp-frames on... TODO: mirror over a specific time.
Definition at line 634 of file editaction_gpencil.cc.
References ED_gpencil_layer_frames_looper(), gpencil_frame_mirror_cframe(), gpencil_frame_mirror_marker(), gpencil_frame_mirror_xaxis(), gpencil_frame_mirror_yaxis(), MIRROR_KEYS_CURFRAME, MIRROR_KEYS_MARKER, MIRROR_KEYS_XAXIS, and MIRROR_KEYS_YAXIS.
Referenced by mirror_action_keys().
Snap selected frames to ....
Definition at line 534 of file editaction_gpencil.cc.
References ED_gpencil_layer_frames_looper(), gpencil_frame_snap_cframe(), gpencil_frame_snap_nearest(), gpencil_frame_snap_nearestsec(), gpencil_frame_snap_nearmarker(), SNAP_KEYS_CURFRAME, SNAP_KEYS_NEARFRAME, SNAP_KEYS_NEARMARKER, and SNAP_KEYS_NEARSEC.
Referenced by snap_action_keys().
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().
| 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().
Set the layer's channel as active
Definition at line 217 of file editaction_gpencil.cc.
References BKE_gpencil_layer_active_get(), BKE_gpencil_layer_active_set(), BKE_gpencil_layer_autolock_set(), bGPDlayer::flag, GP_LAYER_SELECT, NA_EDITED, NC_GPENCIL, ND_DATA, and WM_main_add_notifier().
Referenced by mouse_action_keys().
Definition at line 557 of file editaction_gpencil.cc.
References diff(), bGPDframe::flag, bGPDframe::framenum, and GP_FRAME_SELECT.
Referenced by ED_gpencil_layer_mirror_frames().
Definition at line 594 of file editaction_gpencil.cc.
References diff(), ED_markers_get_first_selected(), bGPDframe::flag, TimeMarker::frame, bGPDframe::framenum, GP_FRAME_SELECT, and initialized.
Referenced by ED_gpencil_layer_mirror_frames().
Definition at line 581 of file editaction_gpencil.cc.
References diff(), bGPDframe::flag, bGPDframe::framenum, and GP_FRAME_SELECT.
Referenced by ED_gpencil_layer_mirror_frames().
Definition at line 569 of file editaction_gpencil.cc.
References diff(), bGPDframe::flag, bGPDframe::framenum, and GP_FRAME_SELECT.
Referenced by ED_gpencil_layer_mirror_frames().
|
static |
Definition at line 111 of file editaction_gpencil.cc.
References bGPDframe::flag, GP_FRAME_SELECT, SELECT_ADD, SELECT_INVERT, and SELECT_SUBTRACT.
Referenced by ED_gpencil_layer_frames_select_box(), ED_gpencil_layer_frames_select_region(), ED_gpencil_select_frame(), and ED_gpencil_select_frames().
Definition at line 517 of file editaction_gpencil.cc.
References bGPDframe::flag, bGPDframe::framenum, GP_FRAME_SELECT, and int.
Referenced by ED_gpencil_layer_snap_frames().
Definition at line 498 of file editaction_gpencil.cc.
References floor(), GP_FRAME_SELECT, and int.
Referenced by ED_gpencil_layer_snap_frames().
Definition at line 508 of file editaction_gpencil.cc.
References bGPDframe::flag, float, floorf, FPS, bGPDframe::framenum, GP_FRAME_SELECT, and int.
Referenced by ED_gpencil_layer_snap_frames().
Definition at line 525 of file editaction_gpencil.cc.
References ED_markers_find_nearest_marker_time(), bGPDframe::flag, bGPDframe::framenum, GP_FRAME_SELECT, and int.
Referenced by ED_gpencil_layer_snap_frames().
|
static |
Definition at line 304 of file editaction_gpencil.cc.
Referenced by ED_gpencil_anim_copybuf_copy(), ED_gpencil_anim_copybuf_free(), and ED_gpencil_anim_copybuf_paste().
|
static |
Definition at line 302 of file editaction_gpencil.cc.
Referenced by ED_gpencil_anim_copybuf_copy(), ED_gpencil_anim_copybuf_free(), and ED_gpencil_anim_copybuf_paste().
|
static |
Definition at line 303 of file editaction_gpencil.cc.
Referenced by ED_gpencil_anim_copybuf_copy(), ED_gpencil_anim_copybuf_free(), and ED_gpencil_anim_copybuf_paste().
|
static |
Definition at line 301 of file editaction_gpencil.cc.
Referenced by ED_gpencil_anim_copybuf_copy(), ED_gpencil_anim_copybuf_free(), and ED_gpencil_anim_copybuf_paste().