73 #define SMOOTH_FACTOR 0.3f
78 const char *
str =
TIP_(
"Confirm: Enter/LClick, Cancel: (Esc/RClick) %s");
90 flts_str,
NUM_STR_REP_LEN,
", Translation: (%f, %f)", location[0], location[1]);
121 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
232 bool changed =
false;
271 changed |= (
bool)(uv_rotation != 0.0f);
277 gps->uv_rotation = opdata->
array_rot[i] - uv_rotation;
298 changed |= (
bool)(scale != 0.0f);
358 opdata->
mouse[0] =
event->mval[0];
359 opdata->
mouse[1] =
event->mval[1];
362 mlen[0] =
event->mval[0] - opdata->
mcenter[0];
363 mlen[1] =
event->mval[1] - opdata->
mcenter[1];
392 switch (event->
type) {
399 opdata->
mouse[0] =
event->mval[0];
400 opdata->
mouse[1] =
event->mval[1];
439 ot->
name =
"Transform Stroke Fill";
440 ot->
idname =
"GPENCIL_OT_transform_fill";
456 ot->
srna,
"location", 2,
NULL, -FLT_MAX, FLT_MAX,
"Location",
"", -FLT_MAX, FLT_MAX);
472 prop =
RNA_def_float(
ot->
srna,
"scale", 1.0f, 0.001f, 100.0f,
"Scale",
"", 0.001f, 100.0f);
486 bool changed =
false;
495 gps->uv_rotation = 0.0f;
498 gps->uv_scale = 1.0f;
527 ot->
name =
"Reset Fill Transformations";
528 ot->
idname =
"GPENCIL_OT_reset_transform_fill";
529 ot->
description =
"Reset any UV transformation and back to default values";
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
float mat4_to_scale(const float M[4][4])
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
float angle_signed_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v2(float r[2])
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v2(float r[2])
MINLINE void add_v3_v3(float r[3], const float a[3])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void DEG_id_tag_update(struct ID *id, int flag)
void ED_area_status_text(ScrArea *area, const char *str)
void ED_region_tag_redraw(struct ARegion *region)
bool ED_operator_view3d_active(struct bContext *C)
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_PIXEL
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
void ED_region_draw_mouse_line_cb(const struct bContext *C, struct ARegion *region, void *arg_info)
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3])
NSNotificationCenter * center
Read Guarded memory(de)allocation.
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
#define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
#define GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc, short flag, const float pt[3], float xy[2])
#define GP_EDITABLE_STROKES_END(gpstroke_iter)
#define GP_EVALUATED_STROKES_END(gpstroke_iter)
static bool gpencil_uv_transform_init(bContext *C, wmOperator *op)
static int gpencil_reset_transform_fill_exec(bContext *C, wmOperator *op)
static void gpencil_uv_transform_exit(bContext *C, wmOperator *op)
static void gpencil_uv_transform_update_header(wmOperator *op, bContext *C)
static int gpencil_transform_fill_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void GPENCIL_OT_transform_fill(wmOperatorType *ot)
static bool gpencil_transform_fill_poll(bContext *C)
void GPENCIL_OT_reset_transform_fill(wmOperatorType *ot)
static void gpencil_transform_fill_cancel(bContext *C, wmOperator *op)
static bool gpencil_uv_transform_calc(bContext *C, wmOperator *op)
static void gpencil_stroke_center(bGPDstroke *gps, float r_center[3])
static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct ARegionType * type
float initial_transform[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
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_cursor_set(wmWindow *win, int curs)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)