Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
annotate_paint.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_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)
}
 

Functions

static bool annotation_stroke_added_check (tGPsdata *p)
 
static void annotation_stroke_added_enable (tGPsdata *p)
 
static void annotation_session_validatebuffer (tGPsdata *p)
 
static bool annotation_draw_poll (bContext *C)
 
static bool annotation_project_check (tGPsdata *p)
 
static void annotation_get_3d_reference (tGPsdata *p, float vec[3])
 
static bool annotation_stroke_filtermval (tGPsdata *p, const float mval[2], const float pmval[2])
 
static void annotation_stroke_convertcoords (tGPsdata *p, const float mval[2], float out[3], float *depth)
 
static void annotation_smooth_buffer (tGPsdata *p, float inf, int idx)
 
static void annotation_stroke_arrow_calc_points_segment (float stroke_points[8], const float ref_point[2], const float dir_cw[2], const float dir_ccw[2], const float length, const float sign)
 
static void annotation_stroke_arrow_calc_points (tGPspoint *point, const float stroke_dir[2], float corner[2], float stroke_points[8], const int arrow_style)
 
static short annotation_stroke_addpoint (tGPsdata *p, const float mval[2], float pressure, double curtime)
 
static void annotation_stroke_arrow_init_point_default (bGPDspoint *pt)
 
static void annotation_stroke_arrow_init_conv_point (bGPDspoint *pt, const float point[3])
 
static void annotation_stroke_arrow_init_point (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float co[8], const int co_idx)
 
static void annotation_stroke_arrow_allocate (bGPDstroke *gps, const int totpoints)
 
static void annotation_arrow_create_open (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float corner_point[3], const float arrow_points[8])
 
static void annotation_arrow_create_segm (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float arrow_points[8])
 
static void annotation_arrow_create_closed (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float arrow_points[8])
 
static void annotation_arrow_create_square (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float corner_point[3], const float arrow_points[8])
 
static void annotation_arrow_create (tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, bGPDstroke *arrow_stroke, const float arrow_points[8], const int style)
 
static void annotation_stroke_newfrombuffer (tGPsdata *p)
 
static void annotation_free_stroke (bGPDframe *gpf, bGPDstroke *gps)
 
static bool annotation_stroke_eraser_is_occluded (tGPsdata *p, const bGPDspoint *pt, const int x, const int y)
 
static void annotation_stroke_eraser_dostroke (tGPsdata *p, bGPDframe *gpf, bGPDstroke *gps, const float mval[2], const int radius, const rcti *rect)
 
static void annotation_stroke_doeraser (tGPsdata *p)
 
static bool annotation_session_initdata (bContext *C, tGPsdata *p)
 
static void annotation_visible_on_space (tGPsdata *p)
 
static tGPsdataannotation_session_initpaint (bContext *C)
 
static void annotation_session_cleanup (tGPsdata *p)
 
static void annotation_session_free (tGPsdata *p)
 
static void annotation_paint_initstroke (tGPsdata *p, eGPencil_PaintModes paintmode, Depsgraph *depsgraph)
 
static void annotation_paint_strokeend (tGPsdata *p)
 
static void annotation_paint_cleanup (tGPsdata *p)
 
static void annotation_draw_eraser (bContext *UNUSED(C), int x, int y, void *p_ptr)
 
static void annotation_draw_toggle_eraser_cursor (tGPsdata *p, short enable)
 
static void annotation_draw_stabilizer (bContext *C, int x, int y, void *p_ptr)
 
static void annotation_draw_toggle_stabilizer_cursor (tGPsdata *p, short enable)
 
static bool annotation_is_tablet_eraser_active (const wmEvent *event)
 
static void annotation_draw_exit (bContext *C, wmOperator *op)
 
static void annotation_draw_cancel (bContext *C, wmOperator *op)
 
static int annotation_draw_init (bContext *C, wmOperator *op, const wmEvent *event)
 
static void annotation_draw_cursor_set (tGPsdata *p)
 
static void annotation_draw_status_indicators (bContext *C, tGPsdata *p)
 
static void annotation_draw_apply (wmOperator *op, tGPsdata *p, Depsgraph *depsgraph)
 
static void annotation_draw_apply_event (wmOperator *op, const wmEvent *event, Depsgraph *depsgraph, float x, float y)
 
