37 #define PAINT_CURVE_SELECT_THRESHOLD 40.0f
38 #define PAINT_CURVE_POINT_SELECT(pcp, i) (*(&pcp->bez.f1 + i) = SELECT)
66 #define SEL_F1 (1 << 0)
67 #define SEL_F2 (1 << 1)
68 #define SEL_F3 (1 << 2)
78 for (i = 0, pcp = pc->
points; i < pc->tot_points; i++, pcp++) {
86 if (dist[1] < closest_dist) {
87 closest_dist = dist[1];
90 if (dist[0] < closest_dist) {
91 closest_dist = dist[0];
94 if (dist[2] < closest_dist) {
95 closest_dist = dist[2];
101 if (ignore_pivot && point_sel ==
SEL_F2) {
161 ot->
name =
"Add New Paint Curve";
180 const float vec[3] = {loc[0], loc[1], 0.0};
197 if (add_index < pc->tot_points) {
198 memcpy(pcp + add_index + 1,
237 const int loc[2] = {
event->mval[0],
event->mval[1]};
259 ot->
name =
"Add New Paint Curve Point";
261 ot->
idname =
"PAINTCURVE_OT_add_point";
279 "Location of vertex in area space",
304 for (i = 0, pcp = pc->
points; i < pc->tot_points; i++, pcp++) {
319 for (i = 0, pcp = pc->
points; i < pc->tot_points; i++, pcp++) {
321 points_new[j] = pc->
points[i];
351 ot->
name =
"Remove Paint Curve Point";
353 ot->
idname =
"PAINTCURVE_OT_delete_point";
372 const float loc_fl[2] = {
UNPACK2(loc)};
385 bool selected =
false;
390 if (pcp[i].bez.f1 || pcp[i].
bez.
f2 || pcp[i].
bez.
f3) {
421 else if (selflag ==
SEL_F1) {
429 else if (selflag ==
SEL_F3) {
440 if (!extend && pcp) {
444 if ((pc->
points + i) == pcp) {
497 ot->
name =
"Select Paint Curve Point";
499 ot->
idname =
"PAINTCURVE_OT_select";
517 "Location of vertex in area space",
570 psd->
event =
event->type;
573 for (i = 0; i < 3; i++) {
607 switch (event->
type) {
614 for (i = 0; i < 3; i++) {
623 char opposite = (psd->
select == 0) ? 2 : 0;
641 ot->
name =
"Slide Paint Curve Point";
655 ot->
srna,
"align",
false,
"Align Handles",
"Aligns opposite point handle during transform");
657 ot->
srna,
"select",
true,
"Select",
"Attempt to select a point handle before transform");
668 name =
"PAINT_OT_image_paint";
671 name =
"PAINT_OT_weight_paint";
674 name =
"PAINT_OT_vertex_paint";
677 name =
"SCULPT_OT_brush_stroke";
680 name =
"SCULPT_CURVES_OT_brush_stroke";
719 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
735 ot->
name =
"Place Cursor";
737 ot->
idname =
"PAINTCURVE_OT_cursor";
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
ePaintMode BKE_paintmode_get_active_from_context(const struct bContext *C)
void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, int add_index)
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
struct PaintCurve * BKE_paint_curve_add(struct Main *bmain, const char *name)
@ PAINT_MODE_SCULPT_CURVES
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
#define BEZT_ISSEL_ANY(bezt)
#define OB_MODE_ALL_PAINT
Object is a sort of wrapper for general info.
void ED_paintcurve_undo_push_end(struct bContext *C)
void ED_paintcurve_undo_push_begin(const char *name)
void ED_view3d_cursor3d_update(struct bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation)
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
bool closest(btVector3 &v)
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt=1)
static int paintcurve_slide_invoke(bContext *C, wmOperator *op, const wmEvent *event)
struct PointSlideData PointSlideData
static int paintcurve_new_exec(bContext *C, wmOperator *UNUSED(op))
bool paint_curve_poll(bContext *C)
static int paintcurve_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
static PaintCurvePoint * paintcurve_point_get_closest(PaintCurve *pc, const float pos[2], bool ignore_pivot, const float threshold, char *point)
void PAINTCURVE_OT_new(wmOperatorType *ot)
static int paintcurve_point_co_index(char sel)
static void paintcurve_point_add(bContext *C, wmOperator *op, const int loc[2])
#define PAINT_CURVE_POINT_SELECT(pcp, i)
static int paintcurve_add_point_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int paintcurve_cursor_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
void PAINTCURVE_OT_add_point(wmOperatorType *ot)
void PAINTCURVE_OT_delete_point(wmOperatorType *ot)
static int paintcurve_delete_point_exec(bContext *C, wmOperator *op)
static int paintcurve_select_point_exec(bContext *C, wmOperator *op)
void PAINTCURVE_OT_draw(wmOperatorType *ot)
#define PAINT_CURVE_SELECT_THRESHOLD
static int paintcurve_draw_exec(bContext *C, wmOperator *UNUSED(op))
static char paintcurve_point_side_index(const BezTriple *bezt, const bool is_first, const char fallback)
static int paintcurve_select_point_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool paintcurve_point_select(bContext *C, wmOperator *op, const int loc[2], bool toggle, bool extend)
void PAINTCURVE_OT_cursor(wmOperatorType *ot)
void PAINTCURVE_OT_slide(wmOperatorType *ot)
static int paintcurve_add_point_exec(bContext *C, wmOperator *op)
void PAINTCURVE_OT_select(wmOperatorType *ot)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
struct PaintCurve * paint_curve
float point_initial_loc[3][2]
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *UNUSED(region))
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)