|
Blender V4.3
|
#include <cmath>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_time.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_callbacks.hh"#include "BKE_context.hh"#include "BKE_gpencil_geom_legacy.h"#include "BKE_gpencil_legacy.h"#include "BKE_report.hh"#include "BKE_screen.hh"#include "BKE_tracking.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_windowmanager_types.h"#include "UI_view2d.hh"#include "ED_clip.hh"#include "ED_gpencil_legacy.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "GPU_immediate.hh"#include "GPU_immediate_util.hh"#include "GPU_state.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "RNA_prototypes.hh"#include "WM_api.hh"#include "WM_types.hh"#include "gpencil_intern.hh"Go to the source code of this file.
Classes | |
| struct | tGPsdata |
Macros | |
| #define | DEPTH_INVALID 1.0f |
| #define | MIN_MANHATTAN_PX (U.gp_manhattandist) |
| #define | MIN_EUCLIDEAN_PX (U.gp_euclideandist) |
Enumerations | |
| enum | eGPencil_PaintStatus { GP_STATUS_IDLING = 0 , GP_STATUS_PAINTING , GP_STATUS_ERROR , GP_STATUS_DONE , GP_STATUS_CAPTURE } |
| enum | eGP_StrokeAdd_Result { GP_STROKEADD_INVALID = -2 , GP_STROKEADD_OVERFLOW = -1 , GP_STROKEADD_NORMAL , GP_STROKEADD_FULL } |
| enum | eGPencil_PaintFlags { GP_PAINTFLAG_FIRSTRUN = (1 << 0) , GP_PAINTFLAG_STROKEADDED = (1 << 1) , GP_PAINTFLAG_V3D_ERASER_DEPTH = (1 << 2) , GP_PAINTFLAG_SELECTMASK = (1 << 3) , GP_PAINTFLAG_USE_STABILIZER = (1 << 7) , GP_PAINTFLAG_USE_STABILIZER_TEMP = (1 << 8) } |
Variables | |
| static const EnumPropertyItem | prop_gpencil_drawmodes [] |
| static const EnumPropertyItem | arrow_types [] |
| #define DEPTH_INVALID 1.0f |
Definition at line 59 of file annotate_paint.cc.
Referenced by annotation_stroke_convertcoords(), and annotation_stroke_newfrombuffer().
| #define MIN_EUCLIDEAN_PX (U.gp_euclideandist) |
Definition at line 189 of file annotate_paint.cc.
Referenced by annotation_stroke_filtermval().
| #define MIN_MANHATTAN_PX (U.gp_manhattandist) |
Definition at line 187 of file annotate_paint.cc.
Referenced by annotation_stroke_filtermval().
| enum eGP_StrokeAdd_Result |
| Enumerator | |
|---|---|
| GP_STROKEADD_INVALID | |
| GP_STROKEADD_OVERFLOW | |
| GP_STROKEADD_NORMAL | |
| GP_STROKEADD_FULL | |
Definition at line 71 of file annotate_paint.cc.
| enum eGPencil_PaintFlags |
| Enumerator | |
|---|---|
| GP_PAINTFLAG_FIRSTRUN | |
| GP_PAINTFLAG_STROKEADDED | |
| GP_PAINTFLAG_V3D_ERASER_DEPTH | |
| GP_PAINTFLAG_SELECTMASK | |
| GP_PAINTFLAG_USE_STABILIZER | |
| GP_PAINTFLAG_USE_STABILIZER_TEMP | |
Definition at line 79 of file annotate_paint.cc.
| enum eGPencil_PaintStatus |
| Enumerator | |
|---|---|
| GP_STATUS_IDLING | |
| GP_STATUS_PAINTING | |
| GP_STATUS_ERROR | |
| GP_STATUS_DONE | |
| GP_STATUS_CAPTURE | |
Definition at line 62 of file annotate_paint.cc.
|
static |
Definition at line 2427 of file annotate_paint.cc.
References annotation_draw_apply_event(), b, copy_v2_v2(), CTX_data_ensure_evaluated_depsgraph(), depsgraph, float, int, interp_v2_v2v2(), len_v2v2(), wmEvent::mval, tGPsdata::mvalo, and sub_v2_v2v2().
Referenced by annotation_draw_modal().
Definition at line 2374 of file annotate_paint.cc.
References BLI_findindex(), and CTX_wm_screen().
Referenced by annotation_draw_modal().
|
static |
Definition at line 779 of file annotate_paint.cc.
References annotation_arrow_create_closed(), annotation_arrow_create_open(), annotation_arrow_create_segm(), annotation_arrow_create_square(), BLI_addtail(), copy_v3_v3(), GP_STROKE_ARROWSTYLE_CLOSED, GP_STROKE_ARROWSTYLE_OPEN, GP_STROKE_ARROWSTYLE_SEGMENT, GP_STROKE_ARROWSTYLE_SQUARE, tGPsdata::gpf, bGPDframe::strokes, and bGPDspoint::x.
Referenced by annotation_stroke_newfrombuffer().
|
static |
Definition at line 746 of file annotate_paint.cc.
References annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 723 of file annotate_paint.cc.
References annotation_stroke_arrow_init_conv_point(), and annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 736 of file annotate_paint.cc.
References annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 760 of file annotate_paint.cc.
References annotation_stroke_arrow_init_conv_point(), and annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 2020 of file annotate_paint.cc.
References annotation_paint_initstroke(), annotation_paint_strokeend(), annotation_stroke_addpoint(), annotation_stroke_doeraser(), annotation_stroke_filtermval(), BKE_report(), copy_v2_v2(), tGPsdata::curtime, depsgraph, ELEM, tGPsdata::flags, GP_PAINTFLAG_USE_STABILIZER_TEMP, GP_PAINTMODE_ERASER, GP_STATUS_ERROR, GP_STROKEADD_FULL, GP_STROKEADD_INVALID, GP_STROKEADD_OVERFLOW, tGPsdata::inittime, interp_v2_v2v2(), min_ff(), tGPsdata::mval, tGPsdata::mvalo, tGPsdata::ocurtime, tGPsdata::opressure, tGPsdata::paintmode, tGPsdata::pressure, wmOperator::reports, RPT_ERROR, tGPsdata::stabilizer_factor, and tGPsdata::status.
Referenced by annotation_draw_apply_event(), and annotation_draw_exec().
|
static |
Definition at line 2082 of file annotate_paint.cc.
References abs(), wmTabletData::active, annotation_draw_apply(), annotation_draw_toggle_stabilizer_cursor(), BLI_time_now_seconds(), tGPsdata::curtime, wmOperator::customdata, depsgraph, ED_region_tag_redraw(), EVT_TABLET_ERASER, EVT_TABLET_NONE, tGPsdata::flags, float, GP_PAINTFLAG_FIRSTRUN, GP_PAINTFLAG_USE_STABILIZER, GP_PAINTFLAG_USE_STABILIZER_TEMP, GP_PAINTMODE_DRAW, GP_PAINTMODE_ERASER, tGPsdata::inittime, KM_ALT, KM_CTRL, KM_SHIFT, wmEvent::modifier, tGPsdata::mval, wmEvent::mval, tGPsdata::mvalo, tGPsdata::ocurtime, tGPsdata::opressure, tGPsdata::paintmode, tGPsdata::pressure, wmOperator::ptr, tGPsdata::region, RNA_boolean_set(), RNA_collection_add(), RNA_float_set(), RNA_float_set_array(), tGPsdata::straight, wmEvent::tablet, WM_event_drag_start_mval_fl(), x, and y.
Referenced by annotation_add_missing_events(), annotation_draw_invoke(), and annotation_draw_modal().
|
static |
Definition at line 1902 of file annotate_paint.cc.
References annotation_draw_exit().
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 1944 of file annotate_paint.cc.
References GP_PAINTMODE_ERASER, tGPsdata::paintmode, tGPsdata::win, WM_CURSOR_ERASER, WM_cursor_modal_set(), and WM_CURSOR_PAINT_BRUSH.
Referenced by annotation_draw_invoke(), and annotation_draw_modal().
Definition at line 1735 of file annotate_paint.cc.
References GP_PAINTMODE_ERASER, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_circle_fill_2d(), imm_draw_circle_wire_2d(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor4f(), immUniformColor4ub(), immVertexFormat(), max_ii(), tGPsdata::paintmode, and tGPsdata::radius.
Referenced by annotation_draw_toggle_eraser_cursor().
|
static |
Definition at line 2227 of file annotate_paint.cc.
References annotation_draw_apply(), annotation_draw_exit(), annotation_draw_init(), annotation_paint_initstroke(), annotation_paint_strokeend(), CTX_data_ensure_evaluated_depsgraph(), tGPsdata::curtime, wmOperator::customdata, depsgraph, double(), tGPsdata::flags, GP_PAINTFLAG_FIRSTRUN, tGPsdata::inittime, int, MEM_freeN(), tGPsdata::mval, tGPsdata::mvalo, NA_EDITED, NC_GPENCIL, tGPsdata::ocurtime, OPERATOR_CANCELLED, OPERATOR_FINISHED, tGPsdata::opressure, tGPsdata::paintmode, tGPsdata::pressure, wmOperator::ptr, RNA_BEGIN, RNA_boolean_get(), RNA_END, RNA_float_get(), RNA_float_get_array(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 1865 of file annotate_paint.cc.
References annotation_draw_toggle_eraser_cursor(), annotation_draw_toggle_stabilizer_cursor(), annotation_paint_cleanup(), annotation_session_cleanup(), annotation_session_free(), CTX_wm_window(), wmOperator::customdata, GP_PAINTMODE_DRAW, GP_PAINTMODE_ERASER, gpencil_undo_finish(), tGPsdata::paintmode, tGPsdata::radius, and WM_cursor_modal_restore().
Referenced by annotation_draw_cancel(), annotation_draw_exec(), annotation_draw_init(), annotation_draw_invoke(), and annotation_draw_modal().
|
static |
Definition at line 1910 of file annotate_paint.cc.
References annotation_draw_exit(), annotation_paint_initstroke(), annotation_session_initpaint(), CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, GP_STATUS_ERROR, tGPsdata::keymodifier, wmOperator::ptr, RNA_enum_get(), and tGPsdata::status.
Referenced by annotation_draw_exec(), and annotation_draw_invoke().
|
static |
Definition at line 2294 of file annotate_paint.cc.
References annotation_draw_apply_event(), annotation_draw_cursor_set(), annotation_draw_exit(), annotation_draw_init(), annotation_draw_toggle_eraser_cursor(), annotation_draw_toggle_stabilizer_cursor(), annotation_is_tablet_eraser_active(), bGPdata_Runtime::arrow_end_style, bGPdata_Runtime::arrow_start_style, BKE_report(), CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, wmOperator::flag, tGPsdata::flags, GP_PAINTFLAG_USE_STABILIZER, GP_PAINTFLAG_USE_STABILIZER_TEMP, GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_STRAIGHT, GP_PAINTMODE_ERASER, GP_STATUS_CAPTURE, GP_STATUS_PAINTING, GP_STROKE_ARROWSTYLE_NONE, GP_STROKE_USE_ARROW_END, GP_STROKE_USE_ARROW_START, tGPsdata::gpd, KM_SHIFT, MEM_freeN(), wmEvent::modifier, NA_EDITED, NC_GPENCIL, OP_IS_MODAL_CURSOR_REGION, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, tGPsdata::paintmode, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_enum_get(), RNA_enum_set(), RNA_float_get(), RNA_int_get(), RPT_ERROR, bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, tGPsdata::stabilizer_factor, tGPsdata::stabilizer_radius, tGPsdata::status, WM_event_add_modal_handler(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 2463 of file annotate_paint.cc.
References annotation_add_missing_events(), annotation_area_exists(), annotation_draw_apply_event(), annotation_draw_cursor_set(), annotation_draw_exit(), annotation_draw_status_indicators(), annotation_draw_toggle_eraser_cursor(), annotation_is_tablet_eraser_active(), annotation_stroke_begin(), annotation_stroke_end(), tGPsdata::area, BKE_area_find_region_xy(), BLI_rcti_isect_pt_v(), CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw(), ED_region_visible_rect(), ELEM, EVT_BKEY, EVT_DOWNARROWKEY, EVT_EKEY, EVT_ESCKEY, EVT_LEFTARROWKEY, EVT_PAD0, EVT_PAD1, EVT_PAD2, EVT_PAD3, EVT_PAD4, EVT_PAD5, EVT_PAD6, EVT_PAD7, EVT_PAD8, EVT_PAD9, EVT_PADENTER, EVT_PADMINUS, EVT_PADPLUSKEY, EVT_RETKEY, EVT_RIGHTARROWKEY, EVT_SPACEKEY, EVT_UPARROWKEY, EVT_ZKEY, wmOperator::flag, tGPsdata::flags, GP_PAINTFLAG_FIRSTRUN, GP_PAINTMODE_DRAW_POLY, GP_PAINTMODE_ERASER, GP_STATUS_DONE, GP_STATUS_ERROR, GP_STATUS_IDLING, GP_STATUS_PAINTING, ISKEYBOARD, ISMOUSE_BUTTON, ISMOUSE_MOTION, KM_PRESS, KM_RELEASE, wmEvent::mval, NA_EDITED, NC_GPENCIL, NDOF_MOTION, OP_IS_MODAL_CURSOR_REGION, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, tGPsdata::paintmode, printf, wmOperator::ptr, tGPsdata::radius, tGPsdata::region, ARegion::regiontype, RGN_TYPE_ANY, RGN_TYPE_TOOLS, RIGHTMOUSE, RNA_enum_get(), tGPsdata::status, wmEvent::type, wmEvent::val, WHEELDOWNMOUSE, WHEELUPMOUSE, WM_event_add_notifier(), WM_OP_EXEC_DEFAULT, WM_operator_name_call(), and wmEvent::xy.
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 211 of file annotate_paint.cc.
References CTX_wm_operator_poll_msg_set(), ED_annotation_data_get_pointers(), ED_gpencil_session_active(), and ED_operator_regionactive().
Referenced by GPENCIL_OT_annotate().
Definition at line 1795 of file annotate_paint.cc.
References CTX_wm_region(), tGPsdata::gpd, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), imm_draw_circle_wire_2d(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4f(), immVertex2f(), immVertexFormat(), tGPspoint::m_xy, mul_v3_v3fl(), pos, bGPdata::runtime, bGPdata_Runtime::sbuffer, and bGPdata_Runtime::sbuffer_used.
Referenced by annotation_draw_toggle_stabilizer_cursor().
Definition at line 1955 of file annotate_paint.cc.
References ED_workspace_status_text(), GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_POLY, GP_PAINTMODE_DRAW_STRAIGHT, GP_PAINTMODE_ERASER, GP_STATUS_CAPTURE, GP_STATUS_DONE, GP_STATUS_ERROR, GP_STATUS_IDLING, GP_STATUS_PAINTING, IFACE_, tGPsdata::paintmode, and tGPsdata::status.
Referenced by annotation_draw_modal().
|
static |
Definition at line 1779 of file annotate_paint.cc.
References annotation_draw_eraser(), tGPsdata::erasercursor, RGN_TYPE_ANY, SPACE_TYPE_ANY, WM_paint_cursor_activate(), and WM_paint_cursor_end().
Referenced by annotation_draw_exit(), annotation_draw_invoke(), and annotation_draw_modal().
|
static |
Definition at line 1843 of file annotate_paint.cc.
References annotation_draw_stabilizer(), RGN_TYPE_ANY, SPACE_TYPE_ANY, tGPsdata::stabilizer_cursor, WM_paint_cursor_activate(), and WM_paint_cursor_end().
Referenced by annotation_draw_apply_event(), annotation_draw_exit(), and annotation_draw_invoke().
|
static |
Definition at line 1069 of file annotate_paint.cc.
References BKE_gpencil_free_stroke_weights(), BLI_freelinkN(), bGPDstroke::dvert, MEM_freeN(), bGPDstroke::points, bGPDframe::strokes, and bGPDstroke::triangles.
Referenced by annotation_stroke_eraser_dostroke().
Definition at line 247 of file annotate_paint.cc.
References copy_v3_v3(), Scene::cursor, View3DCursor::location, and tGPsdata::scene.
Referenced by annotation_stroke_convertcoords().
|
static |
Definition at line 1858 of file annotate_paint.cc.
References wmTabletData::active, EVT_TABLET_ERASER, and wmEvent::tablet.
Referenced by annotation_draw_invoke(), and annotation_draw_modal().
|
static |
Definition at line 1716 of file annotate_paint.cc.
References annotation_paint_strokeend(), bGPDframe::flag, tGPsdata::gpd, and tGPsdata::gpf.
Referenced by annotation_draw_exit(), and annotation_stroke_end().
|
static |
Definition at line 1528 of file annotate_paint.cc.
References bGPDlayer::actframe, tGPsdata::align_flag, GP_SpaceConversion::area, tGPsdata::area, BKE_callback_exec_id_depsgraph(), BKE_CB_EVT_ANNOTATION_PRE, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_addnew(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_is_editable(), tGPsdata::bmain, bGPDlayer::color, copy_m4_m4(), copy_v3_v3(), tGPsdata::custom_color, DATA_, depsgraph, tGPsdata::depsgraph, ED_view3d_calc_camera_border(), ListBase::first, bGPdata::flag, bGPDframe::flag, bGPDlayer::flag, tGPsdata::flags, GP_DATA_ANNOTATIONS, GP_FRAME_PAINT, GP_GETFRAME_ADD_COPY, GP_GETFRAME_ADD_NEW, GP_LAYER_LOCKED, GP_LAYER_NO_XRAY, GP_PAINTFLAG_FIRSTRUN, GP_PAINTFLAG_V3D_ERASER_DEPTH, GP_PAINTMODE_ERASER, GP_PROJECT_VIEWSPACE, GP_STATUS_CAPTURE, GP_STATUS_ERROR, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, GP_STROKE_ERASER, GP_TOOL_FLAG_RETAIN_LAST, GP_SpaceConversion::gpd, tGPsdata::gpd, ToolSettings::gpencil_flags, tGPsdata::gpf, GP_SpaceConversion::gpl, tGPsdata::gpl, tGPsdata::gsc, bGPdata::id, GP_SpaceConversion::mat, tGPsdata::mat, tGPsdata::paintmode, RegionView3D::persp, printf, GP_SpaceConversion::region, tGPsdata::region, ARegion::regiondata, bGPdata::runtime, RV3D_CAMOB, bGPdata_Runtime::sbuffer_sflag, tGPsdata::scene, SPACE_CLIP, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, tGPsdata::status, bGPDframe::strokes, GP_SpaceConversion::subrect, tGPsdata::subrect, GP_SpaceConversion::subrect_data, tGPsdata::subrect_data, GP_SpaceConversion::v2d, and tGPsdata::v2d.
Referenced by annotation_draw_apply(), annotation_draw_exec(), annotation_draw_init(), and annotation_stroke_begin().
|
static |
Definition at line 1676 of file annotate_paint.cc.
References ToolSettings::annotate_v3d_align, annotation_project_check(), annotation_session_validatebuffer(), annotation_stroke_newfrombuffer(), tGPsdata::area, BKE_callback_exec_id_depsgraph(), BKE_CB_EVT_ANNOTATION_POST, tGPsdata::bmain, tGPsdata::depsgraph, tGPsdata::depths, ED_view3d_depth_override(), ListBase::first, GP_PROJECT_DEPTH_ONLY_SELECTED, GP_PROJECT_DEPTH_VIEW, GP_STROKE_ERASER, tGPsdata::gpd, bGPdata::id, tGPsdata::region, bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, tGPsdata::scene, ScrArea::spacedata, Scene::toolsettings, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_OVERLAYS, V3D_DEPTH_SELECTED_ONLY, view3d_region_operator_needs_opengl(), and tGPsdata::win.
Referenced by annotation_draw_apply(), annotation_draw_exec(), and annotation_paint_cleanup().
|
static |
Definition at line 234 of file annotate_paint.cc.
References tGPsdata::align_flag, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_VIEW, GP_STROKE_3DSPACE, tGPsdata::gpd, bGPdata::runtime, and bGPdata_Runtime::sbuffer_sflag.
Referenced by annotation_paint_strokeend(), annotation_stroke_addpoint(), annotation_stroke_convertcoords(), and annotation_stroke_newfrombuffer().
|
static |
Definition at line 1497 of file annotate_paint.cc.
References tGPsdata::gpd, tGPsdata::inittime, MEM_freeN(), bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, and bGPdata_Runtime::sbuffer_used.
Referenced by annotation_draw_exit(), and annotation_stroke_end().
|
static |
Definition at line 1519 of file annotate_paint.cc.
References tGPsdata::depths, ED_view3d_depths_free(), and MEM_freeN().
Referenced by annotation_draw_exit().
Definition at line 1268 of file annotate_paint.cc.
References MovieTrackingObject::active_track, tGPsdata::align_flag, ToolSettings::annotate_v3d_align, annotation_session_validatebuffer(), tGPsdata::area, BKE_gpencil_data_addnew(), BKE_tracking_marker_get(), BKE_tracking_object_get_active(), tGPsdata::bmain, copy_m4_m4(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), tGPsdata::custom_color, tGPsdata::depsgraph, ED_annotation_data_get_pointers(), ED_gpencil_data_owner_is_annotation(), ED_gpencil_session_active(), ED_space_clip_get_clip(), ED_space_clip_get_clip_frame_number(), ListBase::first, bGPdata::flag, GP_DATA_ANNOTATIONS, GP_STATUS_ERROR, tGPsdata::gpd, SpaceClip::gpencil_src, gpencil_undo_init(), ToolSettings::gpencil_v2d_align, tGPsdata::gsc, tGPsdata::imat, invert_m4_m4(), SpaceSeq::mainb, GP_SpaceConversion::mat, tGPsdata::mat, tGPsdata::ownerPtr, MovieTrackingMarker::pos, tGPsdata::region, RGN_TYPE_PREVIEW, SC_GPENCIL_SRC_TRACK, tGPsdata::scene, SEQ_DRAW_IMG_IMBUF, SPACE_CLIP, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, tGPsdata::status, SpaceClip::unistabmat, unit_m4(), tGPsdata::v2d, and tGPsdata::win.
Referenced by annotation_session_initpaint(), and annotation_stroke_begin().
Definition at line 1464 of file annotate_paint.cc.
References annotation_session_initdata(), annotation_visible_on_space(), MEM_callocN, MEM_freeN(), and tGPsdata::radius.
Referenced by annotation_draw_init().
|
static |
Definition at line 1251 of file annotate_paint.cc.
References ED_gpencil_sbuffer_ensure(), tGPsdata::gpd, tGPsdata::inittime, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, and bGPdata_Runtime::sbuffer_used.
Referenced by annotation_paint_strokeend(), and annotation_session_initdata().
Apply smooth to buffer while drawing to smooth point C, use 2 before (A, B) and current point (D):
A----B-----C------D
| p | Temp data |
| inf | Influence factor |
| idx | Index of the last point (need minimum 3 points in the array) |
Definition at line 383 of file annotate_paint.cc.
References b, copy_v2_v2(), tGPsdata::gpd, interp_v2_v2v2(), tGPspoint::m_xy, madd_v2_v2fl(), bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_used, and steps.
Referenced by annotation_stroke_addpoint().
|
static |
Definition at line 191 of file annotate_paint.cc.
References tGPsdata::flags, GP_PAINTFLAG_STROKEADDED, tGPsdata::gpf, ListBase::last, and bGPDframe::strokes.
Referenced by annotation_stroke_addpoint(), and annotation_stroke_newfrombuffer().
|
static |
Definition at line 196 of file annotate_paint.cc.
References BLI_assert, tGPsdata::flags, GP_PAINTFLAG_STROKEADDED, tGPsdata::gpf, ListBase::last, and bGPDframe::strokes.
Referenced by annotation_stroke_newfrombuffer().
|
static |
Definition at line 511 of file annotate_paint.cc.
References ToolSettings::annotate_v3d_align, annotation_project_check(), annotation_smooth_buffer(), annotation_stroke_added_check(), annotation_stroke_arrow_calc_points(), annotation_stroke_convertcoords(), tGPsdata::area, bGPdata_Runtime::arrow_end, bGPdata_Runtime::arrow_end_style, bGPdata_Runtime::arrow_start, bGPdata_Runtime::arrow_start_style, copy_v2_v2(), tGPsdata::depsgraph, ED_gpencil_sbuffer_ensure(), ED_view3d_depth_override(), ListBase::first, tGPsdata::flags, float, GP_PAINTFLAG_USE_STABILIZER_TEMP, GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_POLY, GP_PAINTMODE_DRAW_STRAIGHT, GP_PROJECT_DEPTH_ONLY_SELECTED, GP_PROJECT_DEPTH_VIEW, GP_STROKE_USE_ARROW_END, GP_STROKE_USE_ARROW_START, GP_STROKEADD_INVALID, GP_STROKEADD_NORMAL, tGPsdata::gpd, tGPsdata::gpf, tGPsdata::inittime, ListBase::last, tGPspoint::m_xy, MEM_reallocN, tGPsdata::paintmode, bGPDstroke::points, bGPDspoint::pressure, tGPspoint::pressure, tGPsdata::region, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, ScrArea::spacedata, bGPDspoint::strength, tGPspoint::strength, bGPDframe::strokes, bGPDspoint::time, tGPspoint::time, Scene::toolsettings, bGPDstroke::tot_triangles, bGPDstroke::totpoints, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_OVERLAYS, V3D_DEPTH_SELECTED_ONLY, view3d_region_operator_needs_opengl(), tGPsdata::win, and bGPDspoint::x.
Referenced by annotation_draw_apply().
|
static |
Definition at line 714 of file annotate_paint.cc.
References MEM_callocN, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by annotation_stroke_newfrombuffer().
|
static |
Definition at line 444 of file annotate_paint.cc.
References add_v2_v2(), annotation_stroke_arrow_calc_points_segment(), copy_v2_v2(), GP_STROKE_ARROWSTYLE_CLOSED, GP_STROKE_ARROWSTYLE_OPEN, GP_STROKE_ARROWSTYLE_SEGMENT, GP_STROKE_ARROWSTYLE_SQUARE, mul_v2_fl(), and normalize_v2().
Referenced by annotation_stroke_addpoint().
|
static |
Definition at line 431 of file annotate_paint.cc.
Referenced by annotation_stroke_arrow_calc_points().
|
static |
Definition at line 698 of file annotate_paint.cc.
References annotation_stroke_arrow_init_point_default(), copy_v3_v3(), and bGPDspoint::x.
Referenced by annotation_arrow_create_open(), and annotation_arrow_create_square().
|
static |
Definition at line 704 of file annotate_paint.cc.
References annotation_stroke_arrow_init_point_default(), annotation_stroke_convertcoords(), copy_v2_v2(), tGPspoint::m_xy, and bGPDspoint::x.
Referenced by annotation_arrow_create_closed(), annotation_arrow_create_open(), annotation_arrow_create_segm(), and annotation_arrow_create_square().
|
static |
Definition at line 691 of file annotate_paint.cc.
References bGPDspoint::pressure, bGPDspoint::strength, and bGPDspoint::time.
Referenced by annotation_stroke_arrow_init_conv_point(), annotation_stroke_arrow_init_point(), and annotation_stroke_newfrombuffer().
|
static |
Definition at line 2380 of file annotate_paint.cc.
References annotation_paint_initstroke(), annotation_session_initdata(), tGPsdata::area, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), wmOperator::customdata, wmOperator::flag, GP_STATUS_ERROR, GP_STATUS_PAINTING, tGPsdata::paintmode, printf, and tGPsdata::status.
Referenced by annotation_draw_modal().
|
static |
Definition at line 302 of file annotate_paint.cc.
References annotation_get_3d_reference(), annotation_project_check(), BLI_rctf_size_x(), BLI_rctf_size_y(), DEPTH_INVALID, ED_view3d_autodist_simple(), ED_view3d_calc_zfac(), ED_view3d_project_float_global(), ED_view3d_win_to_delta(), float, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, tGPsdata::gpd, tGPsdata::imat, mul_v3_m4v3(), tGPsdata::region, ARegion::regiondata, round_v2i_v2fl(), bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, sub_v2_v2v2(), sub_v3_v3v3(), tGPsdata::subrect, UI_view2d_region_to_view(), tGPsdata::v2d, V3D_PROJ_RET_OK, V3D_PROJ_TEST_NOP, ARegion::winx, ARegion::winy, rctf::xmin, rctf::ymin, and zero_v3().
Referenced by annotation_stroke_addpoint(), annotation_stroke_arrow_init_point(), and annotation_stroke_newfrombuffer().
|
static |
Definition at line 1212 of file annotate_paint.cc.
References annotation_stroke_eraser_dostroke(), tGPsdata::area, tGPsdata::depsgraph, tGPsdata::depths, ED_gpencil_stroke_can_use_direct(), ED_view3d_depth_override(), ListBase::first, tGPsdata::flags, GP_PAINTFLAG_V3D_ERASER_DEPTH, tGPsdata::gpf, tGPsdata::mval, bGPDstroke::next, tGPsdata::radius, tGPsdata::region, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, bGPDframe::strokes, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), tGPsdata::win, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by annotation_draw_apply().
|
static |
Definition at line 2408 of file annotate_paint.cc.
References annotation_paint_cleanup(), annotation_session_cleanup(), wmOperator::customdata, wmOperator::flag, GP_STATUS_IDLING, tGPsdata::gpd, gpencil_undo_push(), tGPsdata::gpf, tGPsdata::gpl, OP_IS_MODAL_CURSOR_REGION, and tGPsdata::status.
Referenced by annotation_draw_modal().
|
static |
Definition at line 1114 of file annotate_paint.cc.
References annotation_free_stroke(), annotation_stroke_eraser_is_occluded(), BKE_gpencil_stroke_delete_tagged_points(), BLI_rcti_isect_pt(), ELEM, bGPDspoint::flag, tGPsdata::flags, GP_PAINTFLAG_SELECTMASK, GP_SPOINT_SELECT, GP_SPOINT_TAG, tGPsdata::gpd, gpencil_point_to_xy(), gpencil_stroke_inside_circle(), tGPsdata::gsc, len_v2v2_int(), bGPDstroke::next, bGPDstroke::points, round_v2i_v2fl(), bGPDstroke::totpoints, and V2D_IS_CLIPPED.
Referenced by annotation_stroke_doeraser().
|
static |
Definition at line 1088 of file annotate_paint.cc.
References tGPsdata::area, tGPsdata::depths, ED_view3d_calc_depth_for_comparison(), ED_view3d_depth_read_cached(), ED_view3d_depth_unproject_v3(), tGPsdata::flags, GP_PAINTFLAG_V3D_ERASER_DEPTH, tGPsdata::region, ARegion::regiondata, SPACE_VIEW3D, ScrArea::spacetype, bGPDspoint::x, and x.
Referenced by annotation_stroke_eraser_dostroke().
|
static |
Definition at line 258 of file annotate_paint.cc.
References copy_v2_v2(), fabsf, tGPsdata::flags, GP_PAINTFLAG_USE_STABILIZER_TEMP, tGPsdata::gpd, int, MIN_EUCLIDEAN_PX, MIN_MANHATTAN_PX, tGPsdata::mval, tGPsdata::mvalo, bGPdata::runtime, bGPdata_Runtime::sbuffer_used, and tGPsdata::stabilizer_radius.
Referenced by annotation_draw_apply().
|
static |
Create arrow strokes.
Definition at line 810 of file annotate_paint.cc.
References ToolSettings::annotate_v3d_align, annotation_arrow_create(), annotation_project_check(), annotation_stroke_added_check(), annotation_stroke_added_enable(), annotation_stroke_arrow_allocate(), annotation_stroke_arrow_init_point_default(), annotation_stroke_convertcoords(), bGPdata_Runtime::arrow_end, bGPdata_Runtime::arrow_end_style, bGPdata_Runtime::arrow_start, bGPdata_Runtime::arrow_start_style, bGPDstroke::aspect_ratio, BKE_gpencil_stroke_duplicate(), BLI_addtail(), CLAMP, copy_v2_fl(), copy_v2_v2_int(), DEPTH_INVALID, tGPsdata::depths, ED_view3d_depth_read_cached(), ED_view3d_depth_read_cached_seg(), bGPDstroke::fill_opacity_fac, bGPDstroke::flag, GP_PAINTMODE_DRAW_POLY, GP_PAINTMODE_DRAW_STRAIGHT, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_STROKE_ENDPOINTS, GP_STROKE_ARROWSTYLE_NONE, GP_STROKE_USE_ARROW_END, GP_STROKE_USE_ARROW_START, tGPsdata::gpd, GPENCIL_STRENGTH_MIN, tGPsdata::gpf, tGPsdata::gpl, bGPDstroke::hardness, bGPDstroke::inittime, tGPsdata::inittime, interp_sparse_array(), tGPspoint::m_xy, MEM_callocN, MEM_freeN(), MEM_mallocN, tGPsdata::paintmode, bGPDstroke::points, bGPDspoint::pressure, tGPspoint::pressure, round_v2i_v2fl(), bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, bGPDspoint::strength, tGPspoint::strength, bGPDframe::strokes, bGPDlayer::thickness, bGPDstroke::thickness, bGPDspoint::time, tGPspoint::time, Scene::toolsettings, bGPDstroke::tot_triangles, bGPDstroke::totpoints, bGPDstroke::uv_scale, and bGPDspoint::x.
Referenced by annotation_paint_strokeend().
|
static |
Definition at line 1429 of file annotate_paint.cc.
References tGPsdata::area, SpaceClip::flag, SpaceImage::flag, SpaceNode::flag, SpaceSeq::flag, View3D::flag2, SC_SHOW_ANNOTATION, SEQ_PREVIEW_SHOW_GPENCIL, SI_SHOW_GPENCIL, SNODE_SHOW_GPENCIL, SPACE_CLIP, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, and V3D_SHOW_ANNOTATION.
Referenced by annotation_session_initpaint().
| void GPENCIL_OT_annotate | ( | wmOperatorType * | ot | ) |
Definition at line 2792 of file annotate_paint.cc.
References annotation_draw_cancel(), annotation_draw_exec(), annotation_draw_invoke(), annotation_draw_modal(), annotation_draw_poll(), arrow_types, wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, prop_gpencil_drawmodes, PROP_HIDDEN, PROP_PIXEL, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_collection_runtime(), RNA_def_enum(), RNA_def_float(), RNA_def_int(), RNA_def_property_flag(), RNA_def_property_subtype(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil_legacy().
|
static |
Definition at line 2779 of file annotate_paint.cc.
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 2763 of file annotate_paint.cc.
Referenced by GPENCIL_OT_annotate().