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_hash.h"
#include "BLI_math.h"
#include "BLI_math_geom.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_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_windowmanager_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_curve.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_update_cache.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "BKE_tracking.h"
#include "UI_view2d.h"
#include "ED_clip.h"
#include "ED_gpencil.h"
#include "ED_keyframing.h"
#include "ED_object.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 "DEG_depsgraph_query.h"
#include "gpencil_intern.h"
Go to the source code of this file.
Classes | |
struct | tGPguide |
struct | tGPsdata |
Macros | |
#define | STROKE_HORIZONTAL 1 |
#define | STROKE_VERTICAL 2 |
#define | MIN_MANHATTEN_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 tGPguide | tGPguide |
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 [] |
#define MIN_EUCLIDEAN_PX (U.gp_euclideandist) |
Definition at line 263 of file gpencil_paint.c.
#define MIN_MANHATTEN_PX (U.gp_manhattandist) |
Definition at line 261 of file gpencil_paint.c.
#define STROKE_HORIZONTAL 1 |
Definition at line 256 of file gpencil_paint.c.
#define STROKE_VERTICAL 2 |
Definition at line 257 of file gpencil_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 89 of file gpencil_paint.c.
enum eGPencil_PaintFlags |
Definition at line 97 of file gpencil_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 81 of file gpencil_paint.c.
Definition at line 3334 of file gpencil_paint.c.
References Freestyle::a, add_v2_v2v2(), angle(), angle_v2v2(), tGPsdata::brush, CLAMP, copy_v2_v2(), cosf, DEG2RADF, dot_v2v2(), BrushGpencilSettings::draw_angle_factor, ED_gpencil_sbuffer_ensure(), float(), tGPsdata::gpd, gpencil_apply_randomness(), gpencil_brush_angle_segment(), Brush::gpencil_settings, interp_v2_v2v2(), interp_v4_v4v4(), l, len_squared_v2(), M_PI_2, tGPspoint::m_xy, mid_v2_v2v2(), blender::math::midpoint(), mul_v2_fl(), NULL, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, sinf, sub_v2_v2(), and sub_v2_v2v2().
Referenced by gpencil_add_fake_points().
Add fake points for missing mouse movements when the artist draw very fast creating an arc with the vertex in the middle of the segment and using the angle of the previous segment.
Definition at line 3504 of file gpencil_paint.c.
References tGPsdata::brush, copy_v2_v2(), copy_v2fl_v2i(), tGPsdata::disable_stabilizer, GP_GUIDE_CIRCULAR, GP_MAX_INPUT_SAMPLES, ToolSettings::gp_sculpt, GPAINT_TOOL_DRAW, gpencil_add_arc_points(), gpencil_add_guide_points(), GPENCIL_LAZY_MODE, Brush::gpencil_settings, gpencil_snap_to_guide(), Brush::gpencil_tool, GP_Sculpt_Settings::guide, BrushGpencilSettings::input_samples, len_v2v2(), mid_v2_v2v2(), wmEvent::mval, tGPsdata::mvalo, tGPsdata::scene, tGPsdata::shift, Scene::toolsettings, GP_Sculpt_Guide::type, and GP_Sculpt_Guide::use_guide.
Referenced by gpencil_draw_modal().
|
static |
Definition at line 3432 of file gpencil_paint.c.
References Freestyle::a, angle(), angle_v2v2v2(), copy_v4_v4(), cross_tri_v2(), ED_gpencil_sbuffer_ensure(), float(), GP_GUIDE_CIRCULAR, tGPsdata::gpd, gpencil_rotate_v2_v2v2fl(), gpencil_snap_to_guide(), tGPsdata::guide, if(), interp_v2_v2v2(), NULL, tGPguide::origin, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, and GP_Sculpt_Guide::type.
Referenced by gpencil_add_fake_points().
|
static |
Definition at line 673 of file gpencil_paint.c.
References BKE_curvemapping_evaluateF(), BLI_hash_int_01(), BLI_hash_int_2d(), BLI_rng_get_float(), CLAMP, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::draw_random_press, BrushGpencilSettings::draw_random_strength, BrushGpencilSettings::flag2, GP_BRUSH_USE_PRESS_AT_STROKE, GP_BRUSH_USE_PRESSURE_RAND_PRESS, GP_BRUSH_USE_STRENGTH_AT_STROKE, GP_BRUSH_USE_STRENGTH_RAND_PRESS, GP_BRUSH_USE_UV_AT_STROKE, GP_BRUSH_USE_UV_RAND_PRESS, tGPsdata::gpd, GPENCIL_STRENGTH_MIN, M_PI_2, tGPspoint::m_xy, GpRandomSettings::pen_press, GpRandomSettings::pressure, tGPspoint::pressure, tGPsdata::random_settings, tGPsdata::rng, bGPdata::runtime, bGPdata_Runtime::sbuffer_used, GpRandomSettings::strength, tGPspoint::strength, GpRandomSettings::uv, BrushGpencilSettings::uv_random, and tGPspoint::uv_rot.
Referenced by gpencil_add_arc_points(), and gpencil_stroke_addpoint().
Definition at line 3269 of file gpencil_paint.c.
References bScreen::areabase, BLI_findindex(), C, and CTX_wm_screen().
Referenced by gpencil_draw_modal().
|
static |
Definition at line 497 of file gpencil_paint.c.
References angle(), CLAMP, KDL::cos(), dot_v2v2(), BrushGpencilSettings::draw_angle, BrushGpencilSettings::draw_angle_factor, fabs(), GPENCIL_ALPHA_OPACITY_THRESH, Brush::gpencil_settings, interpf(), normalize_v2(), tGPspoint::pressure, bGPdata::runtime, bGPdata_Runtime::sbuffer_used, KDL::sin(), and sub_v2_v2v2().
Referenced by gpencil_stroke_addpoint().
|
static |
Definition at line 3301 of file gpencil_paint.c.
References angle(), tGPsdata::brush, CLAMP, KDL::cos(), dot_v2v2(), BrushGpencilSettings::draw_angle, BrushGpencilSettings::draw_angle_factor, fabs(), GPENCIL_ALPHA_OPACITY_THRESH, Brush::gpencil_settings, interpf(), tGPspoint::m_xy, normalize_v2(), tGPspoint::pressure, KDL::sin(), and sub_v2_v2v2().
Referenced by gpencil_add_arc_points().
Definition at line 475 of file gpencil_paint.c.
References angle(), angle_v2v2(), KDL::cos(), tGPspoint::m_xy, madd_v2_v2fl(), normalize_v2(), bGPdata::runtime, bGPdata_Runtime::sbuffer_used, KDL::sin(), and sub_v2_v2v2().
Referenced by gpencil_stroke_addpoint().
|
static |
Definition at line 2738 of file gpencil_paint.c.
References BKE_report(), tGPsdata::brush, C, copy_v2_v2(), tGPsdata::curtime, depsgraph, tGPsdata::disable_stabilizer, ED_gpencil_toggle_brush_cursor(), ELEM, BrushGpencilSettings::flag, GP_BRUSH_STABILIZE_MOUSE_TEMP, GP_PAINTMODE_ERASER, ToolSettings::gp_sculpt, GP_STATUS_ERROR, GP_STROKEADD_FULL, GP_STROKEADD_INVALID, GP_STROKEADD_OVERFLOW, GPAINT_TOOL_DRAW, tGPsdata::gpd, GPENCIL_LAZY_MODE, gpencil_paint_initstroke(), gpencil_paint_strokeend(), Brush::gpencil_settings, gpencil_snap_to_guide(), gpencil_stroke_addpoint(), gpencil_stroke_doeraser(), gpencil_stroke_filtermval(), Brush::gpencil_tool, GP_Sculpt_Settings::guide, if(), tGPsdata::inittime, interp_v2_v2v2(), tGPspoint::m_xy, tGPsdata::mval, tGPsdata::mvalo, NULL, tGPsdata::ocurtime, tGPsdata::opressure, tGPsdata::paintmode, tGPsdata::pressure, wmOperator::reports, RPT_ERROR, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, tGPsdata::shift, Brush::smooth_stroke_factor, tGPsdata::status, Scene::toolsettings, and GP_Sculpt_Guide::use_guide.
Referenced by gpencil_draw_apply_event(), and gpencil_draw_exec().
|
static |
Definition at line 2823 of file gpencil_paint.c.
References wmTabletData::active, GP_Sculpt_Guide::angle, atan2f, tGPsdata::brush, C, copy_v2_v2(), copy_v2fl_v2i(), tGPsdata::curtime, wmOperator::customdata, DEG2RAD, depsgraph, ED_region_tag_redraw(), ELEM, EVT_TABLET_ERASER, EVT_TABLET_NONE, fabsf, tGPsdata::flags, GP_GUIDE_GRID, GP_GUIDE_ISO, GP_PAINTFLAG_FIRSTRUN, GP_PAINTFLAG_HARD_ERASER, GP_PAINTFLAG_REQ_VECTOR, GP_PAINTFLAG_STROKE_ERASER, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP, ToolSettings::gp_sculpt, GPAINT_TOOL_DRAW, gpencil_draw_apply(), gpencil_rotate_v2_v2v2fl(), gpencil_snap_to_guide(), gpencil_speed_guide_init(), Brush::gpencil_tool, tGPsdata::guide, GP_Sculpt_Settings::guide, tGPsdata::inittime, KM_ALT, KM_SHIFT, M_PI_2, wmEvent::modifier, tGPsdata::mval, wmEvent::mval, tGPsdata::mvali, tGPsdata::mvalo, tGPsdata::ocurtime, tGPsdata::opressure, tGPsdata::paintmode, GpRandomSettings::pen_press, PIL_check_seconds_timer(), pow(), tGPsdata::pressure, wmOperator::ptr, tGPsdata::random_settings, tGPsdata::region, RNA_boolean_get(), RNA_boolean_set(), RNA_collection_add(), RNA_float_set(), RNA_float_set_array(), tGPguide::rot_angle, tGPguide::rot_point, tGPsdata::scene, tGPsdata::shift, tGPsdata::straight, tGPguide::stroke_angle, STROKE_HORIZONTAL, STROKE_VERTICAL, sub_v2_v2v2(), wmEvent::tablet, Scene::toolsettings, GP_Sculpt_Guide::type, tGPguide::unit, GP_Sculpt_Guide::use_guide, and GP_Sculpt_Guide::use_snapping.
Referenced by gpencil_draw_invoke(), and gpencil_draw_modal().
|
static |
Definition at line 2450 of file gpencil_paint.c.
References C, and gpencil_draw_exit().
Referenced by GPENCIL_OT_draw().
Definition at line 2340 of file gpencil_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 gpencil_draw_toggle_eraser_cursor().
|
static |
Definition at line 3004 of file gpencil_paint.c.
References C, CTX_data_ensure_evaluated_depsgraph(), tGPsdata::curtime, wmOperator::customdata, depsgraph, double(), tGPsdata::flags, GP_PAINTFLAG_FIRSTRUN, gpencil_draw_apply(), gpencil_draw_exit(), gpencil_draw_init(), gpencil_paint_initstroke(), gpencil_paint_strokeend(), tGPsdata::inittime, MEM_SAFE_FREE, 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_draw().
|
static |
Definition at line 2410 of file gpencil_paint.c.
References C, CTX_data_gpencil_data(), wmOperator::customdata, ED_gpencil_toggle_brush_cursor(), tGPsdata::eraser, GP_PAINTMODE_ERASER, gpencil_draw_toggle_eraser_cursor(), gpencil_paint_cleanup(), gpencil_session_cleanup(), gpencil_session_free(), gpencil_undo_finish(), gpencil_update_cache(), NULL, tGPsdata::paintmode, tGPsdata::radius, and Brush::size.
Referenced by gpencil_draw_cancel(), gpencil_draw_exec(), gpencil_draw_init(), and gpencil_draw_modal().
|
static |
Definition at line 2458 of file gpencil_paint.c.
References BKE_paint_brush(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_tool_settings(), wmOperator::customdata, ToolSettings::gp_paint, GP_PAINTMODE_ERASER, GP_STATUS_ERROR, GPAINT_TOOL_ERASE, gpencil_draw_exit(), gpencil_paint_initstroke(), gpencil_session_initpaint(), Brush::gpencil_tool, tGPsdata::keymodifier, NULL, GpPaint::paint, wmOperator::ptr, tGPsdata::reports, wmOperator::reports, RNA_enum_get(), and tGPsdata::status.
Referenced by gpencil_draw_exec(), and gpencil_draw_invoke().
|
static |
Definition at line 3165 of file gpencil_paint.c.
References BKE_gpencil_layer_is_editable(), BKE_report(), tGPsdata::brush, C, CTX_data_active_gpencil_layer(), CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, Object::data, ED_gpencil_init_random_settings(), ED_gpencil_toggle_brush_cursor(), ELEM, bGPDlayer::flag, bGPdata::flag, wmOperator::flag, GP_DATA_STROKE_EDITMODE, GP_DATA_STROKE_PAINTMODE, GP_DATA_STROKE_SCULPTMODE, GP_DATA_STROKE_WEIGHTMODE, GP_LAYER_HIDE, GP_LAYER_LOCKED, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP, GP_STATUS_PAINTING, tGPsdata::gpd, gpencil_draw_apply_event(), gpencil_draw_init(), gpencil_draw_toggle_eraser_cursor(), gpencil_guide_event_handling(), gpencil_is_tablet_eraser_active(), if(), bGPdata::layers, LISTBASE_FOREACH, MEM_freeN, Object::mode, wmEvent::mval, NA_EDITED, NC_GPENCIL, NC_SCENE, ND_MODE, NULL, OB_GPENCIL, OB_MODE_PAINT_GPENCIL, OP_IS_MODAL_CURSOR_REGION, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, tGPsdata::paintmode, wmOperator::ptr, tGPsdata::random_settings, wmOperator::reports, Object::restore_mode, RNA_boolean_get(), RNA_enum_get(), RNA_enum_set(), RPT_ERROR, tGPsdata::status, Object::type, WM_event_add_modal_handler(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_draw().
|
static |
Definition at line 3561 of file gpencil_paint.c.
References angle(), tGPsdata::area, atan2f, BKE_area_find_region_xy(), BLI_rcti_isect_pt_v(), tGPsdata::brush, C, CTX_data_depsgraph_pointer(), CTX_wm_region(), wmOperator::customdata, DEG_id_tag_update(), ED_gpencil_toggle_brush_cursor(), ED_region_tag_redraw(), ED_region_visible_rect(), ELEM, EVT_DOWNARROWKEY, 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_GUIDE_CIRCULAR, GP_PAINTFLAG_FIRSTRUN, GP_PAINTFLAG_REQ_VECTOR, GP_PAINTMODE_DRAW, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP, ToolSettings::gp_sculpt, GP_STATUS_DONE, GP_STATUS_ERROR, GP_STATUS_IDLING, GP_STATUS_PAINTING, GPAINT_TOOL_DRAW, tGPsdata::gpd, gpencil_add_fake_points(), gpencil_area_exists(), gpencil_draw_apply_event(), gpencil_draw_exit(), gpencil_draw_status_indicators(), gpencil_draw_toggle_eraser_cursor(), gpencil_guide_event_handling(), gpencil_is_tablet_eraser_active(), gpencil_origin_set(), gpencil_smooth_segment(), gpencil_stroke_begin(), Brush::gpencil_tool, GP_Sculpt_Settings::guide, Scene::id, ID_RECALC_COPY_ON_WRITE, ISKEYBOARD, ISMOUSE_MOTION, KM_CTRL, KM_PRESS, KM_RELEASE, LEFTMOUSE, wmEvent::modifier, tGPsdata::mval, wmEvent::mval, tGPsdata::mvali, 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, r, tGPsdata::radius, tGPsdata::region, ARegion::regiontype, RGN_TYPE_ANY, RGN_TYPE_TOOLS, RIGHTMOUSE, RNA_enum_get(), RNA_float_set(), bGPdata::runtime, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, tGPsdata::status, tGPsdata::straight, sub_v2_v2v2(), Scene::toolsettings, GP_Sculpt_Guide::type, wmEvent::type, GP_Sculpt_Guide::use_guide, wmEvent::val, WHEELDOWNMOUSE, WHEELUPMOUSE, tGPsdata::win, WM_cursor_modal_restore(), WM_cursor_modal_set(), WM_CURSOR_NSEW_SCROLL, WM_event_add_notifier(), xy, and wmEvent::xy.
Referenced by GPENCIL_OT_draw().
Definition at line 282 of file gpencil_paint.c.
References blender::compositor::area(), Paint::brush, C, CTX_data_active_object(), CTX_data_scene(), CTX_wm_area(), CTX_wm_operator_poll_msg_set(), Object::data, ED_gpencil_session_active(), ED_operator_regionactive(), ToolSettings::gp_paint, GPENCIL_PAINT_MODE, if(), NULL, OB_GPENCIL, GpPaint::paint, SPACE_VIEW3D, Scene::toolsettings, and Object::type.
Referenced by GPENCIL_OT_draw().
Definition at line 2503 of file gpencil_paint.c.
References C, ED_workspace_status_text(), GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_STRAIGHT, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP, ToolSettings::gp_sculpt, GP_STATUS_DONE, GP_STATUS_ERROR, GP_STATUS_IDLING, GP_STATUS_PAINTING, GP_Sculpt_Settings::guide, NULL, tGPsdata::paintmode, tGPsdata::scene, tGPsdata::status, TIP_, Scene::toolsettings, and GP_Sculpt_Guide::use_guide.
Referenced by gpencil_draw_modal().
Definition at line 2384 of file gpencil_paint.c.
References tGPsdata::C, ED_gpencil_toggle_brush_cursor(), tGPsdata::erasercursor, gpencil_draw_eraser(), NULL, RGN_TYPE_ANY, SPACE_TYPE_ANY, WM_paint_cursor_activate(), and WM_paint_cursor_end().
Referenced by gpencil_draw_exit(), gpencil_draw_invoke(), and gpencil_draw_modal().
|
static |
Definition at line 1405 of file gpencil_paint.c.
References BKE_gpencil_free_stroke_weights(), BLI_freelinkN(), bGPDstroke::dvert, gpencil_update_cache(), MEM_freeN, bGPDstroke::points, bGPDframe::strokes, and bGPDstroke::triangles.
Referenced by gpencil_stroke_eraser_dostroke().
Definition at line 335 of file gpencil_paint.c.
References tGPsdata::align_flag, PointerRNA::data, ED_gpencil_drawing_reference_get(), NULL, tGPsdata::ownerPtr, tGPsdata::scene, and PointerRNA::type.
Referenced by gpencil_reproject_toplane(), gpencil_speed_guide_init(), gpencil_stroke_addpoint(), and gpencil_stroke_convertcoords().
|
static |
Definition at line 1827 of file gpencil_paint.c.
References BKE_brush_add_gpencil(), BKE_paint_brush_set(), Paint::brush, Main::brushes, BrushGpencilSettings::eraser_mode, ListBase::first, BrushGpencilSettings::flag, GP_BRUSH_DEFAULT_ERASER, GP_BRUSH_ERASER_SOFT, GP_BRUSH_ICON_ERASE_SOFT, ToolSettings::gp_paint, GPAINT_TOOL_ERASE, Brush::gpencil_settings, Brush::gpencil_tool, BrushGpencilSettings::icon_id, NULL, OB_MODE_PAINT_GPENCIL, GpPaint::paint, and Brush::size.
Referenced by gpencil_init_drawing_brush().
|
static |
Definition at line 3069 of file gpencil_paint.c.
References angle(), GP_Sculpt_Guide::angle, angle_compat_rad(), C, ED_gpencil_toggle_brush_cursor(), ELEM, EVT_CKEY, EVT_JKEY, EVT_KKEY, EVT_LKEY, EVT_MKEY, EVT_OKEY, EVT_VKEY, float(), GP_GUIDE_CIRCULAR, GP_GUIDE_PARALLEL, GP_GUIDE_RADIAL, GP_GUIDE_REF_OBJECT, GP_PAINTMODE_DRAW, GP_PAINTMODE_SET_CP, ToolSettings::gp_sculpt, GP_Sculpt_Settings::guide, KM_ALT, KM_CTRL, KM_RELEASE, KM_SHIFT, M_PI, M_PI_2, wmEvent::modifier, NA_EDITED, NC_GPENCIL, NC_SCENE, ND_TOOLSETTINGS, NULL, tGPsdata::paintmode, wmOperator::ptr, GP_Sculpt_Guide::reference_point, RNA_float_get(), tGPsdata::scene, Scene::toolsettings, GP_Sculpt_Guide::type, wmEvent::type, GP_Sculpt_Guide::use_guide, wmEvent::val, and WM_event_add_notifier().
Referenced by gpencil_draw_invoke(), and gpencil_draw_modal().
|
static |
Definition at line 3940 of file gpencil_paint.c.
References angle(), GP_Sculpt_Guide::angle, angle_compat_rad(), C, CTX_data_tool_settings(), ToolSettings::gp_sculpt, GP_Sculpt_Settings::guide, M_PI, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), and RNA_float_get().
Referenced by GPENCIL_OT_guide_rotate().
Definition at line 1933 of file gpencil_paint.c.
References BKE_gpencil_object_material_ensure_from_active_input_brush(), BKE_object_material_slot_find_index(), tGPsdata::bmain, tGPsdata::brush, tGPsdata::gpd, tGPsdata::material, bGPdata_Runtime::matid, tGPsdata::ob, bGPdata::runtime, and bGPdata_Runtime::sbuffer_brush.
Referenced by gpencil_session_initdata().
Definition at line 1887 of file gpencil_paint.c.
References BKE_brush_gpencil_paint_presets(), BKE_curvemapping_init(), tGPsdata::bmain, tGPsdata::brush, Paint::brush, C, CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), BrushGpencilSettings::curve_jitter, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, DEG_id_tag_update(), tGPsdata::eraser, ToolSettings::gp_paint, GPAINT_TOOL_ERASE, gpencil_get_default_eraser(), gpencil_set_default_eraser(), Brush::gpencil_settings, Brush::gpencil_tool, Scene::id, ID_RECALC_COPY_ON_WRITE, if(), NULL, GpPaint::paint, tGPsdata::radius, scene, and Brush::size.
Referenced by gpencil_session_initdata().
Definition at line 2403 of file gpencil_paint.c.
References wmTabletData::active, EVT_TABLET_ERASER, and wmEvent::tablet.
Referenced by gpencil_draw_invoke(), and gpencil_draw_modal().
Definition at line 2620 of file gpencil_paint.c.
References copy_v3_v3(), Scene::cursor, GP_GUIDE_REF_CUSTOM, GP_GUIDE_REF_OBJECT, ToolSettings::gp_sculpt, tGPsdata::gpd, gpencil_point_3d_to_xy(), tGPsdata::gsc, GP_Sculpt_Settings::guide, Object::loc, GP_Sculpt_Guide::location, View3DCursor::location, NULL, GP_Sculpt_Guide::reference_object, GP_Sculpt_Guide::reference_point, bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, tGPsdata::scene, and Scene::toolsettings.
Referenced by gpencil_speed_guide_init().
|
static |
Definition at line 2603 of file gpencil_paint.c.
References copy_v2fl_v2i(), copy_v3_v3(), Scene::cursor, wmOperator::customdata, GP_GUIDE_REF_CURSOR, GP_GUIDE_REF_CUSTOM, ToolSettings::gp_sculpt, gpencil_stroke_convertcoords(), GP_Sculpt_Settings::guide, GP_Sculpt_Guide::location, View3DCursor::location, NULL, point, GP_Sculpt_Guide::reference_point, tGPsdata::scene, and Scene::toolsettings.
Referenced by gpencil_draw_modal().
void GPENCIL_OT_draw | ( | wmOperatorType * | ot | ) |
Definition at line 3877 of file gpencil_paint.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_draw_cancel(), gpencil_draw_exec(), gpencil_draw_invoke(), gpencil_draw_modal(), gpencil_draw_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, prop_gpencil_drawmodes, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_collection_runtime(), RNA_def_enum(), RNA_def_float(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_guide_rotate | ( | wmOperatorType * | ot | ) |
Definition at line 3958 of file gpencil_paint.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_guide_rotate(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_float(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
Definition at line 2322 of file gpencil_paint.c.
References bGPDframe::flag, GP_FRAME_PAINT, tGPsdata::gpd, gpencil_paint_strokeend(), and tGPsdata::gpf.
Referenced by gpencil_draw_exit().
|
static |
Definition at line 2111 of file gpencil_paint.c.
References bGPDlayer::actframe, tGPsdata::align_flag, tGPsdata::area, GP_SpaceConversion::area, BKE_gpencil_layer_active_get(), BKE_gpencil_layer_addnew(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_is_editable(), BKE_gpencil_tag_full_update(), BKE_report(), RenderData::cfra, bGPDlayer::color, copy_m4_m4(), copy_v3_v3(), tGPsdata::custom_color, Object::data, DATA_, DEG_id_tag_update(), depsgraph, tGPsdata::disable_fill, ED_view3d_calc_camera_border(), ListBase::first, bGPDframe::flag, bGPDlayer::flag, tGPsdata::flags, GP_FRAME_PAINT, GP_GETFRAME_ADD_COPY, GP_GETFRAME_ADD_NEW, GP_GETFRAME_USE_PREV, GP_LAYER_LOCKED, GP_PAINTFLAG_FIRSTRUN, GP_PAINTMODE_ERASER, GP_PROJECT_VIEWSPACE, GP_STATUS_ERROR, GP_STROKE_3DSPACE, GP_STROKE_ERASER, GP_STROKE_NOFILL, GP_TOOL_FLAG_RETAIN_LAST, tGPsdata::gpd, GP_SpaceConversion::gpd, ToolSettings::gpencil_flags, gpencil_update_cache(), tGPsdata::gpf, tGPsdata::gpl, GP_SpaceConversion::gpl, tGPsdata::gsc, bGPdata::id, ID_RECALC_GEOMETRY, invert_m4_m4(), IS_AUTOKEY_ON, bGPDlayer::layer_invmat, bGPDlayer::layer_mat, bGPdata::layers, LISTBASE_FOREACH, loc_eul_size_to_mat4(), bGPDlayer::location, tGPsdata::mat, GP_SpaceConversion::mat, NULL, tGPsdata::ob_eval, tGPsdata::paintmode, RegionView3D::persp, Scene::r, tGPsdata::region, GP_SpaceConversion::region, ARegion::regiondata, tGPsdata::reports, bGPDlayer::rotation, RPT_INFO, bGPdata::runtime, RV3D_CAMOB, bGPdata_Runtime::sbuffer_brush, bGPdata_Runtime::sbuffer_sflag, bGPDlayer::scale, scene, tGPsdata::scene, ScrArea::spacedata, tGPsdata::status, tGPsdata::subrect, GP_SpaceConversion::subrect, tGPsdata::subrect_data, GP_SpaceConversion::subrect_data, Scene::toolsettings, tGPsdata::v2d, and GP_SpaceConversion::v2d.
Referenced by gpencil_draw_apply(), gpencil_draw_exec(), gpencil_draw_init(), and gpencil_stroke_begin().
Definition at line 2289 of file gpencil_paint.c.
References tGPsdata::area, tGPsdata::depsgraph, tGPsdata::depths, ED_view3d_depth_override(), ListBase::first, GP_PROJECT_DEPTH_STROKE, GP_STROKE_ERASER, tGPsdata::gpd, gpencil_project_check(), gpencil_session_validatebuffer(), gpencil_stroke_newfrombuffer(), ToolSettings::gpencil_v3d_align, 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 gpencil_draw_apply(), gpencil_draw_exec(), and gpencil_paint_cleanup().
Definition at line 322 of file gpencil_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 gpencil_paint_strokeend(), gpencil_stroke_convertcoords(), and gpencil_stroke_newfrombuffer().
|
static |
Definition at line 388 of file gpencil_paint.c.
References tGPsdata::align_flag, PointerRNA::data, ED_gpencil_project_stroke_to_plane(), GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_VIEW, GP_PROJECT_VIEWSPACE, GP_STROKE_3DSPACE, tGPsdata::gpd, gpencil_get_3d_reference(), tGPsdata::gpl, if(), tGPsdata::lock_axis, tGPsdata::ownerPtr, tGPsdata::region, ARegion::regiondata, bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, and tGPsdata::scene.
Referenced by gpencil_stroke_newfrombuffer().
|
static |
Definition at line 2567 of file gpencil_paint.c.
References add_v2_v2v2(), angle(), r, rotate_v2_v2fl(), sub_v2_v2v2(), and v.
Referenced by gpencil_add_guide_points(), gpencil_draw_apply_event(), gpencil_snap_to_rotated_grid_fl(), and gpencil_speed_guide_init().
Definition at line 2073 of file gpencil_paint.c.
References ED_gpencil_sbuffer_update_eval(), tGPsdata::gpd, if(), tGPsdata::inittime, MEM_SAFE_FREE, NULL, tGPsdata::ob_eval, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, and bGPdata_Runtime::sbuffer_used.
Referenced by gpencil_draw_exit().
Definition at line 2098 of file gpencil_paint.c.
References BLI_rng_free(), tGPsdata::depths, ED_view3d_depths_free(), MEM_freeN, NULL, and tGPsdata::rng.
Referenced by gpencil_draw_exit().
|
static |
Definition at line 1946 of file gpencil_paint.c.
References tGPsdata::align_flag, tGPsdata::area, BKE_gpencil_data_addnew(), tGPsdata::bmain, tGPsdata::C, C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), CTX_wm_window(), Scene::cursor, DEG_get_evaluated_object(), tGPsdata::depsgraph, tGPsdata::disable_fill, tGPsdata::disable_stabilizer, ED_gpencil_add_object(), ED_gpencil_data_get_pointers(), ED_gpencil_data_owner_is_annotation(), ListBase::first, GP_PROJECT_DEPTH_STROKE, GP_PROJECT_DEPTH_VIEW, ToolSettings::gp_sculpt, GP_STATUS_ERROR, tGPsdata::gpd, gpencil_init_colors(), gpencil_init_drawing_brush(), gpencil_session_validatebuffer(), ToolSettings::gpencil_v3d_align, tGPsdata::imat, View3D::local_view_uuid, View3D::localvd, View3DCursor::location, tGPsdata::lock_axis, GP_Sculpt_Settings::lock_axis, tGPsdata::mat, NC_SPACE, ND_SPACE_PROPERTIES, NULL, tGPsdata::ob, tGPsdata::ob_eval, OB_GPENCIL, tGPsdata::ownerPtr, wmOperator::ptr, tGPsdata::region, ARegion::regiondata, RNA_boolean_get(), tGPsdata::scene, ScrArea::spacedata, tGPsdata::status, Object::totcol, Object::type, unit_m4(), tGPsdata::win, and WM_event_add_notifier().
Referenced by gpencil_session_initpaint(), and gpencil_stroke_begin().
|
static |
Definition at line 2044 of file gpencil_paint.c.
References BLI_rng_new(), C, gpencil_session_initdata(), MEM_callocN, MEM_freeN, NULL, PIL_check_seconds_timer_i(), POINTER_AS_UINT, tGPsdata::rng, and UINT_MAX.
Referenced by gpencil_draw_init().
Definition at line 1805 of file gpencil_paint.c.
References tGPsdata::brush, ED_gpencil_sbuffer_ensure(), BrushGpencilSettings::flag, GP_BRUSH_STABILIZE_MOUSE_TEMP, tGPsdata::gpd, Brush::gpencil_settings, tGPsdata::inittime, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, and bGPdata_Runtime::sbuffer_used.
Referenced by gpencil_paint_strokeend(), and gpencil_session_initdata().
Definition at line 1868 of file gpencil_paint.c.
References Main::brushes, ListBase::first, GP_BRUSH_DEFAULT_ERASER, GPAINT_TOOL_ERASE, and NULL.
Referenced by gpencil_init_drawing_brush().
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 542 of file gpencil_paint.c.
References Freestyle::a, usdtokens::b(), Freestyle::c, copy_v2_v2(), ToolSettings::gp_sculpt, tGPsdata::gpd, GP_Sculpt_Settings::guide, interp_v2_v2v2(), interpf(), tGPspoint::m_xy, madd_v2_v2fl(), NULL, tGPspoint::pressure, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, steps, tGPspoint::strength, Scene::toolsettings, and GP_Sculpt_Guide::use_guide.
Referenced by gpencil_stroke_addpoint().
|
static |
Definition at line 606 of file gpencil_paint.c.
References interp_v2_v2v2(), interpf(), tGPspoint::m_xy, madd_v2_v2fl(), NULL, tGPspoint::pressure, bGPdata::runtime, bGPdata_Runtime::sbuffer, and tGPspoint::strength.
Referenced by gpencil_draw_modal().
Definition at line 2580 of file gpencil_paint.c.
Referenced by gpencil_snap_to_guide(), gpencil_snap_to_rotated_grid_fl(), and gpencil_speed_guide_init().
|
static |
Definition at line 2684 of file gpencil_paint.c.
References GP_Sculpt_Guide::angle, GP_Sculpt_Guide::angle_snap, closest_to_line_v2(), dist_ensure_v2_v2fl(), GP_GUIDE_CIRCULAR, GP_GUIDE_GRID, GP_GUIDE_ISO, GP_GUIDE_PARALLEL, GP_GUIDE_RADIAL, gpencil_snap_to_grid_fl(), gpencil_snap_to_rotated_grid_fl(), tGPsdata::guide, tGPsdata::mvali, tGPguide::origin, tGPguide::origin_distance, point, tGPguide::rot_angle, tGPguide::rot_point, tGPguide::spacing, GP_Sculpt_Guide::spacing, tGPsdata::straight, STROKE_HORIZONTAL, GP_Sculpt_Guide::type, and GP_Sculpt_Guide::use_snapping.
Referenced by gpencil_add_fake_points(), gpencil_add_guide_points(), gpencil_draw_apply(), and gpencil_draw_apply_event().
|
static |
Definition at line 2592 of file gpencil_paint.c.
References angle(), gpencil_rotate_v2_v2v2fl(), gpencil_snap_to_grid_fl(), and v.
Referenced by gpencil_snap_to_guide().
|
static |
Definition at line 2638 of file gpencil_paint.c.
References angle(), GP_Sculpt_Guide::angle, GP_Sculpt_Guide::angle_snap, atan2f, copy_v2_v2(), ELEM, fmodf, GP_GUIDE_RADIAL, gpencil_get_3d_reference(), gpencil_origin_get(), gpencil_rotate_v2_v2v2fl(), gpencil_snap_to_grid_fl(), tGPsdata::guide, tGPguide::half_spacing, RegionView3D::is_persp, len_v2v2(), M_PI, mul_m4_v3(), tGPsdata::mvali, tGPguide::origin, tGPguide::origin_angle, tGPguide::origin_distance, RegionView3D::persmat, RegionView3D::pixsize, tGPsdata::region, ARegion::regiondata, tGPguide::rot_point, tGPguide::spacing, GP_Sculpt_Guide::spacing, sub_v2_v2v2(), GP_Sculpt_Guide::type, tGPguide::unit, GP_Sculpt_Guide::use_snapping, and xy.
Referenced by gpencil_draw_apply_event().
|
static |
Definition at line 747 of file gpencil_paint.c.
References BrushGpencilSettings::active_smooth, BKE_curvemapping_evaluateF(), BLI_rng_get_float(), tGPsdata::brush, CLAMP, copy_v2_v2(), BrushGpencilSettings::curve_jitter, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, PointerRNA::data, tGPsdata::depsgraph, BrushGpencilSettings::draw_angle_factor, BrushGpencilSettings::draw_jitter, BrushGpencilSettings::draw_strength, ED_gpencil_project_point_to_plane(), ED_gpencil_sbuffer_ensure(), ED_gpencil_sbuffer_update_eval(), ED_gpencil_sbuffer_vertex_color_set(), ED_gpencil_tpoint_to_point(), BrushGpencilSettings::flag, float(), GP_BRUSH_GROUP_RANDOM, GP_BRUSH_USE_JITTER_PRESSURE, GP_BRUSH_USE_PRESSURE, GP_BRUSH_USE_STRENGTH_PRESSURE, GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_STRAIGHT, GP_STROKEADD_INVALID, GP_STROKEADD_NORMAL, tGPsdata::gpd, gpencil_apply_randomness(), gpencil_brush_angle(), gpencil_brush_jitter(), gpencil_get_3d_reference(), Brush::gpencil_settings, gpencil_smooth_buffer(), GPENCIL_STRENGTH_MIN, tGPsdata::gpl, GpRandomSettings::hsv, if(), tGPsdata::inittime, len_v3v3(), tGPsdata::lock_axis, tGPspoint::m_xy, tGPsdata::material, MIN2, NULL, tGPsdata::ob, tGPsdata::ob_eval, tGPsdata::ownerPtr, tGPsdata::paintmode, GpRandomSettings::pen_press, tGPspoint::pressure, tGPsdata::random_settings, tGPsdata::region, ARegion::regiondata, tGPsdata::rng, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, square_f(), tGPspoint::strength, tGPspoint::time, Scene::toolsettings, tGPsdata::totpixlen, tGPspoint::uv_fac, tGPspoint::uv_rot, and bGPDspoint::x.
Referenced by gpencil_draw_apply().
|
static |
Definition at line 3275 of file gpencil_paint.c.
References tGPsdata::area, C, CTX_data_depsgraph_pointer(), CTX_wm_area(), wmOperator::customdata, wmOperator::flag, GP_STATUS_ERROR, GP_STATUS_PAINTING, gpencil_paint_initstroke(), gpencil_session_initdata(), OP_IS_MODAL_CURSOR_REGION, tGPsdata::paintmode, and tGPsdata::status.
Referenced by gpencil_draw_modal().
|
static |
Definition at line 413 of file gpencil_paint.c.
References tGPsdata::align_flag, DEPTH_INVALID, ED_view3d_autodist_simple(), ED_view3d_calc_zfac(), ED_view3d_project_float_global(), ED_view3d_win_to_delta(), GP_PROJECT_DEPTH_VIEW, GP_STROKE_3DSPACE, tGPsdata::gpd, gpencil_get_3d_reference(), gpencil_project_check(), NULL, usdtokens::out(), tGPsdata::region, ARegion::regiondata, round_v2i_v2fl(), bGPdata::runtime, bGPdata_Runtime::sbuffer_sflag, sub_v2_v2v2(), sub_v3_v3v3(), V3D_PROJ_RET_OK, V3D_PROJ_TEST_NOP, bGPdata::zdepth_offset, and zero_v3().
Referenced by gpencil_origin_set(), and gpencil_stroke_newfrombuffer().
Definition at line 1712 of file gpencil_paint.c.
References tGPsdata::area, BKE_gpencil_layer_is_editable(), BKE_gpencil_layer_transform_matrix_get(), bool, tGPsdata::brush, CLAMP, tGPsdata::depsgraph, tGPsdata::depths, tGPsdata::diff_mat, ED_gpencil_stroke_can_use_direct(), ED_gpencil_stroke_check_collision(), ED_gpencil_stroke_material_editable(), ED_view3d_depth_override(), tGPsdata::eraser, ListBase::first, BrushGpencilSettings::flag, GP_BRUSH_OCCLUDE_ERASER, GP_BRUSH_USE_PRESSURE, GP_FRAME_SELECT, GPAINT_TOOL_ERASE, tGPsdata::gpd, GPENCIL_MULTIEDIT_SESSIONS_ON, Brush::gpencil_settings, gpencil_stroke_eraser_dostroke(), Brush::gpencil_tool, tGPsdata::gsc, if(), bGPdata::layers, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, tGPsdata::mval, bGPDframe::next, NULL, tGPsdata::ob, tGPsdata::pressure, tGPsdata::radius, tGPsdata::region, ScrArea::spacedata, V3D_DEPTH_NO_GPENCIL, view3d_region_operator_needs_opengl(), tGPsdata::win, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by gpencil_draw_apply().
|
static |
Definition at line 1378 of file gpencil_paint.c.
References tGPsdata::brush, CLAMP, blender::math::distance(), BrushGpencilSettings::draw_strength, BrushGpencilSettings::flag, float(), GP_BRUSH_USE_PRESSURE, Brush::gpencil_settings, len_v2v2_int(), tGPsdata::pressure, and round_v2i_v2fl().
Referenced by gpencil_stroke_eraser_dostroke().
|
static |
Definition at line 1463 of file gpencil_paint.c.
References BKE_gpencil_stroke_delete_tagged_points(), BLI_rcti_isect_pt(), CLAMP_MIN, copy_v2_v2_int(), tGPsdata::diff_mat, ELEM, BrushGpencilSettings::era_strength_f, BrushGpencilSettings::era_thickness_f, tGPsdata::eraser, BrushGpencilSettings::eraser_mode, bGPDspoint::flag, tGPsdata::flags, GP_BRUSH_ERASER_HARD, GP_BRUSH_ERASER_SOFT, GP_BRUSH_ERASER_STROKE, GP_PAINTFLAG_HARD_ERASER, GP_PAINTFLAG_SELECTMASK, GP_PAINTFLAG_STROKE_ERASER, GP_SPOINT_SELECT, GP_SPOINT_TAG, GP_SPOINT_TEMP_TAG, GP_SPOINT_TEMP_TAG2, tGPsdata::gpd, GPENCIL_ALPHA_OPACITY_THRESH, gpencil_free_stroke(), gpencil_point_to_parent_space(), gpencil_point_to_xy(), Brush::gpencil_settings, gpencil_stroke_eraser_calc_influence(), gpencil_stroke_eraser_is_occluded(), gpencil_stroke_inside_circle(), gpencil_stroke_soft_refine(), gpencil_update_cache(), tGPsdata::gsc, len_v2v2_int(), bGPDstroke::next, NULL, bGPDstroke::points, bGPDspoint::pressure, round_v2i_v2fl(), bGPDspoint::strength, bGPDstroke::totpoints, and V2D_IS_CLIPPED.
Referenced by gpencil_stroke_doeraser().
|
static |
Definition at line 1330 of file gpencil_paint.c.
References BKE_gpencil_layer_transform_matrix_get(), tGPsdata::brush, PointerRNA::data, tGPsdata::depsgraph, tGPsdata::depths, ED_view3d_calc_depth_for_comparison(), ED_view3d_depth_read_cached(), ED_view3d_depth_unproject_v3(), tGPsdata::eraser, bGPDspoint::flag, GP_BRUSH_OCCLUDE_ERASER, GP_SPOINT_TEMP_TAG, GP_SPOINT_TEMP_TAG2, GPAINT_TOOL_ERASE, if(), mul_v3_m4v3(), NULL, tGPsdata::ownerPtr, tGPsdata::region, ARegion::regiondata, x, bGPDspoint::x, and y.
Referenced by gpencil_stroke_eraser_dostroke().
|
static |
Definition at line 346 of file gpencil_paint.c.
References tGPsdata::brush, copy_v2_v2(), tGPsdata::disable_stabilizer, fabsf, BrushGpencilSettings::flag, GP_BRUSH_STABILIZE_MOUSE_TEMP, tGPsdata::gpd, GPENCIL_LAZY_MODE, Brush::gpencil_settings, MIN_EUCLIDEAN_PX, MIN_MANHATTEN_PX, tGPsdata::mval, tGPsdata::mvalo, bGPdata::runtime, bGPdata_Runtime::sbuffer_used, tGPsdata::shift, and Brush::smooth_stroke_radius.
Referenced by gpencil_draw_apply().
Definition at line 922 of file gpencil_paint.c.
References Object::actcol, bGPDlayer::actframe, BrushGpencilSettings::aspect_ratio, bGPDstroke::aspect_ratio, BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_object_material_get_index_from_brush(), BKE_gpencil_stroke_boundingbox_calc(), BKE_gpencil_stroke_copy_to_keyframes(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_simplify_adaptive(), BKE_gpencil_stroke_smooth(), BKE_gpencil_stroke_smooth_point(), BKE_gpencil_stroke_smooth_strength(), BKE_gpencil_stroke_trim(), BKE_gpencil_tag_full_update(), BLI_addhead(), BLI_addtail(), BLI_findlink(), bool, tGPsdata::brush, tGPsdata::C, bGPDstroke::caps, BrushGpencilSettings::caps_type, CLAMP, CLAMP_MIN, copy_v2_v2(), copy_v2_v2_int(), copy_v4_v4(), PointerRNA::data, depsgraph, tGPsdata::depsgraph, DEPTH_INVALID, tGPsdata::depths, BrushGpencilSettings::draw_smoothfac, BrushGpencilSettings::draw_smoothlvl, BrushGpencilSettings::draw_strength, BrushGpencilSettings::draw_subdivide, bGPDstroke::dvert, MDeformVert::dw, ED_gpencil_fill_vertex_color_set(), ED_gpencil_point_vertex_color_set(), ED_gpencil_project_stroke_to_view(), ED_gpencil_stroke_close_by_distance(), ED_gpencil_stroke_extremes_to2d(), ED_gpencil_stroke_join_and_trim(), ED_gpencil_stroke_nearest_to_ends(), ED_view3d_depth_read_cached(), ED_view3d_depth_read_cached_seg(), ELEM, bGPDstroke::fill_opacity_fac, BrushGpencilSettings::flag, bGPDstroke::flag, float(), GP_BRUSH_GROUP_SETTINGS, GP_BRUSH_TRIM_STROKE, GP_PAINTMODE_DRAW, GP_PAINTMODE_DRAW_STRAIGHT, 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_TOOL_FLAG_AUTOMERGE_STROKE, GP_TOOL_FLAG_CREATE_WEIGHTS, GP_TOOL_FLAG_PAINT_ONBACK, tGPsdata::gpd, gpencil_apply_parent(), gpencil_apply_parent_point(), ToolSettings::gpencil_flags, GPENCIL_MINIMUM_JOIN_DIST, GPENCIL_MULTIEDIT_SESSIONS_ON, gpencil_project_check(), gpencil_reproject_toplane(), Brush::gpencil_settings, GPENCIL_STRENGTH_MIN, gpencil_stroke_convertcoords(), gpencil_stroke_unselect(), gpencil_subdivide_stroke(), gpencil_update_cache(), ToolSettings::gpencil_v3d_align, tGPsdata::gpf, tGPsdata::gpl, tGPsdata::gsc, BrushGpencilSettings::hardeness, bGPDstroke::hardeness, if(), tGPsdata::inittime, bGPDstroke::inittime, BrushGpencilSettings::input_samples, interp_sparse_array(), interpf(), GP_Sculpt_Settings::lock_axis, tGPspoint::m_xy, bGPDstroke::mat_nr, MEM_callocN, MEM_freeN, MEM_mallocN, MIN2, bGPDstroke::next, NULL, tGPsdata::ob, tGPsdata::ownerPtr, tGPsdata::paintmode, bGPDstroke::points, tGPspoint::pressure, bGPDspoint::pressure, bGPDstroke::prev, tGPsdata::region, ARegion::regiondata, round_v2i_v2fl(), bGPdata::runtime, RV3D_CAMOB, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_used, tGPsdata::scene, BrushGpencilSettings::simplify_f, Brush::size, tGPspoint::strength, bGPDspoint::strength, bGPDframe::strokes, bGPDstroke::thickness, tGPspoint::time, bGPDspoint::time, Scene::toolsettings, bGPDstroke::totpoints, MDeformVert::totweight, tGPspoint::uv_fac, bGPDspoint::uv_fac, tGPspoint::uv_rot, bGPDspoint::uv_rot, bGPDstroke::uv_scale, tGPspoint::vert_color, bGPDspoint::vert_color, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, ToolSettings::vgroup_weight, MDeformWeight::weight, and bGPDspoint::x.
Referenced by gpencil_paint_strokeend().
|
static |
Analyze points to be removed when soft eraser is used to avoid that segments gets the end points rounded. The round caps breaks the artistic effect.
Definition at line 1428 of file gpencil_paint.c.
References bGPDspoint::flag, GP_SPOINT_TAG, NULL, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by gpencil_stroke_eraser_dostroke().
|
static |
Definition at line 908 of file gpencil_paint.c.
References BKE_gpencil_editcurve_stroke_sync_selection(), BKE_gpencil_stroke_select_index_reset(), bGPDstroke::editcurve, bGPDspoint::flag, bGPDstroke::flag, GP_SPOINT_SELECT, GP_STROKE_SELECT, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by gpencil_stroke_newfrombuffer().
Definition at line 265 of file gpencil_paint.c.
References DEG_id_tag_update(), bGPdata::flag, GP_DATA_CACHE_IS_DIRTY, bGPdata::id, ID_RECALC_GEOMETRY, and ID_RECALC_TRANSFORM.
Referenced by gpencil_draw_exit(), gpencil_free_stroke(), gpencil_paint_initstroke(), gpencil_stroke_eraser_dostroke(), and gpencil_stroke_newfrombuffer().
|
static |
Definition at line 3866 of file gpencil_paint.c.
Referenced by GPENCIL_OT_draw().