Blender  V3.3
gpencil_uv.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "MEM_guardedalloc.h"
8 
9 #include "DNA_gpencil_types.h"
10 
11 #include "BLI_blenlib.h"
12 #include "BLI_math.h"
13 #include "BLI_string.h"
14 
15 #include "BLT_translation.h"
16 
17 #include "BKE_context.h"
18 #include "BKE_gpencil.h"
19 #include "BKE_gpencil_geom.h"
20 
21 #include "RNA_access.h"
22 #include "RNA_define.h"
23 
24 #include "WM_api.h"
25 #include "WM_types.h"
26 
27 #include "UI_interface.h"
28 
29 #include "ED_gpencil.h"
30 #include "ED_numinput.h"
31 #include "ED_screen.h"
32 #include "ED_space_api.h"
33 #include "ED_util.h"
34 #include "ED_view3d.h"
35 
36 #include "DEG_depsgraph.h"
37 #include "DEG_depsgraph_query.h"
38 
39 #include "gpencil_intern.h"
40 
41 typedef struct GpUvData {
45  float ob_scale;
46 
49  float pixel_size; /* use when mouse input is interpreted as spatial distance */
50 
51  /* Arrays of original loc/rot/scale by stroke. */
53  float *array_rot;
54  float *array_scale;
55 
56  /* modal only */
57  float mcenter[2];
58  float mouse[2];
59 
61  float vinit_rotation[2];
62 
65 
66 enum {
70  GP_UV_ALL = 3,
71 };
72 
73 #define SMOOTH_FACTOR 0.3f
74 
76 {
77  const int mode = RNA_enum_get(op->ptr, "mode");
78  const char *str = TIP_("Confirm: Enter/LClick, Cancel: (Esc/RClick) %s");
79 
80  char msg[UI_MAX_DRAW_STR];
82 
83  if (area) {
84  char flts_str[NUM_STR_REP_LEN * 2];
85  switch (mode) {
86  case GP_UV_TRANSLATE: {
87  float location[2];
88  RNA_float_get_array(op->ptr, "location", location);
90  flts_str, NUM_STR_REP_LEN, ", Translation: (%f, %f)", location[0], location[1]);
91  break;
92  }
93  case GP_UV_ROTATE: {
94  BLI_snprintf(flts_str,
96  ", Rotation: %f",
97  RAD2DEG(RNA_float_get(op->ptr, "rotation")));
98  break;
99  }
100  case GP_UV_SCALE: {
101  BLI_snprintf(
102  flts_str, NUM_STR_REP_LEN, ", Scale: %f", RAD2DEG(RNA_float_get(op->ptr, "scale")));
103  break;
104  }
105  default:
106  break;
107  }
108  BLI_snprintf(msg, sizeof(msg), str, flts_str, flts_str + NUM_STR_REP_LEN);
110  }
111 }
112 
113 /* Helper: Get stroke center. */
114 static void gpencil_stroke_center(bGPDstroke *gps, float r_center[3])
115 {
116  bGPDspoint *pt;
117  int i;
118 
119  zero_v3(r_center);
120  if (gps->totpoints > 0) {
121  for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
122  add_v3_v3(r_center, &pt->x);
123  }
124 
125  mul_v3_fl(r_center, 1.0f / gps->totpoints);
126  }
127 }
128 
130 {
131  GpUvData *opdata;
132 
133  op->customdata = opdata = MEM_mallocN(sizeof(GpUvData), __func__);
134 
135  opdata->ob = CTX_data_active_object(C);
136  opdata->gpd = (bGPdata *)opdata->ob->data;
138  opdata->array_loc = NULL;
139  opdata->array_rot = NULL;
140  opdata->array_scale = NULL;
141  opdata->ob_scale = mat4_to_scale(opdata->ob->obmat);
142 
143  opdata->vinit_rotation[0] = 1.0f;
144  opdata->vinit_rotation[1] = 0.0f;
145 
146  ARegion *region = CTX_wm_region(C);
147 
150 
151  /* Calc selected strokes center. */
152  zero_v2(opdata->mcenter);
153  float center[3] = {0.0f};
154  int i = 0;
155  /* Need use evaluated to get the viewport final position. */
156  GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
157  if (gps->flag & GP_STROKE_SELECT) {
158  float r_center[3];
159  gpencil_stroke_center(gps, r_center);
160  /* Add object location. */
161  add_v3_v3(r_center, opdata->ob->obmat[3]);
162  add_v3_v3(center, r_center);
163  i++;
164  }
165  }
166  GP_EVALUATED_STROKES_END(gpstroke_iter);
167 
168  if (i > 0) {
169  mul_v3_fl(center, 1.0f / i);
170  /* Create arrays to save all transformations. */
171  opdata->array_loc = MEM_calloc_arrayN(i, sizeof(float[2]), __func__);
172  opdata->array_rot = MEM_calloc_arrayN(i, sizeof(float), __func__);
173  opdata->array_scale = MEM_calloc_arrayN(i, sizeof(float), __func__);
174  i = 0;
175  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
176  if (gps->flag & GP_STROKE_SELECT) {
177  copy_v2_v2(opdata->array_loc[i], gps->uv_translation);
178  opdata->array_rot[i] = gps->uv_rotation;
179  opdata->array_scale[i] = gps->uv_scale;
180  i++;
181  }
182  }
183  GP_EDITABLE_STROKES_END(gpstroke_iter);
184  }
185  /* Convert to 2D. */
187 
188  return true;
189 }
190 
192 {
193  GpUvData *opdata;
195 
196  opdata = op->customdata;
197 
198  ARegion *region = CTX_wm_region(C);
199 
201 
203 
204  if (area) {
206  }
208 
209  MEM_SAFE_FREE(opdata->array_loc);
210  MEM_SAFE_FREE(opdata->array_rot);
211  MEM_SAFE_FREE(opdata->array_scale);
213 }
214 
216 {
217  GpUvData *opdata = op->customdata;
218  UNUSED_VARS(opdata);
219 
221 
222  /* need to force redisplay or we may still view the modified result */
224 }
225 
227 {
228  const int mode = RNA_enum_get(op->ptr, "mode");
229  GpUvData *opdata = op->customdata;
230  bGPdata *gpd = opdata->gpd;
231 
232  bool changed = false;
233  /* Get actual vector. */
234  float vr[2];
235  float mdiff[2];
236 
237  sub_v2_v2v2(vr, opdata->mouse, opdata->mcenter);
238  normalize_v2(vr);
239 
240  float uv_rotation = angle_signed_v2v2(opdata->vinit_rotation, vr);
241 
242  int i = 0;
243 
244  /* Translate. */
245  if (mode == GP_UV_TRANSLATE) {
246 
247  mdiff[0] = opdata->mouse[0] - opdata->initial_transform[0];
248  /* Y axis is inverted. */
249  mdiff[1] = (opdata->mouse[1] - opdata->initial_transform[1]) * -1.0f;
250 
251  /* Apply a big amount of smooth always for translate to get smooth result. */
252  mul_v2_fl(mdiff, 0.002f);
253  RNA_float_set_array(op->ptr, "location", mdiff);
254 
255  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
256  if (gps->flag & GP_STROKE_SELECT) {
257 
258  sub_v2_v2v2(gps->uv_translation, opdata->array_loc[i], mdiff);
259  changed = true;
260 
261  /* Calc geometry data. */
263  i++;
264  }
265  }
266  GP_EDITABLE_STROKES_END(gpstroke_iter);
267  }
268 
269  /* Rotate. */
270  if (mode == GP_UV_ROTATE) {
271  changed |= (bool)(uv_rotation != 0.0f);
272  RNA_float_set(op->ptr, "rotation", uv_rotation);
273 
274  if (changed) {
275  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
276  if (gps->flag & GP_STROKE_SELECT) {
277  gps->uv_rotation = opdata->array_rot[i] - uv_rotation;
278 
279  /* Calc geometry data. */
281  i++;
282  }
283  }
284  GP_EDITABLE_STROKES_END(gpstroke_iter);
285  }
286  }
287 
288  /* Scale. */
289  if (mode == GP_UV_SCALE) {
290  mdiff[0] = opdata->mcenter[0] - opdata->mouse[0];
291  mdiff[1] = opdata->mcenter[1] - opdata->mouse[1];
292  float scale = ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
293  opdata->ob_scale;
294 
295  scale *= SMOOTH_FACTOR;
296  RNA_float_set(op->ptr, "scale", scale);
297 
298  changed |= (bool)(scale != 0.0f);
299 
300  if (changed) {
301  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
302  if (gps->flag & GP_STROKE_SELECT) {
303  gps->uv_scale = opdata->array_scale[i] + scale;
304  /* Calc geometry data. */
306  i++;
307  }
308  }
309  GP_EDITABLE_STROKES_END(gpstroke_iter);
310  }
311  }
312 
313  if (changed) {
314  /* Update cursor line. */
318  }
319 
320  return changed;
321 }
322 
324 {
326  return false;
327  }
329  if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
330  return false;
331  }
332  bGPdata *gpd = (bGPdata *)ob->data;
333  if (gpd == NULL) {
334  return false;
335  }
336 
338 
339  if ((gpl == NULL) || (ob->mode != OB_MODE_EDIT_GPENCIL)) {
340  return false;
341  }
342 
343  return true;
344 }
345 
347 {
349  float mlen[2];
350  float center_3d[3];
351 
352  if (!gpencil_uv_transform_init(C, op)) {
353  return OPERATOR_CANCELLED;
354  }
355 
356  GpUvData *opdata = op->customdata;
357  /* initialize mouse values */
358  opdata->mouse[0] = event->mval[0];
359  opdata->mouse[1] = event->mval[1];
360 
361  copy_v3_v3(center_3d, opdata->ob->loc);
362  mlen[0] = event->mval[0] - opdata->mcenter[0];
363  mlen[1] = event->mval[1] - opdata->mcenter[1];
364  opdata->initial_length = len_v2(mlen);
365 
366  /* Consider initial offset as zero position. */
367  copy_v2fl_v2i(opdata->initial_transform, event->mval);
368 
369  /* Consider initial position as the orientation vector. */
370  const int mode = RNA_enum_get(op->ptr, "mode");
371  if (mode == GP_UV_ROTATE) {
372  opdata->vinit_rotation[0] = mlen[0];
373  opdata->vinit_rotation[1] = mlen[1];
374  normalize_v2(opdata->vinit_rotation);
375  }
376 
377  opdata->pixel_size = rv3d ? ED_view3d_pixel_size(rv3d, center_3d) : 1.0f;
378 
380 
383 
385  return OPERATOR_RUNNING_MODAL;
386 }
387 
389 {
390  GpUvData *opdata = op->customdata;
391 
392  switch (event->type) {
393  case EVT_ESCKEY:
394  case RIGHTMOUSE: {
396  return OPERATOR_CANCELLED;
397  }
398  case MOUSEMOVE: {
399  opdata->mouse[0] = event->mval[0];
400  opdata->mouse[1] = event->mval[1];
401 
402  if (gpencil_uv_transform_calc(C, op)) {
404  }
405  else {
407  return OPERATOR_CANCELLED;
408  }
409  break;
410  }
411  case LEFTMOUSE:
412  case EVT_PADENTER:
413  case EVT_RETKEY: {
414  if ((event->val == KM_PRESS) ||
415  ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) {
418  return OPERATOR_FINISHED;
419  }
420  break;
421  }
422  }
423 
424  return OPERATOR_RUNNING_MODAL;
425 }
426 
428 {
429  static const EnumPropertyItem uv_mode[] = {
430  {GP_UV_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
431  {GP_UV_ROTATE, "ROTATE", 0, "Rotate", ""},
432  {GP_UV_SCALE, "SCALE", 0, "Scale", ""},
433  {0, NULL, 0, NULL, NULL},
434  };
435 
436  PropertyRNA *prop;
437 
438  /* identifiers */
439  ot->name = "Transform Stroke Fill";
440  ot->idname = "GPENCIL_OT_transform_fill";
441  ot->description = "Transform grease pencil stroke fill";
442 
443  /* api callbacks */
448 
449  /* flags */
451 
452  /* properties */
453  ot->prop = RNA_def_enum(ot->srna, "mode", uv_mode, GP_UV_ROTATE, "Mode", "");
454 
455  prop = RNA_def_float_vector(
456  ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "", -FLT_MAX, FLT_MAX);
458 
460  "rotation",
461  0,
462  NULL,
463  DEG2RADF(-360.0f),
464  DEG2RADF(360.0f),
465  "Rotation",
466  "",
467  DEG2RADF(-360.0f),
468  DEG2RADF(360.0f));
471 
472  prop = RNA_def_float(ot->srna, "scale", 1.0f, 0.001f, 100.0f, "Scale", "", 0.001f, 100.0f);
473  RNA_def_property_float_default(prop, 0.0f);
475 
476  prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "");
478 }
479 
480 /* Clear UV transformations. */
482 {
483  const int mode = RNA_enum_get(op->ptr, "mode");
485  bGPdata *gpd = (bGPdata *)ob->data;
486  bool changed = false;
487 
488  /* Loop all selected strokes and reset. */
489  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
490  if (gps->flag & GP_STROKE_SELECT) {
491  if (ELEM(mode, GP_UV_TRANSLATE, GP_UV_ALL)) {
492  zero_v2(gps->uv_translation);
493  }
494  if (ELEM(mode, GP_UV_ROTATE, GP_UV_ALL)) {
495  gps->uv_rotation = 0.0f;
496  }
497  if (ELEM(mode, GP_UV_SCALE, GP_UV_ALL)) {
498  gps->uv_scale = 1.0f;
499  }
500  /* Calc geometry data. */
502  changed = true;
503  }
504  }
505  GP_EDITABLE_STROKES_END(gpstroke_iter);
506 
507  /* notifiers */
508  if (changed) {
511  }
512 
513  return OPERATOR_FINISHED;
514 }
515 
517 {
518  static const EnumPropertyItem uv_clear_mode[] = {
519  {GP_UV_ALL, "ALL", 0, "All", ""},
520  {GP_UV_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
521  {GP_UV_ROTATE, "ROTATE", 0, "Rotate", ""},
522  {GP_UV_SCALE, "SCALE", 0, "Scale", ""},
523  {0, NULL, 0, NULL, NULL},
524  };
525 
526  /* identifiers */
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";
530 
531  /* callbacks */
534 
535  /* flags */
537 
538  /* properties */
539  ot->prop = RNA_def_enum(ot->srna, "mode", uv_clear_mode, GP_UV_ALL, "Mode", "");
540 }
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:793
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1558
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
float mat4_to_scale(const float M[4][4])
Definition: math_matrix.c:2185
#define DEG2RADF(_deg)
#define RAD2DEG(_rad)
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
Definition: math_vector.c:439
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
#define UNUSED_VARS(...)
#define ELEM(...)
#define TIP_(msgid)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ GP_STROKE_SELECT
@ GP_STROKE_3DSPACE
@ OB_MODE_EDIT_GPENCIL
@ OB_GPENCIL
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
#define NUM_STR_REP_LEN
Definition: ED_numinput.h:13
void ED_area_status_text(ScrArea *area, const char *str)
Definition: area.c:792
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
bool ED_operator_view3d_active(struct bContext *C)
Definition: screen_ops.c:225
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
Definition: spacetypes.c:226
#define REGION_DRAW_POST_PIXEL
Definition: ED_space_api.h:63
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
Definition: spacetypes.c:241
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.
#define MEM_SAFE_FREE(v)
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
@ PROP_HIDDEN
Definition: RNA_types.h:216
#define C
Definition: RandGen.cpp:25
#define UI_MAX_DRAW_STR
Definition: UI_interface.h:91
@ KM_PRESS
Definition: WM_types.h:267
@ KM_RELEASE
Definition: WM_types.h:268
@ OPTYPE_BLOCKING
Definition: WM_types.h:150
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_GRAB_CURSOR_XY
Definition: WM_types.h:154
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DATA
Definition: WM_types.h:456
#define NA_EDITED
Definition: WM_types.h:523
#define NC_GPENCIL
Definition: WM_types.h:349
#define str(s)
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)
@ GP_UV_ROTATE
Definition: gpencil_uv.c:67
@ GP_UV_ALL
Definition: gpencil_uv.c:70
@ GP_UV_SCALE
Definition: gpencil_uv.c:69
@ GP_UV_TRANSLATE
Definition: gpencil_uv.c:68
static bool gpencil_uv_transform_init(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:129
static int gpencil_reset_transform_fill_exec(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:481
static void gpencil_uv_transform_exit(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:191
static void gpencil_uv_transform_update_header(wmOperator *op, bContext *C)
Definition: gpencil_uv.c:75
static int gpencil_transform_fill_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: gpencil_uv.c:346
#define SMOOTH_FACTOR
Definition: gpencil_uv.c:73
void GPENCIL_OT_transform_fill(wmOperatorType *ot)
Definition: gpencil_uv.c:427
static bool gpencil_transform_fill_poll(bContext *C)
Definition: gpencil_uv.c:323
void GPENCIL_OT_reset_transform_fill(wmOperatorType *ot)
Definition: gpencil_uv.c:516
static void gpencil_transform_fill_cancel(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:215
struct GpUvData GpUvData
static bool gpencil_uv_transform_calc(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:226
static void gpencil_stroke_center(bGPDstroke *gps, float r_center[3])
Definition: gpencil_uv.c:114
static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: gpencil_uv.c:388
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:32
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
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)
Definition: rna_access.c:4980
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4957
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
Definition: rna_access.c:4968
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:4992
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
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)
Definition: rna_define.c:3836
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
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)
Definition: rna_define.c:3862
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
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)
Definition: rna_define.c:4016
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
struct ARegionType * type
void * draw_handle_pixel
Definition: gpencil_uv.c:63
float vinit_rotation[2]
Definition: gpencil_uv.c:61
Object * ob
Definition: gpencil_uv.c:42
float pixel_size
Definition: gpencil_uv.c:49
float * array_rot
Definition: gpencil_uv.c:53
float(* array_loc)[2]
Definition: gpencil_uv.c:52
float * array_scale
Definition: gpencil_uv.c:54
bGPdata * gpd
Definition: gpencil_uv.c:43
float mcenter[2]
Definition: gpencil_uv.c:57
float mouse[2]
Definition: gpencil_uv.c:58
float ob_scale
Definition: gpencil_uv.c:45
float initial_transform[2]
Definition: gpencil_uv.c:48
float initial_length
Definition: gpencil_uv.c:47
GP_SpaceConversion gsc
Definition: gpencil_uv.c:44
float loc[3]
float obmat[4][4]
void * data
bGPDspoint * points
short val
Definition: WM_types.h:680
int mval[2]
Definition: WM_types.h:684
short type
Definition: WM_types.h:678
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
PropertyRNA * prop
Definition: WM_types.h:981
struct PointerRNA * ptr
void WM_cursor_set(wmWindow *win, int curs)
Definition: wm_cursors.c:126
@ WM_CURSOR_DEFAULT
Definition: wm_cursors.h:18
@ WM_CURSOR_EW_ARROW
Definition: wm_cursors.h:45
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)
@ RIGHTMOUSE
@ EVT_PADENTER
@ MOUSEMOVE
@ LEFTMOUSE
@ EVT_ESCKEY
@ EVT_RETKEY
wmOperatorType * ot
Definition: wm_files.c:3479