Blender  V3.3
Macros | Functions | Variables
gpencil_primitive.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_rand.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "PIL_time.h"
#include "DNA_brush_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_gpencil.h"
#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Macros

#define MIN_EDGES   2
 
#define MAX_EDGES   128
 
#define MAX_CP   128
 
#define IDLE   0
 
#define IN_PROGRESS   1
 
#define IN_CURVE_EDIT   2
 
#define IN_MOVE   3
 
#define IN_BRUSH_SIZE   4
 
#define IN_BRUSH_STRENGTH   5
 
#define IN_POLYLINE   6
 
#define SELECT_NONE   0
 
#define SELECT_START   1
 
#define SELECT_CP1   2
 
#define SELECT_CP2   3
 
#define SELECT_END   4
 
#define BIG_SIZE_CTL   15
 
#define MID_SIZE_CTL   10
 
#define SMALL_SIZE_CTL   8
 
#define MOVE_NONE   0
 
#define MOVE_ENDS   1
 
#define MOVE_CP   2
 

Functions

static void gpencil_session_validatebuffer (tGPDprimitive *p)
 
static void gpencil_init_colors (tGPDprimitive *p)
 
static void gpencil_primitive_to_square (tGPDprimitive *tgpi, const float x, const float y)
 
static void gpencil_primitive_constrain (tGPDprimitive *tgpi, bool line_mode)
 
static void gpencil_rotate_v2_v2v2fl (float v[2], const float p[2], const float origin[2], const float angle)
 
static void gpencil_primitive_rotate_line (float va[2], float vb[2], const float a[2], const float b[2], const float angle)
 
static void gpencil_primitive_update_cps (tGPDprimitive *tgpi)
 
static bool gpencil_primitive_add_poll (bContext *C)
 
static void gpencil_primitive_allocate_memory (tGPDprimitive *tgpi)
 
static void gpencil_primitive_set_initdata (bContext *C, tGPDprimitive *tgpi)
 
static void gpencil_primitive_add_segment (tGPDprimitive *tgpi)
 
static void gpencil_primitive_set_cp (tGPDprimitive *tgpi, const float p[2], float color[4], int size)
 
static void gpencil_primitive_status_indicators (bContext *C, tGPDprimitive *tgpi)
 
static void gpencil_primitive_rectangle (tGPDprimitive *tgpi, tGPspoint *points2D)
 
static void gpencil_primitive_line (tGPDprimitive *tgpi, tGPspoint *points2D, bool editable)
 
static void gpencil_primitive_arc (tGPDprimitive *tgpi, tGPspoint *points2D)
 
static void gpencil_primitive_bezier (tGPDprimitive *tgpi, tGPspoint *points2D)
 
static void gpencil_primitive_circle (tGPDprimitive *tgpi, tGPspoint *points2D)
 
static void gpencil_primitive_update_strokes (bContext *C, tGPDprimitive *tgpi)
 
static void gpencil_primitive_update (bContext *C, wmOperator *op, tGPDprimitive *tgpi)
 
static void gpencil_primitive_interaction_begin (tGPDprimitive *tgpi, const wmEvent *event)
 
static void gpencil_primitive_exit (bContext *C, wmOperator *op)
 
static void gpencil_primitive_init (bContext *C, wmOperator *op)
 
static int gpencil_primitive_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void gpencil_primitive_interaction_end (bContext *C, wmOperator *op, wmWindow *win, tGPDprimitive *tgpi)
 
static void gpencil_primitive_edit_event_handling (bContext *C, wmOperator *op, wmWindow *win, const wmEvent *event, tGPDprimitive *tgpi)
 
static void gpencil_primitive_strength (tGPDprimitive *tgpi, bool reset)
 
static void gpencil_primitive_size (tGPDprimitive *tgpi, bool reset)
 
static void gpencil_primitive_move (tGPDprimitive *tgpi, bool reset)
 
static int gpencil_primitive_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void gpencil_primitive_cancel (bContext *C, wmOperator *op)
 
static void gpencil_primitive_common_props (wmOperatorType *ot, int subdiv, int type)
 
void GPENCIL_OT_primitive_box (wmOperatorType *ot)
 
void GPENCIL_OT_primitive_line (wmOperatorType *ot)
 
