Blender  V3.3
Classes | Macros
editcurve_paint.c File Reference
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_mempool.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
#include "GPU_batch.h"
#include "GPU_batch_presets.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "curve_intern.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "RNA_enum_types.h"
#include "curve_fit_nd.h"

Go to the source code of this file.

Classes

struct  StrokeElem
 
struct  CurveDrawData
 

Macros

#define USE_SPLINE_FIT
 
#define STROKE_SAMPLE_DIST_MIN_PX   1
 
#define STROKE_SAMPLE_DIST_MAX_PX   3
 
#define STROKE_CYCLIC_DIST_PX   8
 

Functions

StrokeElem / #RNA_OperatorStrokeElement Conversion Functions
static float stroke_elem_radius_from_pressure (const struct CurveDrawData *cdd, const float pressure)
 
static float stroke_elem_radius (const struct CurveDrawData *cdd, const struct StrokeElem *selem)
 
static void stroke_elem_pressure_set (const struct CurveDrawData *cdd, struct StrokeElem *selem, float pressure)
 
static void stroke_elem_interp (struct StrokeElem *selem_out, const struct StrokeElem *selem_a, const struct StrokeElem *selem_b, float t)
 
static bool stroke_elem_project (const struct CurveDrawData *cdd, const int mval_i[2], const float mval_fl[2], float surface_offset, const float radius, float r_location_world[3], float r_normal_world[3])
 
static bool stroke_elem_project_fallback (const struct CurveDrawData *cdd, const int mval_i[2], const float mval_fl[2], const float surface_offset, const float radius, const float location_fallback_depth[3], float r_location_world[3], float r_location_local[3], float r_normal_world[3], float r_normal_local[3])
 
static bool stroke_elem_project_fallback_elem (const struct CurveDrawData *cdd, const float location_fallback_depth[3], struct StrokeElem *selem)
 
Operator/Stroke Conversion
static void curve_draw_stroke_to_operator_elem (wmOperator *op, const struct StrokeElem *selem)
 
static void curve_draw_stroke_from_operator_elem (wmOperator *op, PointerRNA *itemptr)
 
static void curve_draw_stroke_to_operator (wmOperator *op)
 
static void curve_draw_stroke_from_operator (wmOperator *op)
 
Operator Callbacks & Helpers
static void curve_draw_stroke_3d (const struct bContext *UNUSED(C), ARegion *UNUSED(region), void *arg)
 
static void curve_draw_event_add (wmOperator *op, const wmEvent *event)
 
static void curve_draw_event_add_first (wmOperator *op, const wmEvent *event)
 
static bool curve_draw_init (bContext *C, wmOperator *op, bool is_invoke)
 
static void curve_draw_exit (wmOperator *op)
 
static void curve_draw_exec_precalc (wmOperator *op)
 
static int curve_draw_exec (bContext *C, wmOperator *op)
 
static int curve_draw_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void curve_draw_cancel (bContext *UNUSED(C), wmOperator *op)
 
static int curve_draw_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
void CURVE_OT_draw (wmOperatorType *ot)
 

Macro Definition Documentation

◆ STROKE_CYCLIC_DIST_PX

#define STROKE_CYCLIC_DIST_PX   8

Definition at line 59 of file editcurve_paint.c.

◆ STROKE_SAMPLE_DIST_MAX_PX

#define STROKE_SAMPLE_DIST_MAX_PX   3

Definition at line 56 of file editcurve_paint.c.

◆ STROKE_SAMPLE_DIST_MIN_PX

#define STROKE_SAMPLE_DIST_MIN_PX   1

Definition at line 55 of file editcurve_paint.c.

◆ USE_SPLINE_FIT

#define USE_SPLINE_FIT

Definition at line 48 of file editcurve_paint.c.

Function Documentation

◆ curve_draw_cancel()

static void curve_draw_cancel ( bContext UNUSEDC,
wmOperator op 
)
static

Definition at line 1129 of file editcurve_paint.c.

References curve_draw_exit().

Referenced by curve_draw_modal(), and CURVE_OT_draw().

◆ curve_draw_event_add()

static void curve_draw_event_add ( wmOperator op,
const wmEvent event 
)
static

◆ curve_draw_event_add_first()

static void curve_draw_event_add_first ( wmOperator op,
const wmEvent event 
)
static

◆ curve_draw_exec()

static int curve_draw_exec ( bContext C,
wmOperator op 
)
static

Definition at line 743 of file editcurve_paint.c.

