Blender
V3.3
|
#include <limits.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math_vector.h"
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_paint.h"
#include "ED_paint.h"
#include "ED_view3d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_view2d.h"
#include "paint_intern.h"
Go to the source code of this file.
Classes | |
struct | PointSlideData |
Macros | |
#define | PAINT_CURVE_SELECT_THRESHOLD 40.0f |
#define | PAINT_CURVE_POINT_SELECT(pcp, i) (*(&pcp->bez.f1 + i) = SELECT) |
#define | SEL_F1 (1 << 0) |
#define | SEL_F2 (1 << 1) |
#define | SEL_F3 (1 << 2) |
#define | DELETE_TAG 2 |
Typedefs | |
typedef struct PointSlideData | PointSlideData |
#define DELETE_TAG 2 |
Definition at line 38 of file paint_curve.c.
#define PAINT_CURVE_SELECT_THRESHOLD 40.0f |
Definition at line 37 of file paint_curve.c.
#define SEL_F1 (1 << 0) |
Definition at line 66 of file paint_curve.c.
#define SEL_F2 (1 << 1) |
Definition at line 67 of file paint_curve.c.
#define SEL_F3 (1 << 2) |
Definition at line 68 of file paint_curve.c.
typedef struct PointSlideData PointSlideData |
Definition at line 40 of file paint_curve.c.
References BKE_paint_get_active_from_context(), Paint::brush, BRUSH_CURVE, C, CTX_data_active_object(), CTX_wm_region_view3d(), CTX_wm_space_image(), Brush::flag, Object::mode, SpaceImage::mode, OB_MODE_ALL_PAINT, OB_MODE_SCULPT_CURVES, and SI_MODE_PAINT.
Referenced by ED_keymap_paint(), PAINTCURVE_OT_add_point(), PAINTCURVE_OT_cursor(), PAINTCURVE_OT_delete_point(), PAINTCURVE_OT_draw(), PAINTCURVE_OT_new(), PAINTCURVE_OT_select(), PAINTCURVE_OT_slide(), paintcurve_undosys_poll(), and paintcurve_undosys_step_encode().
|
static |
Definition at line 243 of file paint_curve.c.
References C, OPERATOR_CANCELLED, OPERATOR_FINISHED, paintcurve_point_add(), wmOperator::ptr, RNA_int_get_array(), and RNA_struct_property_is_set().
Referenced by PAINTCURVE_OT_add_point().
|
static |
Definition at line 235 of file paint_curve.c.
References C, OPERATOR_FINISHED, paintcurve_point_add(), wmOperator::ptr, and RNA_int_set_array().
Referenced by PAINTCURVE_OT_add_point().
|
static |
Definition at line 704 of file paint_curve.c.
References BKE_paintmode_get_active_from_context(), C, copy_v2_v2(), CTX_wm_region(), CTX_wm_space_image(), SpaceImage::cursor, ED_view3d_cursor3d_update(), wmEvent::mval, NC_SPACE, ND_SPACE_IMAGE, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, PAINT_MODE_TEXTURE_2D, UI_view2d_region_to_view(), ARegion::v2d, V3D_CURSOR_ORIENT_VIEW, and WM_event_add_notifier().
Referenced by PAINTCURVE_OT_cursor().
|
static |
Definition at line 284 of file paint_curve.c.
References PaintCurve::add_index, PaintCurvePoint::bez, BEZT_ISSEL_ANY, BKE_paint_curve_clamp_endpoint_add_index(), BKE_paint_get_active_from_context(), Paint::brush, C, CTX_wm_region(), CTX_wm_window(), DELETE_TAG, ED_paintcurve_undo_push_begin(), ED_paintcurve_undo_push_end(), BezTriple::f2, MEM_freeN, MEM_mallocN, wmOperatorType::name, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, Brush::paint_curve, PaintCurve::points, PaintCurve::tot_points, wmOperator::type, and WM_paint_cursor_tag_redraw().
Referenced by PAINTCURVE_OT_delete_point().
|
static |
Definition at line 660 of file paint_curve.c.
References BKE_paintmode_get_active_from_context(), C, NULL, OPERATOR_PASS_THROUGH, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_CURVES, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_WEIGHT, WM_OP_INVOKE_DEFAULT, and WM_operator_name_call().
Referenced by PAINTCURVE_OT_draw().
|
static |
Definition at line 144 of file paint_curve.c.
References BKE_paint_curve_add(), BKE_paint_get_active_from_context(), Paint::brush, C, CTX_data_main(), NA_ADDED, NC_PAINTCURVE, NULL, OPERATOR_FINISHED, Brush::paint_curve, and WM_event_add_notifier().
Referenced by PAINTCURVE_OT_new().
void PAINTCURVE_OT_add_point | ( | wmOperatorType * | ot | ) |
Definition at line 256 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_add_point_exec(), paintcurve_add_point_invoke(), wmOperatorType::poll, RNA_def_int_vector(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_cursor | ( | wmOperatorType * | ot | ) |
Definition at line 732 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, ot, paint_curve_poll(), paintcurve_cursor_invoke(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_delete_point | ( | wmOperatorType * | ot | ) |
Definition at line 348 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_delete_point_exec(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_draw | ( | wmOperatorType * | ot | ) |
Definition at line 689 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_draw_exec(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_new | ( | wmOperatorType * | ot | ) |
Definition at line 158 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_new_exec(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_select | ( | wmOperatorType * | ot | ) |
Definition at line 492 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_select_point_exec(), paintcurve_select_point_invoke(), wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_int_vector(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINTCURVE_OT_slide | ( | wmOperatorType * | ot | ) |
Definition at line 638 of file paint_curve.c.
References wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_UNDO, ot, paint_curve_poll(), paintcurve_slide_invoke(), paintcurve_slide_modal(), wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 173 of file paint_curve.c.
References PaintCurve::add_index, PaintCurvePoint::bez, BKE_paint_curve_add(), BKE_paint_curve_clamp_endpoint_add_index(), BKE_paint_get_active_from_context(), Paint::brush, C, copy_v3_v3(), CTX_data_main(), CTX_wm_region(), CTX_wm_window(), ED_paintcurve_undo_push_begin(), ED_paintcurve_undo_push_end(), BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_ALIGN, MEM_freeN, MEM_mallocN, wmOperatorType::name, Brush::paint_curve, PaintCurve::points, SELECT, PaintCurve::tot_points, wmOperator::type, and WM_paint_cursor_tag_redraw().
Referenced by paintcurve_add_point_exec(), and paintcurve_add_point_invoke().
|
static |
Definition at line 112 of file paint_curve.c.
Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().
|
static |
Definition at line 71 of file paint_curve.c.
References PaintCurvePoint::bez, closest(), len_manhattan_v2v2(), NULL, point, PaintCurve::points, pos, SEL_F1, SEL_F2, SEL_F3, threshold, and BezTriple::vec.
Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().
|
static |
Definition at line 363 of file paint_curve.c.
References PaintCurvePoint::bez, BKE_paint_curve_clamp_endpoint_add_index(), BKE_paint_get_active_from_context(), Paint::brush, C, CTX_wm_region(), CTX_wm_window(), ED_paintcurve_undo_push_begin(), ED_paintcurve_undo_push_end(), BezTriple::f1, BezTriple::f2, BezTriple::f3, wmOperatorType::name, Brush::paint_curve, PAINT_CURVE_POINT_SELECT, PAINT_CURVE_SELECT_THRESHOLD, paintcurve_point_co_index(), paintcurve_point_get_closest(), PaintCurve::points, SEL_F1, SEL_F2, SEL_F3, select(), SELECT, PaintCurve::tot_points, wmOperator::type, UNPACK2, and WM_paint_cursor_tag_redraw().
Referenced by paintcurve_select_point_exec(), and paintcurve_select_point_invoke().
|
static |
Definition at line 122 of file paint_curve.c.
References BEZT_ISSEL_ANY, BezTriple::f1, BezTriple::f3, SEL_F1, SEL_F3, and SELECT.
Referenced by paintcurve_slide_invoke().
|
static |
Definition at line 476 of file paint_curve.c.
References C, OPERATOR_CANCELLED, OPERATOR_FINISHED, paintcurve_point_select(), wmOperator::ptr, RNA_boolean_get(), RNA_int_get_array(), and RNA_struct_property_is_set().
Referenced by PAINTCURVE_OT_select().
|
static |
Definition at line 464 of file paint_curve.c.
References C, wmEvent::mval, OPERATOR_CANCELLED, OPERATOR_FINISHED, paintcurve_point_select(), wmOperator::ptr, RNA_boolean_get(), RNA_int_set_array(), and UNPACK2.
Referenced by PAINTCURVE_OT_select().
|
static |
Definition at line 535 of file paint_curve.c.
References PointSlideData::align, PaintCurvePoint::bez, BKE_paint_curve_clamp_endpoint_add_index(), BKE_paint_get_active_from_context(), Paint::brush, C, copy_v2_v2(), copy_v2_v2_int(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, PointSlideData::event, BezTriple::f1, BezTriple::f2, BezTriple::f3, PointSlideData::initial_loc, MEM_mallocN, wmEvent::mval, NULL, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, Brush::paint_curve, PAINT_CURVE_POINT_SELECT, PAINT_CURVE_SELECT_THRESHOLD, paintcurve_point_co_index(), paintcurve_point_get_closest(), paintcurve_point_side_index(), PointSlideData::pcp, PointSlideData::point_initial_loc, PaintCurve::points, wmOperator::ptr, RNA_boolean_get(), SEL_F3, select(), PointSlideData::select, PaintCurve::tot_points, UNPACK2, BezTriple::vec, WM_event_add_modal_handler(), and WM_paint_cursor_tag_redraw().
Referenced by PAINTCURVE_OT_slide().
|
static |
Definition at line 596 of file paint_curve.c.
References add_v2_v2(), add_v2_v2v2(), PointSlideData::align, PaintCurvePoint::bez, C, copy_v2_v2(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, KDL::diff(), ED_paintcurve_undo_push_begin(), ED_paintcurve_undo_push_end(), PointSlideData::event, PointSlideData::initial_loc, KM_RELEASE, MEM_freeN, MOUSEMOVE, wmOperatorType::name, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, PointSlideData::pcp, PointSlideData::point_initial_loc, PointSlideData::select, sub_v2_v2v2(), wmOperator::type, wmEvent::type, wmEvent::val, BezTriple::vec, and WM_paint_cursor_tag_redraw().
Referenced by PAINTCURVE_OT_slide().