void GPENCIL_OT_primitive_polyline (wmOperatorType *ot)
 
void GPENCIL_OT_primitive_circle (wmOperatorType *ot)
 
void GPENCIL_OT_primitive_curve (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem gpencil_primitive_type []
 

Detailed Description

Operators for creating new Grease Pencil primitives (boxes, circles, ...).

Definition in file gpencil_primitive.c.

Macro Definition Documentation

◆ BIG_SIZE_CTL

#define BIG_SIZE_CTL   15

Definition at line 87 of file gpencil_primitive.c.

◆ IDLE

#define IDLE   0

Definition at line 73 of file gpencil_primitive.c.

◆ IN_BRUSH_SIZE

#define IN_BRUSH_SIZE   4

Definition at line 77 of file gpencil_primitive.c.

◆ IN_BRUSH_STRENGTH

#define IN_BRUSH_STRENGTH   5

Definition at line 78 of file gpencil_primitive.c.

◆ IN_CURVE_EDIT

#define IN_CURVE_EDIT   2

Definition at line 75 of file gpencil_primitive.c.

◆ IN_MOVE

#define IN_MOVE   3

Definition at line 76 of file gpencil_primitive.c.

◆ IN_POLYLINE

#define IN_POLYLINE   6

Definition at line 79 of file gpencil_primitive.c.

◆ IN_PROGRESS

#define IN_PROGRESS   1

Definition at line 74 of file gpencil_primitive.c.

◆ MAX_CP

#define MAX_CP   128

Definition at line 71 of file gpencil_primitive.c.

◆ MAX_EDGES

#define MAX_EDGES   128

Definition at line 70 of file gpencil_primitive.c.

◆ MID_SIZE_CTL

#define MID_SIZE_CTL   10

Definition at line 88 of file gpencil_primitive.c.

◆ MIN_EDGES

#define MIN_EDGES   2

Definition at line 69 of file gpencil_primitive.c.

◆ MOVE_CP

#define MOVE_CP   2

Definition at line 93 of file gpencil_primitive.c.

◆ MOVE_ENDS

#define MOVE_ENDS   1

Definition at line 92 of file gpencil_primitive.c.

◆ MOVE_NONE

#define MOVE_NONE   0

Definition at line 91 of file gpencil_primitive.c.

◆ SELECT_CP1

#define SELECT_CP1   2

Definition at line 83 of file gpencil_primitive.c.

◆ SELECT_CP2

#define SELECT_CP2   3

Definition at line 84 of file gpencil_primitive.c.

◆ SELECT_END

#define SELECT_END   4

Definition at line 85 of file gpencil_primitive.c.

◆ SELECT_NONE

#define SELECT_NONE   0

Definition at line 81 of file gpencil_primitive.c.

◆ SELECT_START

#define SELECT_START   1

Definition at line 82 of file gpencil_primitive.c.

◆ SMALL_SIZE_CTL

#define SMALL_SIZE_CTL   8

Definition at line 89 of file gpencil_primitive.c.

Function Documentation

◆ gpencil_init_colors()

static void gpencil_init_colors ( tGPDprimitive p)
static

◆ GPENCIL_OT_primitive_box()

void GPENCIL_OT_primitive_box ( wmOperatorType ot)

◆ GPENCIL_OT_primitive_circle()

void GPENCIL_OT_primitive_circle ( wmOperatorType ot)

◆ GPENCIL_OT_primitive_curve()

void GPENCIL_OT_primitive_curve ( wmOperatorType ot)

◆ GPENCIL_OT_primitive_line()

void GPENCIL_OT_primitive_line ( wmOperatorType ot)

◆ GPENCIL_OT_primitive_polyline()

void GPENCIL_OT_primitive_polyline ( wmOperatorType ot)

◆ gpencil_primitive_add_poll()

static bool gpencil_primitive_add_poll ( bContext C)
static

◆ gpencil_primitive_add_segment()

static void gpencil_primitive_add_segment ( tGPDprimitive tgpi)
static

◆ gpencil_primitive_allocate_memory()

static void gpencil_primitive_allocate_memory ( tGPDprimitive tgpi)
static

◆ gpencil_primitive_arc()

static void gpencil_primitive_arc ( tGPDprimitive tgpi,
tGPspoint points2D 
)
static

◆ gpencil_primitive_bezier()

static void gpencil_primitive_bezier ( tGPDprimitive tgpi,
tGPspoint points2D 
)
static

◆ gpencil_primitive_cancel()

static void gpencil_primitive_cancel ( bContext C,
wmOperator op 
)
static

◆ gpencil_primitive_circle()

static void gpencil_primitive_circle ( tGPDprimitive tgpi,
tGPspoint points2D 
)
static

◆ gpencil_primitive_common_props()

static void gpencil_primitive_common_props ( wmOperatorType ot,
int  subdiv,
int  type 
)
static

◆ gpencil_primitive_constrain()

static void gpencil_primitive_constrain ( tGPDprimitive tgpi,
bool  line_mode 
)
static

◆ gpencil_primitive_edit_event_handling()

static void gpencil_primitive_edit_event_handling ( bContext C,
wmOperator op,
wmWindow win,
const wmEvent event,
tGPDprimitive tgpi 
)
static

◆ gpencil_primitive_exit()

static void gpencil_primitive_exit ( bContext C,
wmOperator op 
)
static

◆ gpencil_primitive_init()

static void gpencil_primitive_init ( bContext C,
wmOperator op 
)
static

Definition at line 1170 of file gpencil_primitive.c.

References tGPDprimitive::area, BKE_brush_gpencil_paint_presets(), BKE_brush_tool_set, BKE_gpencil_object_material_ensure_from_active_input_toolsettings(), BKE_paint_brush_set(), BKE_paint_toolslots_brush_get(), tGPDprimitive::bmain, tGPDprimitive::brush, Paint::brush, C, RenderData::cfra, tGPDprimitive::cframe, bGPdata_Runtime::cp_points, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_gpencil_data(), CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), tGPDprimitive::curve, wmOperator::customdata, DEG_get_evaluated_object(), tGPDprimitive::depsgraph, ELEM, ListBase::first, tGPDprimitive::flag, ToolSettings::gp_paint, ToolSettings::gp_sculpt, GP_STROKE_ARC, GP_STROKE_BOX, GP_STROKE_CURVE, tGPDprimitive::gpd, gpencil_point_conversion_init(), gpencil_primitive_set_initdata(), Brush::gpencil_settings, tGPDprimitive::gsc, IDLE, tGPDprimitive::lock_axis, GP_Sculpt_Settings::lock_axis, tGPDprimitive::material, MAX_CP, MEM_callocN, NULL, tGPDprimitive::ob, tGPDprimitive::ob_eval, tGPDprimitive::orign_type, GpPaint::paint, tGPDprimitive::points, wmOperator::ptr, Scene::r, tGPDprimitive::region, ARegion::regiondata, RNA_enum_get(), RNA_int_get(), RNA_int_set(), bGPdata::runtime, tGPDprimitive::rv3d, scene, tGPDprimitive::scene, ScrArea::spacedata, tGPDprimitive::subdiv, bGPdata_Runtime::tot_cp_points, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, tGPDprimitive::type, tGPDprimitive::v3d, and tGPDprimitive::win.