References Curve::actvert, Nurb::bezt, BKE_curve_nurb_active_set(), BKE_nurb_handles_calc(), BKE_nurb_knot_calc_u(), BLI_addtail(), BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_mempool_len(), Nurb::bp, C, copy_v3_v3(), CU_3D, CU_BEZIER, CU_NURB_CYCLIC, CU_POLY, CU_SMOOTH, curve_draw_exit(), curve_draw_init(), curve_draw_stroke_from_operator(), CURVE_PAINT_FIT_METHOD_REFIT, CURVE_PAINT_FIT_METHOD_SPLIT, CURVE_PAINT_FLAG_PRESSURE_RADIUS, ToolSettings::curve_paint_settings, CurveDrawData::curve_type, wmOperator::customdata, Object::data, DEG_id_tag_update(), ED_curve_deselect_all_multi(), BezTriple::f1, BPoint::f1, BezTriple::f2, BezTriple::f3, Nurb::flag, Curve::flag, CurvePaintSettings::flag, Nurb::flagu, free(), BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_AUTO, HD_FREE, Object::imat, invert_m4_m4(), StrokeElem::location_local, M_PI, MEM_callocN, MEM_freeN, MEM_mallocN, CurveDrawData::min, NC_GEOM, ND_DATA, NULL, ViewContext::obedit, object_editcurve_get(), Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, Nurb::orderu, Nurb::orderv, Nurb::pntsu, Nurb::pntsv, StrokeElem::pressure, wmOperator::ptr, CurveDrawData::radius, BezTriple::radius, BPoint::radius, CurvePaintSettings::radius_max, CurvePaintSettings::radius_min, CurvePaintSettings::radius_taper_end, CurvePaintSettings::radius_taper_start, CurveDrawData::range, Nurb::resolu, Curve::resolu, Nurb::resolv, Curve::resolv, result, RNA_boolean_get(), RNA_enum_get(), RNA_float_get(), ViewContext::scene, SELECT, CurveDrawData::stroke_elem_pool, Scene::toolsettings, Nurb::type, UNLIKELY, CurveDrawData::vc, BezTriple::vec, BPoint::vec, and WM_event_add_notifier().

Referenced by curve_draw_invoke(), curve_draw_modal(), and CURVE_OT_draw().

◆ curve_draw_exec_precalc()

static void curve_draw_exec_precalc ( wmOperator op)
static

◆ curve_draw_exit()

static void curve_draw_exit ( wmOperator op)
static

◆ curve_draw_init()

static bool curve_draw_init ( bContext C,
wmOperator op,
bool  is_invoke 
)
static

◆ curve_draw_invoke()

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

◆ curve_draw_modal()

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

◆ curve_draw_stroke_3d()

static void curve_draw_stroke_3d ( const struct bContext UNUSEDC,
ARegion UNUSEDregion,
void arg 
)
static

◆ curve_draw_stroke_from_operator()

static void curve_draw_stroke_from_operator ( wmOperator op)
static

◆ curve_draw_stroke_from_operator_elem()

static void curve_draw_stroke_from_operator_elem ( wmOperator op,
PointerRNA itemptr 
)
static

◆ curve_draw_stroke_to_operator()

static void curve_draw_stroke_to_operator ( wmOperator op)
static

◆ curve_draw_stroke_to_operator_elem()

static void curve_draw_stroke_to_operator_elem ( wmOperator op,
const struct StrokeElem selem 
)
static

◆ CURVE_OT_draw()

void CURVE_OT_draw ( wmOperatorType ot)

◆ stroke_elem_interp()

static void stroke_elem_interp ( struct StrokeElem selem_out,
const struct StrokeElem selem_a,
const struct StrokeElem selem_b,
float  t 
)
static

◆ stroke_elem_pressure_set()

static void stroke_elem_pressure_set ( const struct CurveDrawData cdd,
struct StrokeElem selem,
float  pressure 
)
static

◆ stroke_elem_project()

static bool stroke_elem_project ( const struct CurveDrawData cdd,
const int  mval_i[2],
const float  mval_fl[2],
float  surface_offset,
const float  radius,
float  r_location_world[3],
float  r_normal_world[3] 
)
static

◆ stroke_elem_project_fallback()

static bool stroke_elem_project_fallback ( const struct CurveDrawData cdd,
const int  mval_i[2],
const float  mval_fl[2],
const float  surface_offset,
const float  radius,
const float  location_fallback_depth[3],
float  r_location_world[3],
float  r_location_local[3],
float  r_normal_world[3],
float  r_normal_local[3] 
)
static

◆ stroke_elem_project_fallback_elem()

static bool stroke_elem_project_fallback_elem ( const struct CurveDrawData cdd,
const float  location_fallback_depth[3],
struct StrokeElem selem 
)
static

◆ stroke_elem_radius()

static float stroke_elem_radius ( const struct CurveDrawData cdd,
const struct StrokeElem selem 
)
static

◆ stroke_elem_radius_from_pressure()

static float stroke_elem_radius_from_pressure ( const struct CurveDrawData cdd,
const float  pressure 
)
static