static int annotation_draw_exec (bContext *C, wmOperator *op)
 
static int annotation_draw_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static bool annotation_area_exists (bContext *C, ScrArea *area_test)
 
static tGPsdataannotation_stroke_begin (bContext *C, wmOperator *op)
 
static void annotation_stroke_end (wmOperator *op)
 
static void annotation_add_missing_events (bContext *C, wmOperator *op, const wmEvent *event, tGPsdata *p)
 
static int annotation_draw_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
void GPENCIL_OT_annotate (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem prop_gpencil_drawmodes []
 
static const EnumPropertyItem arrow_types []
 

Macro Definition Documentation

◆ DEPTH_INVALID

#define DEPTH_INVALID   1.0f

Definition at line 67 of file annotate_paint.c.

◆ MIN_EUCLIDEAN_PX

#define MIN_EUCLIDEAN_PX   (U.gp_euclideandist)

Definition at line 196 of file annotate_paint.c.

◆ MIN_MANHATTAN_PX

#define MIN_MANHATTAN_PX   (U.gp_manhattandist)

Definition at line 194 of file annotate_paint.c.

Typedef Documentation

◆ eGP_StrokeAdd_Result

◆ eGPencil_PaintFlags

◆ eGPencil_PaintStatus

◆ tGPsdata

typedef struct tGPsdata tGPsdata

Enumeration Type Documentation

◆ 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.

◆ 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 
GP_PAINTFLAG_FIRSTRUN 
GP_PAINTFLAG_SELECTMASK 
GP_PAINTFLAG_HARD_ERASER 
GP_PAINTFLAG_STROKE_ERASER 
GP_PAINTFLAG_REQ_VECTOR 

Definition at line 87 of file annotate_paint.c.

◆ 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.

Function Documentation

◆ annotation_add_missing_events()

static void annotation_add_missing_events ( bContext C,
wmOperator op,
const wmEvent event,
tGPsdata p 
)
static

◆ annotation_area_exists()

static bool annotation_area_exists ( bContext C,
ScrArea area_test 
)
static

Definition at line 2350 of file annotate_paint.c.

References bScreen::areabase, BLI_findindex(), C, and CTX_wm_screen().

Referenced by annotation_draw_modal().

◆ annotation_arrow_create()

static void annotation_arrow_create ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
bGPDstroke arrow_stroke,
const float  arrow_points[8],
const int  style 
)
static

◆ annotation_arrow_create_closed()

static void annotation_arrow_create_closed ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
const float  arrow_points[8] 
)
static

Definition at line 742 of file annotate_paint.c.

References annotation_stroke_arrow_init_point().

Referenced by annotation_arrow_create().

◆ annotation_arrow_create_open()

static void annotation_arrow_create_open ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
const float  corner_point[3],
const float  arrow_points[8] 
)
static

◆ annotation_arrow_create_segm()

static void annotation_arrow_create_segm ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
const float  arrow_points[8] 
)
static

Definition at line 732 of file annotate_paint.c.

References annotation_stroke_arrow_init_point().

Referenced by annotation_arrow_create().

◆ annotation_arrow_create_square()

static void annotation_arrow_create_square ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
const float  corner_point[3],
const float  arrow_points[8] 
)
static

◆ annotation_draw_apply()

static void annotation_draw_apply ( wmOperator op,
tGPsdata p,
Depsgraph depsgraph 
)
static

◆ annotation_draw_apply_event()

static void annotation_draw_apply_event ( wmOperator op,
const wmEvent event,
Depsgraph depsgraph,
float  x,
float  y 
)
static

◆ annotation_draw_cancel()

static void annotation_draw_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 1878 of file annotate_paint.c.

References annotation_draw_exit(), and C.

Referenced by GPENCIL_OT_annotate().

◆ annotation_draw_cursor_set()

static void annotation_draw_cursor_set ( tGPsdata p)
static

◆ annotation_draw_eraser()

static void annotation_draw_eraser ( bContext UNUSEDC,
int  x,
int  y,
void p_ptr 
)
static

◆ annotation_draw_exec()

static int annotation_draw_exec ( bContext C,
wmOperator op 
)
static

◆ annotation_draw_exit()