Referenced by gpencil_primitive_invoke().

◆ gpencil_primitive_interaction_begin()

static void gpencil_primitive_interaction_begin ( tGPDprimitive tgpi,
const wmEvent event 
)
static

◆ gpencil_primitive_interaction_end()

static void gpencil_primitive_interaction_end ( bContext C,
wmOperator op,
wmWindow win,
tGPDprimitive tgpi 
)
static

Definition at line 1300 of file gpencil_primitive.c.

References bGPDlayer::actframe, BrushGpencilSettings::aspect_ratio, bGPDstroke::aspect_ratio, BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_stroke_boundingbox_calc(), BKE_gpencil_stroke_copy_to_keyframes(), BKE_gpencil_stroke_geometry_update(), BLI_assert, BLI_findlink(), BLI_listbase_is_empty(), BLI_movelisttolist(), BLI_movelisttolist_reverse(), tGPDprimitive::brush, C, tGPDprimitive::cframe, copy_v2_v2(), DEG_id_tag_update(), tGPDprimitive::depsgraph, bGPDstroke::dvert, ED_gpencil_stroke_close_by_distance(), ED_gpencil_stroke_extremes_to2d(), ED_gpencil_stroke_join_and_trim(), ED_gpencil_stroke_nearest_to_ends(), ED_workspace_status_text(), ELEM, ListBase::first, GP_GETFRAME_ADD_COPY, GP_GETFRAME_ADD_NEW, GP_GETFRAME_USE_PREV, GP_STROKE_ARC, GP_STROKE_CURVE, GP_STROKE_LINE, GP_STROKE_POLYLINE, GP_TOOL_FLAG_AUTOMERGE_STROKE, GP_TOOL_FLAG_CREATE_WEIGHTS, GP_TOOL_FLAG_PAINT_ONBACK, GP_TOOL_FLAG_RETAIN_LAST, tGPDprimitive::gpd, ToolSettings::gpencil_flags, GPENCIL_MINIMUM_JOIN_DIST, GPENCIL_MULTIEDIT_SESSIONS_ON, gpencil_primitive_exit(), Brush::gpencil_settings, tGPDprimitive::gpf, tGPDprimitive::gpl, tGPDprimitive::gsc, BrushGpencilSettings::hardeness, bGPDstroke::hardeness, bGPdata::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, IS_AUTOKEY_ON, NULL, tGPDprimitive::ob, bGPDstroke::prev, tGPDprimitive::scene, Brush::size, bGPDframe::strokes, bGPDstroke::thickness, Scene::toolsettings, bGPDstroke::totpoints, tGPDprimitive::type, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, ToolSettings::vgroup_weight, MDeformWeight::weight, and WM_cursor_modal_restore().

