|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | tGPspoint |
Get the active Grease Pencil data-block
Definition at line 247 of file gpencil_utils.cc.
References 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().
Get the active Grease Pencil data-block, when context is not available.
Definition at line 232 of file gpencil_utils.cc.
References ED_annotation_data_get_pointers_direct().
Referenced by screen_ctx_active_annotation_layer(), and screen_ctx_annotation_data().
| bGPdata ** ED_annotation_data_get_pointers | ( | const bContext * | C, |
| PointerRNA * | r_ptr ) |
Get pointer to active Grease Pencil data-block, and an RNA-pointer to trace back to whatever owns it.
Definition at line 222 of file gpencil_utils.cc.
References CTX_data_scene(), CTX_wm_area(), CTX_wm_screen(), and ED_annotation_data_get_pointers_direct().
Referenced by annotation_draw_poll(), annotation_session_initdata(), ED_annotation_data_get_active(), gpencil_add_annotation_poll(), gpencil_data_add_exec(), gpencil_data_add_poll(), gpencil_data_unlink_exec(), gpencil_data_unlink_poll(), gpencil_layer_add_exec(), and gpencil_layer_remove_exec().
| bGPdata ** ED_annotation_data_get_pointers_direct | ( | ID * | screen_id, |
| ScrArea * | area, | ||
| Scene * | scene, | ||
| PointerRNA * | r_ptr ) |
Get pointer to active Grease Pencil data-block for annotations, and an RNA-pointer to trace back to whatever owns it, when context info is not available.
Definition at line 116 of file gpencil_utils.cc.
References MovieTrackingObject::active_track, BKE_tracking_object_get_active(), ED_space_clip_get_clip(), bNodeTree::gpd, MovieTrackingTrack::gpd, SpaceImage::gpd, SpaceSeq::gpd, SpaceClip::gpencil_src, bNodeTree::id, SpaceNode::nodetree, RNA_id_pointer_create(), RNA_pointer_create(), SC_GPENCIL_SRC_TRACK, SPACE_CLIP, SPACE_IMAGE, SPACE_INFO, SPACE_NODE, SPACE_PROPERTIES, SPACE_SEQ, SPACE_TOPBAR, and SPACE_VIEW3D.
Referenced by ED_annotation_data_get_active_direct(), ED_annotation_data_get_pointers(), and screen_ctx_annotation_data_owner().
| void ED_annotation_draw_2dimage | ( | const bContext * | C | ) |
Draw grease-pencil sketches to specified 2d-view that uses ibuf corrections.
Definition at line 785 of file annotate_draw.cc.
References annotation_draw_data_all(), CTX_data_scene(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), ED_annotation_data_get_active(), ED_screen_animation_playing(), GP_DRAWDATA_IEDITHACK, GP_DRAWDATA_NO_ONIONS, GP_DRAWDATA_NOSTATUS, GP_DRAWDATA_ONLYI2D, GP_DRAWDATA_ONLYV2D, SPACE_CLIP, SPACE_IMAGE, SPACE_SEQ, and wmOrtho2().
Referenced by clip_draw_grease_pencil(), and sequencer_draw_gpencil_overlay().
| void ED_annotation_draw_ex | ( | Scene * | scene, |
| bGPdata * | gpd, | ||
| int | winx, | ||
| int | winy, | ||
| int | cfra, | ||
| char | spacetype ) |
Definition at line 949 of file annotate_draw.cc.
References annotation_draw_data_all(), GP_DRAWDATA_NOSTATUS, and GP_DRAWDATA_ONLYV2D.
Referenced by screen_opengl_render_doit().
| 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.
Definition at line 854 of file annotate_draw.cc.
References annotation_draw_data_all(), 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, SPACE_CLIP, and SPACE_IMAGE.
Referenced by clip_draw_grease_pencil(), DRW_draw_render_loop_2d_ex(), blender::ed::space_node::node_draw_space(), and sequencer_draw_gpencil_overlay().
| 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 897 of file annotate_draw.cc.
References annotation_draw_data_all(), depsgraph, ED_view3d_calc_camera_border(), View3D::flag2, G, G_FLAG_RENDER_VIEWPORT, GP_DRAWDATA_NOSTATUS, GP_DRAWDATA_ONLY3D, RegionView3D::persp, round_fl_to_int(), RV3D_CAMOB, View3D::spacetype, V3D_HIDE_OVERLAYS, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by DRW_draw_callbacks_post_scene().
| 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().
Get the active Grease Pencil data-block
Definition at line 238 of file gpencil_utils.cc.
References CTX_data_active_object(), Object::data, OB_GPENCIL_LEGACY, and Object::type.
Referenced by gpencil_actframe_delete_exec(), gpencil_layer_move_exec(), gpencil_layer_remove_exec(), and viewRedrawForce().
| bGPdata ** ED_gpencil_data_get_pointers | ( | const bContext * | C, |
| PointerRNA * | r_ptr ) |
Get pointer to active Grease Pencil data-block, and an RNA-pointer to trace back to whatever owns it.
Definition at line 214 of file gpencil_utils.cc.
References CTX_data_active_object(), CTX_wm_area(), and ED_gpencil_data_get_pointers_direct().
Referenced by ED_undo_gpencil_step().
| bGPdata ** ED_gpencil_data_get_pointers_direct | ( | ScrArea * | area, |
| Object * | ob, | ||
| 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 87 of file gpencil_utils.cc.
References Object::data, Object::id, OB_GPENCIL_LEGACY, RNA_id_pointer_create(), SPACE_INFO, SPACE_PROPERTIES, SPACE_TOPBAR, SPACE_VIEW3D, and Object::type.
Referenced by ED_gpencil_data_get_pointers().
| bool ED_gpencil_data_owner_is_annotation | ( | PointerRNA * | owner_ptr | ) |
Utility to check whether the r_ptr output of ED_gpencil_data_get_pointers() is for annotation usage.
Definition at line 255 of file gpencil_utils.cc.
References PointerRNA::type.
Referenced by annotation_session_initdata().
| void ED_gpencil_drawing_reference_get | ( | const Scene * | scene, |
| const Object * | ob, | ||
| char | align_flag, | ||
| float | r_vec[3] ) |
Get drawing reference point for conversion or projection of the stroke
| r_vec | Reference point found |
Definition at line 374 of file gpencil_utils.cc.
References add_v3_v3(), BKE_gpencil_layer_active_get(), copy_v3_v3(), Object::data, GP_PROJECT_CURSOR, GP_PROJECT_VIEWSPACE, bGPDlayer::layer_mat, OB_GPENCIL_LEGACY, and Object::type.
| 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().
| 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 453 of file gpencil_utils.cc.
References clear(), GP_STROKE_BUFFER_CHUNK, MEM_callocN, and MEM_recallocN.
Referenced by annotation_session_validatebuffer(), and annotation_stroke_addpoint().
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().
| int ED_gpencil_session_active | ( | ) |
Definition at line 44 of file gpencil_undo.cc.
References BLI_listbase_is_empty(), and undo_nodes.
Referenced by annotation_draw_data_layers(), annotation_draw_poll(), annotation_session_initdata(), ed_undo_step_by_index(), ed_undo_step_by_name(), ed_undo_step_direction(), and SCULPT_mode_poll_view3d().
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().
| bool ED_gpencil_stroke_can_use | ( | const bContext * | C, |
| const bGPDstroke * | gps ) |
Check whether given stroke can be edited in the current context
Definition at line 306 of file gpencil_utils.cc.
References CTX_wm_area(), and ED_gpencil_stroke_can_use_direct().
Referenced by createTransGPencil_curves(), and createTransGPencil_strokes().
| 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 282 of file gpencil_utils.cc.
References ELEM, bGPDstroke::flag, GP_STROKE_2DIMAGE, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, SPACE_IMAGE, SPACE_PROPERTIES, and SPACE_VIEW3D.
Referenced by annotation_stroke_doeraser(), and ED_gpencil_stroke_can_use().
| bool ED_gpencil_stroke_material_editable | ( | Object * | ob, |
| const bGPDlayer * | gpl, | ||
| const bGPDstroke * | gps ) |
Check whether given stroke can be edited for the current color
Definition at line 312 of file gpencil_utils.cc.
References BKE_gpencil_material_settings(), bGPDlayer::flag, MaterialGPencilStyle::flag, GP_LAYER_UNLOCK_COLOR, GP_MATERIAL_HIDE, GP_MATERIAL_LOCKED, and bGPDstroke::mat_nr.
Referenced by createTransGPencil_curves(), and createTransGPencil_strokes().
| void ED_gpencil_strokes_copybuf_free | ( | ) |
Free copy/paste buffer data.
Definition at line 101 of file gpencil_edit.cc.
References BKE_gpencil_free_stroke_weights(), BLI_freelinkN(), BLI_ghash_free(), bGPDstroke::dvert, ListBase::first, gpencil_strokes_copypastebuf, gpencil_strokes_copypastebuf_colors, ListBase::last, MEM_freeN(), MEM_SAFE_FREE, bGPDstroke::next, bGPDstroke::points, and bGPDstroke::triangles.
Referenced by WM_exit_ex().
| void ED_gpencil_tpoint_to_point | ( | ARegion * | region, |
| float | origin[3], | ||
| const tGPspoint * | tpt, | ||
| bGPDspoint * | pt ) |
Convert 2d tGPspoint to 3d bGPDspoint.
Definition at line 436 of file gpencil_utils.cc.
References copy_v3_v3(), gpencil_stroke_convertcoords(), bGPDspoint::pressure, tGPspoint::pressure, bGPDspoint::strength, tGPspoint::strength, bGPDspoint::uv_fac, tGPspoint::uv_fac, bGPDspoint::uv_rot, tGPspoint::uv_rot, bGPDspoint::vert_color, bGPDspoint::x, and zero_v4().
| void ED_keymap_gpencil_legacy | ( | wmKeyConfig * | keyconf | ) |
Definition at line 34 of file gpencil_ops.cc.
References RGN_TYPE_WINDOW, SPACE_EMPTY, and WM_keymap_ensure().
Referenced by ED_spacetypes_keymap().
| void ED_operatortypes_gpencil_legacy | ( | ) |
Definition at line 39 of file gpencil_ops.cc.
References GPENCIL_OT_annotate(), GPENCIL_OT_annotation_active_frame_delete(), GPENCIL_OT_annotation_add(), GPENCIL_OT_data_unlink(), GPENCIL_OT_layer_annotation_add(), GPENCIL_OT_layer_annotation_move(), GPENCIL_OT_layer_annotation_remove(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
| step | eUndoStepDir. |
Definition at line 49 of file gpencil_undo.cc.
References BKE_gpencil_free_layers(), BKE_gpencil_layer_duplicate(), BLI_addtail(), BLI_listbase_clear(), cur_node, DEG_id_tag_update(), ED_gpencil_data_get_pointers(), GP_DATA_CACHE_IS_DIRTY, bGPundonode::gpd, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, bGPdata::layers, LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, bGPundonode::next, OPERATOR_FINISHED, bGPundonode::prev, STEP_REDO, STEP_UNDO, and WM_event_add_notifier().
Referenced by ed_undo_step_direction().