static void annotation_draw_exit ( bContext C,
wmOperator op 
)
static

◆ annotation_draw_init()

static int annotation_draw_init ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ annotation_draw_invoke()

static int annotation_draw_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ annotation_draw_modal()

static int annotation_draw_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
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().

◆ annotation_draw_poll()

static bool annotation_draw_poll ( bContext C)
static

◆ annotation_draw_stabilizer()

static void annotation_draw_stabilizer ( bContext C,
int  x,
int  y,
void p_ptr 
)
static

◆ annotation_draw_status_indicators()

static void annotation_draw_status_indicators ( bContext C,
tGPsdata p 
)
static

◆ annotation_draw_toggle_eraser_cursor()

static void annotation_draw_toggle_eraser_cursor ( tGPsdata p,
short  enable 
)
static

◆ annotation_draw_toggle_stabilizer_cursor()

static void annotation_draw_toggle_stabilizer_cursor ( tGPsdata p,
short  enable 
)
static

◆ annotation_free_stroke()

static void annotation_free_stroke ( bGPDframe gpf,
bGPDstroke gps 
)
static

◆ annotation_get_3d_reference()

static void annotation_get_3d_reference ( tGPsdata p,
float  vec[3] 
)
static

◆ annotation_is_tablet_eraser_active()

static bool annotation_is_tablet_eraser_active ( const wmEvent event)
static

◆ annotation_paint_cleanup()

static void annotation_paint_cleanup ( tGPsdata p)
static

◆ annotation_paint_initstroke()

static void annotation_paint_initstroke ( tGPsdata p,
eGPencil_PaintModes  paintmode,
Depsgraph depsgraph 
)
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().

◆ annotation_paint_strokeend()

static void annotation_paint_strokeend ( tGPsdata p)
static

◆ annotation_project_check()

static bool annotation_project_check ( tGPsdata p)
static

◆ annotation_session_cleanup()

static void annotation_session_cleanup ( tGPsdata p)
static

◆ annotation_session_free()

static void annotation_session_free ( tGPsdata p)
static

Definition at line 1499 of file annotate_paint.c.

References tGPsdata::depths, ED_view3d_depths_free(), and MEM_freeN.

Referenced by annotation_draw_exit().

◆ annotation_session_initdata()

static bool annotation_session_initdata ( bContext C,
tGPsdata p 
)
static

◆ annotation_session_initpaint()

static tGPsdata* annotation_session_initpaint ( bContext C)
static

◆ annotation_session_validatebuffer()

static void annotation_session_validatebuffer ( tGPsdata p)
static

◆ annotation_smooth_buffer()

static void annotation_smooth_buffer ( tGPsdata p,
float  inf,
int  idx 
)
static

Apply smooth to buffer while drawing to smooth point C, use 2 before (A, B) and current point (D):

A----B-----C------D

Parameters
pTemp data
infInfluence factor
idxIndex 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().

◆ annotation_stroke_added_check()

static bool annotation_stroke_added_check ( tGPsdata p)
static

◆ annotation_stroke_added_enable()

static void annotation_stroke_added_enable ( tGPsdata p)
static

◆ annotation_stroke_addpoint()

static short annotation_stroke_addpoint ( tGPsdata p,
const float  mval[2],
float  pressure,
double  curtime 
)
static

◆ annotation_stroke_arrow_allocate()

static void annotation_stroke_arrow_allocate ( bGPDstroke gps,
const int  totpoints 
)
static

Definition at line 711 of file annotate_paint.c.

References MEM_callocN, bGPDstroke::points, and bGPDstroke::totpoints.

Referenced by annotation_stroke_newfrombuffer().

◆ annotation_stroke_arrow_calc_points()

static void annotation_stroke_arrow_calc_points ( tGPspoint point,
const float  stroke_dir[2],
float  corner[2],
float  stroke_points[8],
const int  arrow_style 
)
static

◆ annotation_stroke_arrow_calc_points_segment()

static void annotation_stroke_arrow_calc_points_segment ( float  stroke_points[8],
const float  ref_point[2],
const float  dir_cw[2],
const float  dir_ccw[2],
const float  length,
const float  sign 
)
static

Definition at line 436 of file annotate_paint.c.

References blender::math::length(), and KDL::sign().

Referenced by annotation_stroke_arrow_calc_points().