Referenced by gpencil_primitive_modal().

◆ gpencil_primitive_invoke()

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

◆ gpencil_primitive_line()

static void gpencil_primitive_line ( tGPDprimitive tgpi,
tGPspoint points2D,
bool  editable 
)
static

◆ gpencil_primitive_modal()

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

Definition at line 1616 of file gpencil_primitive.c.

References applyNumInput(), ATTR_FALLTHROUGH, tGPDprimitive::brush_size, tGPDprimitive::brush_strength, C, CLAMP, copy_v2_v2(), copy_v2fl_v2i(), CTX_wm_window(), tGPDprimitive::curve, wmOperator::customdata, ED_workspace_status_text(), ELEM, tGPDprimitive::end, EVT_CKEY, EVT_ESCKEY, EVT_FKEY, EVT_GKEY, EVT_PADENTER, EVT_PADMINUS, EVT_PADPLUSKEY, EVT_RETKEY, EVT_SPACEKEY, EVT_TABKEY, tGPDprimitive::flag, GP_STROKE_ARC, GP_STROKE_BOX, GP_STROKE_CURVE, GP_STROKE_LINE, GP_STROKE_POLYLINE, gpencil_primitive_add_segment(), gpencil_primitive_constrain(), gpencil_primitive_edit_event_handling(), gpencil_primitive_exit(), gpencil_primitive_interaction_begin(), gpencil_primitive_interaction_end(), gpencil_primitive_move(), gpencil_primitive_size(), gpencil_primitive_strength(), gpencil_primitive_update(), gpencil_primitive_update_cps(), gpencil_primitive_update_strokes(), handleNumInput(), hasNumInput(), IDLE, IN_BRUSH_SIZE, IN_BRUSH_STRENGTH, IN_CURVE_EDIT, IN_MOVE, IN_POLYLINE, IN_PROGRESS, KM_ALT, KM_PRESS, KM_RELEASE, KM_SHIFT, LEFTMOUSE, MAX_EDGES, MIDDLEMOUSE, MIN_EDGES, wmEvent::modifier, MOUSEMOVE, tGPDprimitive::move, tGPDprimitive::mval, wmEvent::mval, tGPDprimitive::mvalo, NULL, tGPDprimitive::num, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, tGPDprimitive::origin, tGPDprimitive::orign_type, tGPDprimitive::prev_flag, wmOperator::ptr, RIGHTMOUSE, RNA_enum_set(), RNA_int_set(), tGPDprimitive::start, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, tGPDprimitive::type, wmEvent::type, wmEvent::val, WHEELDOWNMOUSE, WHEELUPMOUSE, WM_CURSOR_CROSS, WM_cursor_modal_restore(), WM_cursor_modal_set(), WM_CURSOR_NS_SCROLL, WM_CURSOR_NSEW_SCROLL, and zero_v2().

