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_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 |
Variables | |
static const EnumPropertyItem | gpencil_primitive_type [] |
Operators for creating new Grease Pencil primitives (boxes, circles, ...).
Definition in file gpencil_primitive.c.
#define BIG_SIZE_CTL 15 |
Definition at line 87 of file gpencil_primitive.c.
#define IDLE 0 |
Definition at line 73 of file gpencil_primitive.c.
#define IN_BRUSH_SIZE 4 |
Definition at line 77 of file gpencil_primitive.c.
#define IN_BRUSH_STRENGTH 5 |
Definition at line 78 of file gpencil_primitive.c.
#define IN_CURVE_EDIT 2 |
Definition at line 75 of file gpencil_primitive.c.
#define IN_MOVE 3 |
Definition at line 76 of file gpencil_primitive.c.
#define IN_POLYLINE 6 |
Definition at line 79 of file gpencil_primitive.c.
#define IN_PROGRESS 1 |
Definition at line 74 of file gpencil_primitive.c.
#define MAX_CP 128 |
Definition at line 71 of file gpencil_primitive.c.
#define MAX_EDGES 128 |
Definition at line 70 of file gpencil_primitive.c.
#define MID_SIZE_CTL 10 |
Definition at line 88 of file gpencil_primitive.c.
#define MIN_EDGES 2 |
Definition at line 69 of file gpencil_primitive.c.
#define MOVE_CP 2 |
Definition at line 93 of file gpencil_primitive.c.
#define MOVE_ENDS 1 |
Definition at line 92 of file gpencil_primitive.c.
#define MOVE_NONE 0 |
Definition at line 91 of file gpencil_primitive.c.
#define SELECT_CP1 2 |
Definition at line 83 of file gpencil_primitive.c.
#define SELECT_CP2 3 |
Definition at line 84 of file gpencil_primitive.c.
#define SELECT_END 4 |
Definition at line 85 of file gpencil_primitive.c.
#define SELECT_NONE 0 |
Definition at line 81 of file gpencil_primitive.c.
#define SELECT_START 1 |
Definition at line 82 of file gpencil_primitive.c.
#define SMALL_SIZE_CTL 8 |
Definition at line 89 of file gpencil_primitive.c.
|
static |
Definition at line 133 of file gpencil_primitive.c.
References BKE_gpencil_object_material_ensure_from_active_input_brush(), BKE_object_material_slot_find_index(), tGPDprimitive::bmain, tGPDprimitive::brush, tGPDprimitive::gpd, tGPDprimitive::material, bGPdata_Runtime::matid, tGPDprimitive::ob, bGPdata::runtime, and bGPdata_Runtime::sbuffer_brush.
Referenced by gpencil_primitive_update_strokes().
void GPENCIL_OT_primitive_box | ( | wmOperatorType * | ot | ) |
Definition at line 2036 of file gpencil_primitive.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, GP_STROKE_BOX, gpencil_primitive_add_poll(), gpencil_primitive_cancel(), gpencil_primitive_common_props(), gpencil_primitive_invoke(), gpencil_primitive_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_primitive_circle | ( | wmOperatorType * | ot | ) |
Definition at line 2096 of file gpencil_primitive.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, GP_STROKE_CIRCLE, gpencil_primitive_add_poll(), gpencil_primitive_cancel(), gpencil_primitive_common_props(), gpencil_primitive_invoke(), gpencil_primitive_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_primitive_curve | ( | wmOperatorType * | ot | ) |
Definition at line 2116 of file gpencil_primitive.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, GP_STROKE_CURVE, gpencil_primitive_add_poll(), gpencil_primitive_cancel(), gpencil_primitive_common_props(), gpencil_primitive_invoke(), gpencil_primitive_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_primitive_line | ( | wmOperatorType * | ot | ) |
Definition at line 2056 of file gpencil_primitive.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, GP_STROKE_LINE, gpencil_primitive_add_poll(), gpencil_primitive_cancel(), gpencil_primitive_common_props(), gpencil_primitive_invoke(), gpencil_primitive_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_primitive_polyline | ( | wmOperatorType * | ot | ) |
Definition at line 2076 of file gpencil_primitive.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, GP_STROKE_POLYLINE, gpencil_primitive_add_poll(), gpencil_primitive_cancel(), gpencil_primitive_common_props(), gpencil_primitive_invoke(), gpencil_primitive_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_gpencil().
Definition at line 238 of file gpencil_primitive.c.
References blender::compositor::area(), BKE_gpencil_layer_active_get(), C, CTX_data_gpencil_data(), CTX_wm_area(), CTX_wm_operator_poll_msg_set(), bGPDlayer::flag, bGPdata::flag, GP_DATA_STROKE_EDITMODE, GP_DATA_STROKE_PAINTMODE, GP_LAYER_HIDE, GP_LAYER_LOCKED, NULL, and SPACE_VIEW3D.
Referenced by GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), and GPENCIL_OT_primitive_polyline().
|
static |
Definition at line 370 of file gpencil_primitive.c.
References gpencil_primitive_allocate_memory(), tGPDprimitive::tot_edges, and tGPDprimitive::tot_stored_edges.
Referenced by gpencil_primitive_edit_event_handling(), and gpencil_primitive_modal().
|
static |
Definition at line 276 of file gpencil_primitive.c.
References bGPDstroke::dvert, ListBase::first, GP_STROKE_BOX, tGPDprimitive::gpf, MAX_EDGES, MEM_reallocN, NULL, tGPDprimitive::point_count, tGPDprimitive::points, bGPDstroke::points, bGPDframe::strokes, and tGPDprimitive::type.
Referenced by gpencil_primitive_add_segment(), and gpencil_primitive_set_initdata().
|
static |
Definition at line 593 of file gpencil_primitive.c.
References Freestyle::a, BIG_SIZE_CTL, color, copy_v2_v2(), cosf, tGPDprimitive::cp1, tGPDprimitive::end, float(), gpencil_primitive_set_cp(), M_PI_2, tGPspoint::m_xy, mid_v2_v2v2(), blender::math::midpoint(), tGPDprimitive::midpoint, sinf, SMALL_SIZE_CTL, tGPDprimitive::start, TH_GIZMO_PRIMARY, TH_GIZMO_SECONDARY, TH_REDALERT, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, and UI_GetThemeColor4fv().
Referenced by gpencil_primitive_update_strokes().
|
static |
Definition at line 634 of file gpencil_primitive.c.
References Freestyle::a, BIG_SIZE_CTL, color, copy_v2_v2(), tGPDprimitive::cp1, tGPDprimitive::cp2, tGPDprimitive::end, float(), gpencil_primitive_set_cp(), interp_v2_v2v2v2v2_cubic(), tGPspoint::m_xy, SMALL_SIZE_CTL, tGPDprimitive::start, TH_GIZMO_PRIMARY, TH_GIZMO_SECONDARY, TH_REDALERT, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, and UI_GetThemeColor4fv().
Referenced by gpencil_primitive_update_strokes().
|
static |
Definition at line 2004 of file gpencil_primitive.c.
References C, and gpencil_primitive_exit().
Referenced by GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), and GPENCIL_OT_primitive_polyline().
|
static |
Definition at line 670 of file gpencil_primitive.c.
References Freestyle::a, BIG_SIZE_CTL, center, color, cosf, tGPDprimitive::end, fabsf, gpencil_primitive_set_cp(), M_PI, tGPspoint::m_xy, sinf, SMALL_SIZE_CTL, tGPDprimitive::start, TH_GIZMO_PRIMARY, TH_REDALERT, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, and UI_GetThemeColor4fv().
Referenced by gpencil_primitive_update_strokes().
|
static |
Definition at line 2010 of file gpencil_primitive.c.
References gpencil_primitive_type, MAX_EDGES, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_enum(), RNA_def_int(), RNA_def_property_flag(), wmOperatorType::srna, and type.
Referenced by GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), and GPENCIL_OT_primitive_polyline().
|
static |
Definition at line 169 of file gpencil_primitive.c.
References angle(), atan2f, tGPDprimitive::end, fabsf, gpencil_primitive_to_square(), M_PI, M_PI_2, tGPDprimitive::origin, x, and y.
Referenced by gpencil_primitive_modal().
|
static |
Definition at line 1420 of file gpencil_primitive.c.
References Freestyle::a, usdtokens::b(), BIG_SIZE_CTL, C, Freestyle::c, copy_v2_v2(), tGPDprimitive::cp1, tGPDprimitive::cp2, tGPDprimitive::curve, ELEM, tGPDprimitive::end, EVT_EKEY, EVT_MKEY, tGPDprimitive::flag, tGPDprimitive::flip, GP_STROKE_ARC, GP_STROKE_BOX, GP_STROKE_CIRCLE, GP_STROKE_CURVE, GP_STROKE_POLYLINE, gpencil_primitive_add_segment(), gpencil_primitive_update(), gpencil_primitive_update_cps(), IN_CURVE_EDIT, IN_POLYLINE, IN_PROGRESS, KM_PRESS, KM_RELEASE, KM_SHIFT, LEFTMOUSE, len_v2v2(), wmEvent::modifier, MOUSEMOVE, MOVE_CP, MOVE_ENDS, MOVE_NONE, tGPDprimitive::mval, tGPDprimitive::mvalo, tGPDprimitive::origin, tGPDprimitive::orign_type, tGPDprimitive::sel_cp, SELECT_CP1, SELECT_CP2, SELECT_END, SELECT_NONE, SELECT_START, tGPDprimitive::start, tGPDprimitive::tot_stored_edges, tGPDprimitive::type, wmEvent::type, wmEvent::val, WM_CURSOR_CROSS, WM_CURSOR_HAND, WM_cursor_modal_set(), and WM_CURSOR_NSEW_SCROLL.
Referenced by gpencil_primitive_modal().
|
static |
Definition at line 1121 of file gpencil_primitive.c.
References BKE_gpencil_free_strokes(), BLI_rng_free(), C, bGPdata_Runtime::cp_points, wmOperator::customdata, DEG_id_tag_update(), tGPDprimitive::depths, ED_view3d_depths_free(), ED_workspace_status_text(), tGPDprimitive::gpd, tGPDprimitive::gpf, bGPdata::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, MEM_freeN, MEM_SAFE_FREE, NA_EDITED, NC_GPENCIL, NULL, tGPDprimitive::points, tGPDprimitive::rng, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, bGPdata_Runtime::tot_cp_points, and WM_event_add_notifier().
Referenced by gpencil_primitive_cancel(), gpencil_primitive_interaction_end(), and gpencil_primitive_modal().
|
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().
|
static |
Definition at line 1110 of file gpencil_primitive.c.
References copy_v2_v2(), tGPDprimitive::cp1, tGPDprimitive::cp2, tGPDprimitive::end, tGPDprimitive::mval, tGPDprimitive::origin, tGPDprimitive::region, tGPDprimitive::start, and WM_event_drag_start_mval_fl().
Referenced by gpencil_primitive_invoke(), and gpencil_primitive_modal().
|
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().
|
static |
Definition at line 1252 of file gpencil_primitive.c.
References bGPDlayer::actframe, BKE_gpencil_layer_active_get(), BKE_report(), tGPDprimitive::brush, C, CTX_data_gpencil_data(), CTX_data_scene(), CTX_wm_window(), wmOperator::customdata, DEG_id_tag_update(), ED_gpencil_init_random_settings(), tGPDprimitive::flag, wmOperator::flag, gpencil_primitive_init(), gpencil_primitive_interaction_begin(), gpencil_primitive_status_indicators(), bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, IN_PROGRESS, IS_AUTOKEY_ON, wmEvent::mval, NA_EDITED, NC_GPENCIL, NULL, OP_IS_MODAL_CURSOR_REGION, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, tGPDprimitive::random_settings, wmOperator::reports, RNA_boolean_get(), RPT_INFO, scene, WM_CURSOR_CROSS, WM_cursor_modal_set(), WM_event_add_modal_handler(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_primitive_box(), GPENCIL_OT_primitive_circle(), GPENCIL_OT_primitive_curve(), GPENCIL_OT_primitive_line(), and GPENCIL_OT_primitive_polyline().
|
static |
Definition at line 561 of file gpencil_primitive.c.
References Freestyle::a, BIG_SIZE_CTL, color, tGPDprimitive::end, float(), gpencil_primitive_set_cp(), interp_v2_v2v2(), tGPspoint::m_xy, SMALL_SIZE_CTL, tGPDprimitive::start, TH_GIZMO_PRIMARY, TH_REDALERT, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, and UI_GetThemeColor4fv().
Referenced by gpencil_primitive_update_strokes().
|
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().
|
static |
Definition at line 1586 of file gpencil_primitive.c.
References add_v2_v2(), tGPDprimitive::cp1, tGPDprimitive::cp2, tGPDprimitive::end, ListBase::first, tGPDprimitive::gpf, tGPspoint::m_xy, tGPDprimitive::move, tGPDprimitive::mval, tGPDprimitive::mvalo, tGPDprimitive::origin, tGPDprimitive::points, reset, tGPDprimitive::start, bGPDframe::strokes, sub_v2_v2(), sub_v2_v2v2(), bGPDstroke::totpoints, and zero_v2().
Referenced by gpencil_primitive_modal().
|
static |
Definition at line 510 of file gpencil_primitive.c.
References Freestyle::a, BIG_SIZE_CTL, color, copy_v2_v2(), tGPDprimitive::end, float(), gpencil_primitive_set_cp(), interp_v2_v2v2(), tGPspoint::m_xy, mid_v2_v2v2(), tGPDprimitive::midpoint, SMALL_SIZE_CTL, tGPDprimitive::start, TH_GIZMO_PRIMARY, TH_REDALERT, tGPDprimitive::tot_edges, tGPDprimitive::tot_stored_edges, and UI_GetThemeColor4fv().
Referenced by gpencil_primitive_update_strokes().
|
static |
Definition at line 205 of file gpencil_primitive.c.
References Freestyle::a, angle(), usdtokens::b(), gpencil_rotate_v2_v2v2fl(), mid_v2_v2v2(), and blender::math::midpoint().
Referenced by gpencil_primitive_update_cps().
|
static |
Definition at line 382 of file gpencil_primitive.c.
References CLAMP, bGPDcontrolpoint::color, color, copy_v2_v2(), copy_v4_v4(), bGPdata_Runtime::cp_points, tGPDprimitive::flag, tGPDprimitive::gpd, IN_PROGRESS, MAX_CP, bGPdata::runtime, size(), bGPDcontrolpoint::size, bGPdata_Runtime::tot_cp_points, and bGPDcontrolpoint::x.
Referenced by gpencil_primitive_arc(), gpencil_primitive_bezier(), gpencil_primitive_circle(), gpencil_primitive_line(), and gpencil_primitive_rectangle().
|
static |
Definition at line 290 of file gpencil_primitive.c.
References Object::actcol, bGPDstroke::aspect_ratio, BKE_gpencil_layer_addnew(), BKE_gpencil_object_material_get_index_from_brush(), BKE_gpencil_stroke_select_index_reset(), BLI_addtail(), BLI_rng_new(), tGPDprimitive::brush, C, bGPDstroke::caps, BrushGpencilSettings::caps_type, RenderData::cfra, tGPDprimitive::cframe, copy_v2_fl(), CTX_data_active_gpencil_layer(), CTX_data_scene(), DATA_, DEG_id_tag_update(), bGPDstroke::dvert, ED_gpencil_fill_vertex_color_set(), ELEM, bGPDstroke::fill_opacity_fac, bGPDstroke::flag, bGPDframe::framenum, GP_STROKE_3DSPACE, GP_STROKE_BOX, GP_STROKE_CIRCLE, GP_STROKE_CYCLIC, GP_STROKE_SELECT, tGPDprimitive::gpd, gpencil_primitive_allocate_memory(), Brush::gpencil_settings, tGPDprimitive::gpf, tGPDprimitive::gpl, bGPDstroke::hardeness, bGPdata::id, ID_RECALC_COPY_ON_WRITE, bGPDstroke::inittime, invert_m4_m4(), bGPDlayer::layer_invmat, bGPDlayer::layer_mat, loc_eul_size_to_mat4(), bGPDlayer::location, bGPDstroke::mat_nr, MEM_callocN, NULL, tGPDprimitive::ob, PIL_check_seconds_timer_i(), bGPDstroke::points, Scene::r, tGPDprimitive::rng, bGPDlayer::rotation, bGPDlayer::scale, scene, bGPDframe::strokes, bGPDstroke::thickness, Scene::toolsettings, bGPDstroke::tot_triangles, bGPDstroke::totpoints, bGPDstroke::triangles, tGPDprimitive::type, UINT_MAX, and bGPDstroke::uv_scale.
Referenced by gpencil_primitive_init().
|
static |
Definition at line 1564 of file gpencil_primitive.c.
References tGPDprimitive::brush, tGPDprimitive::brush_size, CLAMP_MIN, fabsf, len_manhattan_v2(), tGPDprimitive::mval, tGPDprimitive::mvalo, reset, Brush::size, and sub_v2_v2v2().
Referenced by gpencil_primitive_modal().
|
static |
Definition at line 405 of file gpencil_primitive.c.
References BLI_snprintf(), BLI_strncpy(), C, ED_workspace_status_text(), ELEM, tGPDprimitive::end, tGPDprimitive::flag, GP_STROKE_ARC, GP_STROKE_BOX, GP_STROKE_CIRCLE, GP_STROKE_CURVE, GP_STROKE_LINE, GP_STROKE_POLYLINE, hasNumInput(), IN_PROGRESS, tGPDprimitive::num, NUM_STR_REP_LEN, outputNumInput(), scene, tGPDprimitive::scene, tGPDprimitive::start, TIP_, tGPDprimitive::tot_edges, tGPDprimitive::type, UI_MAX_DRAW_STR, and Scene::unit.
Referenced by gpencil_primitive_invoke(), and gpencil_primitive_update().
|
static |
Definition at line 1540 of file gpencil_primitive.c.
References tGPDprimitive::brush, tGPDprimitive::brush_strength, CLAMP, BrushGpencilSettings::draw_strength, fabsf, Brush::gpencil_settings, len_manhattan_v2(), tGPDprimitive::mval, tGPDprimitive::mvalo, reset, and sub_v2_v2v2().
Referenced by gpencil_primitive_modal().
|
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().
|
static |
Definition at line 1098 of file gpencil_primitive.c.
References C, gpencil_primitive_status_indicators(), gpencil_primitive_update_strokes(), wmOperator::ptr, RNA_enum_get(), RNA_int_get(), tGPDprimitive::tot_edges, and tGPDprimitive::type.
Referenced by gpencil_primitive_edit_event_handling(), and gpencil_primitive_modal().
|
static |
Definition at line 215 of file gpencil_primitive.c.
References copy_v2_v2(), tGPDprimitive::cp1, tGPDprimitive::cp2, tGPDprimitive::curve, tGPDprimitive::end, tGPDprimitive::flip, GP_STROKE_ARC, GP_STROKE_CURVE, gpencil_primitive_rotate_line(), interp_v2_v2v2(), M_PI_2, mid_v2_v2v2(), tGPDprimitive::midpoint, tGPDprimitive::start, and tGPDprimitive::type.
Referenced by gpencil_primitive_edit_event_handling(), and gpencil_primitive_modal().
|
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().
|
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().
|
static |
Definition at line 107 of file gpencil_primitive.c.
References tGPDprimitive::brush, tGPDprimitive::depsgraph, ED_gpencil_sbuffer_ensure(), ED_gpencil_sbuffer_vertex_color_set(), ELEM, GP_STROKE_3DSPACE, GP_STROKE_BOX, GP_STROKE_CIRCLE, GP_STROKE_CYCLIC, tGPDprimitive::gpd, GpRandomSettings::hsv, tGPDprimitive::material, tGPDprimitive::ob, tGPDprimitive::random_settings, bGPdata::runtime, bGPdata_Runtime::sbuffer, bGPdata_Runtime::sbuffer_sflag, bGPdata_Runtime::sbuffer_size, bGPdata_Runtime::sbuffer_used, tGPDprimitive::scene, Scene::toolsettings, and tGPDprimitive::type.
Referenced by gpencil_primitive_update_strokes().
|
static |
Definition at line 97 of file gpencil_primitive.c.
Referenced by gpencil_primitive_common_props().