◆ annotation_stroke_arrow_init_conv_point()

static void annotation_stroke_arrow_init_conv_point ( bGPDspoint pt,
const float  point[3] 
)
static

◆ annotation_stroke_arrow_init_point()

static void annotation_stroke_arrow_init_point ( tGPsdata p,
tGPspoint ptc,
bGPDspoint pt,
const float  co[8],
const int  co_idx 
)
static

◆ annotation_stroke_arrow_init_point_default()

static void annotation_stroke_arrow_init_point_default ( bGPDspoint pt)
static

◆ annotation_stroke_begin()

static tGPsdata* annotation_stroke_begin ( bContext C,
wmOperator op 
)
static

◆ annotation_stroke_convertcoords()

static void annotation_stroke_convertcoords ( tGPsdata p,
const float  mval[2],
float  out[3],
float depth 
)
static

◆ annotation_stroke_doeraser()

static void annotation_stroke_doeraser ( tGPsdata p)
static

◆ annotation_stroke_end()

static void annotation_stroke_end ( wmOperator op)
static

◆ annotation_stroke_eraser_dostroke()

static void annotation_stroke_eraser_dostroke ( tGPsdata p,
bGPDframe gpf,
bGPDstroke gps,
const float  mval[2],
const int  radius,
const rcti rect 
)
static

◆ annotation_stroke_eraser_is_occluded()

static bool annotation_stroke_eraser_is_occluded ( tGPsdata p,
const bGPDspoint pt,
const int  x,
const int  y 
)
static

◆ annotation_stroke_filtermval()

static bool annotation_stroke_filtermval ( tGPsdata p,
const float  mval[2],
const float  pmval[2] 
)
static

◆ annotation_stroke_newfrombuffer()

static void annotation_stroke_newfrombuffer ( tGPsdata p)
static

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().

◆ annotation_visible_on_space()

static void annotation_visible_on_space ( tGPsdata p)
static

◆ GPENCIL_OT_annotate()

void GPENCIL_OT_annotate ( wmOperatorType ot)

Variable Documentation

◆ arrow_types

const EnumPropertyItem arrow_types[]
static
Initial value:
= {
{GP_STROKE_ARROWSTYLE_NONE, "NONE", 0, "None", "Don't use any arrow/style in corner"},
{GP_STROKE_ARROWSTYLE_CLOSED, "ARROW", 0, "Arrow", "Use closed arrow style"},
{GP_STROKE_ARROWSTYLE_OPEN, "ARROW_OPEN", 0, "Open Arrow", "Use open arrow style"},
"ARROW_OPEN_INVERTED",
0,
"Segment",
"Use perpendicular segment style"},
{GP_STROKE_ARROWSTYLE_SQUARE, "DIAMOND", 0, "Square", "Use square style"},
{0, NULL, 0, NULL, NULL},
}
@ GP_STROKE_ARROWSTYLE_NONE
@ GP_STROKE_ARROWSTYLE_SEGMENT
@ GP_STROKE_ARROWSTYLE_CLOSED
@ GP_STROKE_ARROWSTYLE_OPEN
@ GP_STROKE_ARROWSTYLE_SQUARE

Definition at line 2751 of file annotate_paint.c.

Referenced by GPENCIL_OT_annotate().

◆ prop_gpencil_drawmodes

const EnumPropertyItem prop_gpencil_drawmodes[]
static
Initial value:
= {
{GP_PAINTMODE_DRAW, "DRAW", 0, "Draw Freehand", "Draw freehand stroke(s)"},
"DRAW_STRAIGHT",
0,
"Draw Straight Lines",
"Draw straight line segment(s)"},
"DRAW_POLY",
0,
"Draw Poly Line",
"Click to place endpoints of straight line segments (connected)"},
{GP_PAINTMODE_ERASER, "ERASER", 0, "Eraser", "Erase Annotation strokes"},
{0, NULL, 0, NULL, NULL},
}
@ GP_PAINTMODE_DRAW_POLY
@ GP_PAINTMODE_ERASER
@ GP_PAINTMODE_DRAW
@ GP_PAINTMODE_DRAW_STRAIGHT

Definition at line 2735 of file annotate_paint.c.

Referenced by GPENCIL_OT_annotate().