Referenced by GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), and GPENCIL_OT_primitive_polyline().

◆ gpencil_primitive_move()

static void gpencil_primitive_move ( tGPDprimitive tgpi,
bool  reset 
)
static

◆ gpencil_primitive_rectangle()

static void gpencil_primitive_rectangle ( tGPDprimitive tgpi,
tGPspoint points2D 
)
static

◆ gpencil_primitive_rotate_line()

static void gpencil_primitive_rotate_line ( float  va[2],
float  vb[2],
const float  a[2],
const float  b[2],
const float  angle 
)
static

◆ gpencil_primitive_set_cp()

static void gpencil_primitive_set_cp ( tGPDprimitive tgpi,
const float  p[2],
float  color[4],
int  size 
)
static

◆ gpencil_primitive_set_initdata()

static void gpencil_primitive_set_initdata ( bContext C,
tGPDprimitive tgpi 
)
static

◆ gpencil_primitive_size()

static void gpencil_primitive_size ( tGPDprimitive tgpi,
bool  reset 
)
static

◆ gpencil_primitive_status_indicators()

static void gpencil_primitive_status_indicators ( bContext C,
tGPDprimitive tgpi 
)
static

◆ gpencil_primitive_strength()

static void gpencil_primitive_strength ( tGPDprimitive tgpi,
bool  reset 
)
static

◆ gpencil_primitive_to_square()

static void gpencil_primitive_to_square ( tGPDprimitive tgpi,
const float  x,
const float  y 
)
static

Definition at line 146 of file gpencil_primitive.c.

References tGPDprimitive::end, fabsf, tGPDprimitive::origin, w(), x, and y.

Referenced by gpencil_primitive_constrain().

◆ gpencil_primitive_update()

static void gpencil_primitive_update ( bContext C,
wmOperator op,
tGPDprimitive tgpi 
)
static

◆ gpencil_primitive_update_cps()

static void gpencil_primitive_update_cps ( tGPDprimitive tgpi)
static

◆ gpencil_primitive_update_strokes()

static void gpencil_primitive_update_strokes ( bContext C,
tGPDprimitive tgpi 
)
static

Definition at line 698 of file gpencil_primitive.c.

