Blender
V3.3
|
#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_math.h"
#include "BLI_math_geom.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "PIL_time.h"
#include "BKE_callbacks.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "BKE_tracking.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_windowmanager_types.h"
#include "UI_view2d.h"
#include "ED_clip.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_state.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "DEG_depsgraph.h"
#include "gpencil_intern.h"
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) |
Typedefs | |
typedef enum eGPencil_PaintStatus | eGPencil_PaintStatus |
typedef enum eGP_StrokeAdd_Result | eGP_StrokeAdd_Result |
typedef enum eGPencil_PaintFlags | eGPencil_PaintFlags |
typedef struct tGPsdata | tGPsdata |
Enumerations | |
enum | eGPencil_PaintStatus { GP_STATUS_IDLING = 0 , GP_STATUS_PAINTING , GP_STATUS_ERROR , GP_STATUS_DONE , GP_STATUS_CAPTURE , GP_STATUS_IDLING = 0 , GP_STATUS_PAINTING , GP_STATUS_ERROR , GP_STATUS_DONE } |
enum | eGP_StrokeAdd_Result { GP_STROKEADD_INVALID = -2 , GP_STROKEADD_OVERFLOW = -1 , GP_STROKEADD_NORMAL , GP_STROKEADD_FULL , 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) , GP_PAINTFLAG_FIRSTRUN = (1 << 0) , GP_PAINTFLAG_SELECTMASK = (1 << 3) , GP_PAINTFLAG_HARD_ERASER = (1 << 4) , GP_PAINTFLAG_STROKE_ERASER = (1 << 5) , GP_PAINTFLAG_REQ_VECTOR = (1 << 6) } |
Variables | |
static const EnumPropertyItem | prop_gpencil_drawmodes [] |
static const EnumPropertyItem | arrow_types [] |
#define DEPTH_INVALID 1.0f |
Definition at line 67 of file annotate_paint.c.
#define MIN_EUCLIDEAN_PX (U.gp_euclideandist) |
Definition at line 196 of file annotate_paint.c.
#define MIN_MANHATTAN_PX (U.gp_manhattandist) |
Definition at line 194 of file annotate_paint.c.
typedef enum eGP_StrokeAdd_Result eGP_StrokeAdd_Result |
typedef enum eGPencil_PaintFlags eGPencil_PaintFlags |
typedef enum eGPencil_PaintStatus eGPencil_PaintStatus |
enum eGP_StrokeAdd_Result |
Enumerator | |
---|---|
GP_STROKEADD_INVALID | |
GP_STROKEADD_OVERFLOW | |
GP_STROKEADD_NORMAL | |
GP_STROKEADD_FULL | |
GP_STROKEADD_INVALID | |
GP_STROKEADD_OVERFLOW | |
GP_STROKEADD_NORMAL | |
GP_STROKEADD_FULL |
Definition at line 79 of file annotate_paint.c.
enum eGPencil_PaintFlags |
Definition at line 87 of file annotate_paint.c.
enum eGPencil_PaintStatus |
Enumerator | |
---|---|
GP_STATUS_IDLING | |
GP_STATUS_PAINTING | |
GP_STATUS_ERROR | |
GP_STATUS_DONE | |
GP_STATUS_CAPTURE | |
GP_STATUS_IDLING | |
GP_STATUS_PAINTING | |
GP_STATUS_ERROR | |
GP_STATUS_DONE |
Definition at line 70 of file annotate_paint.c.
|
static |
Definition at line 2403 of file annotate_paint.c.
References Freestyle::a, annotation_draw_apply_event(), usdtokens::b(), C, copy_v2_v2(), CTX_data_ensure_evaluated_depsgraph(), depsgraph, float(), interp_v2_v2v2(), len_v2v2(), wmEvent::mval, tGPsdata::mvalo, and sub_v2_v2v2().
Referenced by annotation_draw_modal().
Definition at line 2350 of file annotate_paint.c.
References bScreen::areabase, BLI_findindex(), C, and CTX_wm_screen().
Referenced by annotation_draw_modal().
|
static |
Definition at line 775 of file annotate_paint.c.
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 742 of file annotate_paint.c.
References annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 719 of file annotate_paint.c.
References annotation_stroke_arrow_init_conv_point(), and annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 732 of file annotate_paint.c.
References annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 756 of file annotate_paint.c.
References annotation_stroke_arrow_init_conv_point(), and annotation_stroke_arrow_init_point().
Referenced by annotation_arrow_create().
|
static |
Definition at line 1996 of file annotate_paint.c.
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 2058 of file annotate_paint.c.
References blender::math::abs(), wmTabletData::active, annotation_draw_apply(), annotation_draw_toggle_stabilizer_cursor(), 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, PIL_check_seconds_timer(), 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 1878 of file annotate_paint.c.
References annotation_draw_exit(), and C.
Referenced by GPENCIL_OT_annotate().
Definition at line 1920 of file annotate_paint.c.
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 1711 of file annotate_paint.c.
References GP_PAINTMODE_ERASER, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_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, tGPsdata::radius, x, and y.
Referenced by annotation_draw_toggle_eraser_cursor().
|
static |
Definition at line 2203 of file annotate_paint.c.
References annotation_draw_apply(), annotation_draw_exit(), annotation_draw_init(), annotation_paint_initstroke(), annotation_paint_strokeend(), C, CTX_data_ensure_evaluated_depsgraph(), tGPsdata::curtime, wmOperator::customdata, depsgraph, double(), tGPsdata::flags, GP_PAINTFLAG_FIRSTRUN, tGPsdata::inittime, MEM_freeN, tGPsdata::mval, tGPsdata::mvalo, NA_EDITED, NC_GPENCIL, NULL, 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 1841 of file annotate_paint.c.
References annotation_draw_toggle_eraser_cursor(), annotation_draw_toggle_stabilizer_cursor(), annotation_paint_cleanup(), annotation_session_cleanup(), annotation_session_free(), C, CTX_wm_window(), wmOperator::customdata, GP_PAINTMODE_DRAW, GP_PAINTMODE_ERASER, gpencil_undo_finish(), NULL, 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 1886 of file annotate_paint.c.
References annotation_draw_exit(), annotation_paint_initstroke(), annotation_session_initpaint(), C, CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, GP_STATUS_ERROR, tGPsdata::keymodifier, NULL, wmOperator::ptr, RNA_enum_get(), and tGPsdata::status.
Referenced by annotation_draw_exec(), and annotation_draw_invoke().
|
static |
Definition at line 2270 of file annotate_paint.c.
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(), C, 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, NULL, 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 2439 of file annotate_paint.c.
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(), C, 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_MOTION, KM_PRESS, KM_RELEASE, LEFTMOUSE, wmEvent::mval, NA_EDITED, NC_GPENCIL, NDOF_MOTION, NULL, OP_IS_MODAL_CURSOR_REGION, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, tGPsdata::paintmode, 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().
Definition at line 218 of file annotate_paint.c.
References C, CTX_wm_operator_poll_msg_set(), ED_annotation_data_get_pointers(), ED_gpencil_session_active(), ED_operator_regionactive(), and NULL.
Referenced by GPENCIL_OT_annotate().
Definition at line 1771 of file annotate_paint.c.
References C, color, 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_2D_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, bGPdata_Runtime::sbuffer_used, ARegion::winrct, x, rcti::xmin, y, and rcti::ymin.
Referenced by annotation_draw_toggle_stabilizer_cursor().
Definition at line 1931 of file annotate_paint.c.
References C, 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, NULL, tGPsdata::paintmode, tGPsdata::status, and TIP_.
Referenced by annotation_draw_modal().
Definition at line 1755 of file annotate_paint.c.
References annotation_draw_eraser(), tGPsdata::erasercursor, NULL, 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().
Definition at line 1819 of file annotate_paint.c.
References annotation_draw_stabilizer(), NULL, 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 1055 of file annotate_paint.c.
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 254 of file annotate_paint.c.
References copy_v3_v3(), Scene::cursor, View3DCursor::location, and tGPsdata::scene.
Referenced by annotation_stroke_convertcoords().
Definition at line 1834 of file annotate_paint.c.
References wmTabletData::active, EVT_TABLET_ERASER, and wmEvent::tablet.
Referenced by annotation_draw_invoke(), and annotation_draw_modal().
Definition at line 1692 of file annotate_paint.c.
References annotation_paint_strokeend(), bGPDframe::flag, GP_FRAME_PAINT, tGPsdata::gpd, and tGPsdata::gpf.
Referenced by annotation_draw_exit(), and annotation_stroke_end().
|
static |
Definition at line 1508 of file annotate_paint.c.
References bGPDlayer::actframe, tGPsdata::align_flag, tGPsdata::area, GP_SpaceConversion::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, RenderData::cfra, bGPDlayer::color, copy_m4_m4(), copy_v3_v3(), tGPsdata::custom_color, DATA_, depsgraph, tGPsdata::depsgraph, ED_view3d_calc_camera_border(), ListBase::first, bGPDframe::flag, bGPDlayer::flag, bGPdata::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, tGPsdata::gpd, GP_SpaceConversion::gpd, ToolSettings::gpencil_flags, tGPsdata::gpf, tGPsdata::gpl, GP_SpaceConversion::gpl, tGPsdata::gsc, bGPdata::id, tGPsdata::mat, GP_SpaceConversion::mat, NULL, tGPsdata::paintmode, RegionView3D::persp, Scene::r, tGPsdata::region, GP_SpaceConversion::region, ARegion::regiondata, bGPdata::runtime, RV3D_CAMOB, bGPdata_Runtime::sbuffer_sflag, scene, tGPsdata::scene, SPACE_CLIP, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, tGPsdata::status, bGPDframe::strokes, tGPsdata::subrect, GP_SpaceConversion::subrect, tGPsdata::subrect_data, GP_SpaceConversion::subrect_data, Scene::toolsettings, tGPsdata::v2d, and GP_SpaceConversion::v2d.
Referenced by annotation_draw_apply(), annotation_draw_exec(), annotation_draw_init(), and annotation_stroke_begin().
Definition at line 1656 of file annotate_paint.c.
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_STROKE, GP_STROKE_ERASER, tGPsdata::gpd, bGPdata::id, NULL, tGPsdata::region, bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, tGPsdata::scene, ScrArea::spacedata, Scene::toolsettings, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), and tGPsdata::win.
Referenced by annotation_draw_apply(), annotation_draw_exec(), and annotation_paint_cleanup().
Definition at line 241 of file annotate_paint.c.
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().
Definition at line 1477 of file annotate_paint.c.
References tGPsdata::gpd, if(), tGPsdata::inittime, MEM_freeN, NULL, 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().
Definition at line 1499 of file annotate_paint.c.
References tGPsdata::depths, ED_view3d_depths_free(), and MEM_freeN.
Referenced by annotation_draw_exit().
Definition at line 1250 of file annotate_paint.c.
References tGPsdata::align_flag, ToolSettings::annotate_v3d_align, annotation_session_validatebuffer(), tGPsdata::area, BKE_gpencil_data_addnew(), BKE_tracking_marker_get(), BKE_tracking_track_get_active(), tGPsdata::bmain, C, 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, tGPsdata::mat, GP_SpaceConversion::mat, NULL, tGPsdata::ownerPtr, MovieTrackingMarker::pos, tGPsdata::region, ARegion::regiondata, ARegion::regiontype, 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, MovieClip::tracking, SpaceClip::unistabmat, unit_m4(), tGPsdata::v2d, ARegion::v2d, and tGPsdata::win.
Referenced by annotation_session_initpaint(), and annotation_stroke_begin().
Definition at line 1444 of file annotate_paint.c.
References annotation_session_initdata(), annotation_visible_on_space(), C, MEM_callocN, MEM_freeN, NULL, and tGPsdata::radius.
Referenced by annotation_draw_init().
Definition at line 1235 of file annotate_paint.c.
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 388 of file annotate_paint.c.
References Freestyle::a, usdtokens::b(), Freestyle::c, copy_v2_v2(), tGPsdata::gpd, if(), interp_v2_v2v2(), tGPspoint::m_xy, madd_v2_v2fl(), NULL, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_used, and steps.
Referenced by annotation_stroke_addpoint().
Definition at line 198 of file annotate_paint.c.
References tGPsdata::flags, GP_PAINTFLAG_STROKEADDED, tGPsdata::gpf, ListBase::last, and bGPDframe::strokes.
Referenced by annotation_stroke_addpoint(), and annotation_stroke_newfrombuffer().
Definition at line 203 of file annotate_paint.c.
References BLI_assert, tGPsdata::flags, GP_PAINTFLAG_STROKEADDED, tGPsdata::gpf, ListBase::last, NULL, and bGPDframe::strokes.
Referenced by annotation_stroke_newfrombuffer().
|
static |
Definition at line 516 of file annotate_paint.c.
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_STROKE, 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, NULL, tGPsdata::paintmode, bGPDstroke::points, tGPspoint::pressure, bGPDspoint::pressure, tGPsdata::region, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, ScrArea::spacedata, tGPspoint::strength, bGPDspoint::strength, bGPDframe::strokes, tGPspoint::time, bGPDspoint::time, Scene::toolsettings, bGPDstroke::tot_triangles, bGPDstroke::totpoints, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), tGPsdata::win, and bGPDspoint::x.
Referenced by annotation_draw_apply().
|
static |
Definition at line 711 of file annotate_paint.c.
References MEM_callocN, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by annotation_stroke_newfrombuffer().
|
static |
Definition at line 449 of file annotate_paint.c.
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(), normalize_v2(), NULL, and point.
Referenced by annotation_stroke_addpoint().
|
static |
Definition at line 436 of file annotate_paint.c.
References blender::math::length(), and KDL::sign().
Referenced by annotation_stroke_arrow_calc_points().
|
static |
Definition at line 695 of file annotate_paint.c.
References annotation_stroke_arrow_init_point_default(), copy_v3_v3(), point, and bGPDspoint::x.
Referenced by annotation_arrow_create_open(), and annotation_arrow_create_square().
|
static |
Definition at line 701 of file annotate_paint.c.
References annotation_stroke_arrow_init_point_default(), annotation_stroke_convertcoords(), copy_v2_v2(), tGPspoint::m_xy, NULL, 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 688 of file annotate_paint.c.
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 2356 of file annotate_paint.c.
References annotation_paint_initstroke(), annotation_session_initdata(), tGPsdata::area, C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), wmOperator::customdata, wmOperator::flag, GP_STATUS_ERROR, GP_STATUS_PAINTING, OP_IS_MODAL_CURSOR_REGION, tGPsdata::paintmode, and tGPsdata::status.
Referenced by annotation_draw_modal().
|
static |
Definition at line 309 of file annotate_paint.c.
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(), NULL, usdtokens::out(), 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().
Definition at line 1196 of file annotate_paint.c.
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, NULL, 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 2384 of file annotate_paint.c.
References annotation_paint_cleanup(), annotation_session_cleanup(), wmOperator::customdata, wmOperator::flag, GP_STATUS_IDLING, tGPsdata::gpd, gpencil_undo_push(), tGPsdata::gpf, tGPsdata::gpl, NULL, OP_IS_MODAL_CURSOR_REGION, and tGPsdata::status.
Referenced by annotation_draw_modal().
|
static |
Definition at line 1100 of file annotate_paint.c.
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 1074 of file annotate_paint.c.
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, x, bGPDspoint::x, and y.
Referenced by annotation_stroke_eraser_dostroke().
|
static |
Definition at line 265 of file annotate_paint.c.
References copy_v2_v2(), fabsf, tGPsdata::flags, GP_PAINTFLAG_USE_STABILIZER_TEMP, tGPsdata::gpd, 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().
Create arrow strokes.
Definition at line 806 of file annotate_paint.c.
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::hardeness, tGPsdata::inittime, bGPDstroke::inittime, interp_sparse_array(), tGPspoint::m_xy, MEM_callocN, MEM_freeN, MEM_mallocN, NULL, tGPsdata::paintmode, bGPDstroke::points, tGPspoint::pressure, bGPDspoint::pressure, round_v2i_v2fl(), bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, tGPspoint::strength, bGPDspoint::strength, bGPDframe::strokes, bGPDstroke::thickness, bGPDlayer::thickness, tGPspoint::time, bGPDspoint::time, Scene::toolsettings, bGPDstroke::tot_triangles, bGPDstroke::totpoints, bGPDstroke::uv_scale, and bGPDspoint::x.
Referenced by annotation_paint_strokeend().
Definition at line 1409 of file annotate_paint.c.
References blender::compositor::area(), tGPsdata::area, SpaceSeq::flag, SpaceImage::flag, SpaceNode::flag, SpaceClip::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 2764 of file annotate_paint.c.
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().
|
static |
Definition at line 2751 of file annotate_paint.c.
Referenced by GPENCIL_OT_annotate().
|
static |
Definition at line 2735 of file annotate_paint.c.
Referenced by GPENCIL_OT_annotate().