References add_v2_v2(), BKE_curvemapping_evaluateF(), BKE_curvemapping_init(), BKE_gpencil_stroke_geometry_update(), BLI_rng_get_float(), bool, tGPDprimitive::brush, C, CLAMP, copy_v2_v2(), copy_v2_v2_int(), bGPdata_Runtime::cp_points, GP_Sculpt_Settings::cur_primitive, BrushGpencilSettings::curve_jitter, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_strength, DEG_id_tag_update(), tGPDprimitive::depsgraph, DEPTH_INVALID, tGPDprimitive::depths, BrushGpencilSettings::draw_jitter, BrushGpencilSettings::draw_random_press, BrushGpencilSettings::draw_random_strength, BrushGpencilSettings::draw_strength, bGPDstroke::dvert, MDeformVert::dw, ED_gpencil_drawing_reference_get(), ED_gpencil_point_vertex_color_set(), ED_gpencil_project_point_to_plane(), ED_gpencil_project_stroke_to_plane(), ED_gpencil_project_stroke_to_view(), ED_gpencil_sbuffer_ensure(), ED_gpencil_sbuffer_update_eval(), ED_gpencil_sbuffer_vertex_color_set(), ED_gpencil_tpoint_to_point(), ED_view3d_depth_override(), ED_view3d_depth_read_cached(), ED_view3d_depth_read_cached_seg(), ELEM, ListBase::first, BrushGpencilSettings::flag, bGPDspoint::flag, GP_Sculpt_Settings::flag, BrushGpencilSettings::flag2, float(), GP_BRUSH_GROUP_RANDOM, GP_BRUSH_USE_JITTER_PRESSURE, GP_BRUSH_USE_PRESS_AT_STROKE, GP_BRUSH_USE_PRESSURE_RAND_PRESS, GP_BRUSH_USE_STRENGTH_AT_STROKE, GP_BRUSH_USE_STRENGTH_PRESSURE, GP_BRUSH_USE_STRENGTH_RAND_PRESS, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_STROKE_ENDPOINTS, GP_PROJECT_DEPTH_STROKE_FIRST, GP_PROJECT_DEPTH_VIEW, GP_PROJECT_VIEWSPACE, ToolSettings::gp_sculpt, GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE, GP_STROKE_ARC, GP_STROKE_BOX, GP_STROKE_CIRCLE, GP_STROKE_CURVE, GP_STROKE_LINE, GP_STROKE_POLYLINE, tGPDprimitive::gpd, gpencil_apply_parent_point(), gpencil_init_colors(), gpencil_primitive_arc(), gpencil_primitive_bezier(), gpencil_primitive_circle(), gpencil_primitive_line(), gpencil_primitive_rectangle(), gpencil_session_validatebuffer(), Brush::gpencil_settings, GPENCIL_STRENGTH_MIN, gpencil_stroke_convertcoords_tpoint(), ToolSettings::gpencil_v3d_align, tGPDprimitive::gpf, tGPDprimitive::gpl, GpRandomSettings::hsv, bGPdata::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, interp_sparse_array(), len_v3v3(), tGPDprimitive::lock_axis, GP_Sculpt_Settings::lock_axis, tGPspoint::m_xy, tGPDprimitive::material, MEM_mallocN, MEM_SAFE_FREE, mul_v2_fl(), NA_EDITED, NC_GPENCIL, normalize_v2(), NULL, tGPDprimitive::ob, tGPDprimitive::ob_eval, RegionView3D::persp, tGPDprimitive::points, bGPDstroke::points, GpRandomSettings::pressure, tGPspoint::pressure, bGPDspoint::pressure, tGPDprimitive::random_settings, tGPDprimitive::region, tGPspoint::rnd, tGPspoint::rnd_dirty, tGPDprimitive::rng, round_v2i_v2fl(), bGPdata::runtime, tGPDprimitive::rv3d, RV3D_CAMOB, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, tGPDprimitive::scene, square_f(), GpRandomSettings::strength, tGPspoint::strength, bGPDspoint::strength, bGPDframe::strokes, sub_v2_v2v2(), tGPspoint::time, bGPDspoint::time, Scene::toolsettings, bGPdata_Runtime::tot_cp_points, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, tGPDprimitive::totpixlen, bGPDstroke::totpoints, MDeformVert::totweight, tGPDprimitive::type, tGPspoint::uv_fac, bGPDspoint::uv_fac, tGPspoint::uv_rot, bGPDspoint::uv_rot, tGPDprimitive::v3d, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), tGPDprimitive::win, WM_event_add_notifier(), bGPDcontrolpoint::x, bGPDspoint::x, bGPdata::zdepth_offset, and zero_v2().

Referenced by gpencil_primitive_modal(), and gpencil_primitive_update().

◆ gpencil_rotate_v2_v2v2fl()

static void gpencil_rotate_v2_v2v2fl ( float  v[2],
const float  p[2],
const float  origin[2],
const float  angle 
)
static

Definition at line 192 of file gpencil_primitive.c.

References add_v2_v2v2(), angle(), r, rotate_v2_v2fl(), sub_v2_v2v2(), and v.

Referenced by gpencil_primitive_rotate_line().

◆ gpencil_session_validatebuffer()

static void gpencil_session_validatebuffer ( tGPDprimitive p)
static

Variable Documentation

◆ gpencil_primitive_type

const EnumPropertyItem gpencil_primitive_type[]
static
Initial value:
= {
{GP_STROKE_BOX, "BOX", 0, "Box", ""},
{GP_STROKE_LINE, "LINE", 0, "Line", ""},
{GP_STROKE_POLYLINE, "POLYLINE", 0, "Polyline", ""},
{GP_STROKE_CIRCLE, "CIRCLE", 0, "Circle", ""},
{GP_STROKE_ARC, "ARC", 0, "Arc", ""},
{GP_STROKE_CURVE, "CURVE", 0, "Curve", ""},
{0, NULL, 0, NULL, NULL},
}
@ GP_STROKE_POLYLINE
@ GP_STROKE_CURVE
@ GP_STROKE_ARC
@ GP_STROKE_CIRCLE
@ GP_STROKE_LINE
@ GP_STROKE_BOX

Definition at line 97 of file gpencil_primitive.c.

Referenced by gpencil_primitive_common_props().