Blender  V2.93
gpencil_uv.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "MEM_guardedalloc.h"
22 
23 #include "DNA_gpencil_types.h"
24 
25 #include "BLI_blenlib.h"
26 #include "BLI_math.h"
27 #include "BLI_string.h"
28 
29 #include "BLT_translation.h"
30 
31 #include "BKE_context.h"
32 #include "BKE_gpencil.h"
33 #include "BKE_gpencil_geom.h"
34 
35 #include "RNA_access.h"
36 #include "RNA_define.h"
37 
38 #include "WM_api.h"
39 #include "WM_types.h"
40 
41 #include "UI_interface.h"
42 
43 #include "ED_gpencil.h"
44 #include "ED_numinput.h"
45 #include "ED_screen.h"
46 #include "ED_space_api.h"
47 #include "ED_util.h"
48 #include "ED_view3d.h"
49 
50 #include "DEG_depsgraph.h"
51 #include "DEG_depsgraph_query.h"
52 
53 #include "gpencil_intern.h"
54 
55 typedef struct GpUvData {
59  float ob_scale;
60 
63  float pixel_size; /* use when mouse input is interpreted as spatial distance */
64 
65  /* Arrays of original loc/rot/scale by stroke. */
67  float *array_rot;
68  float *array_scale;
69 
70  /* modal only */
71  float mcenter[2];
72  float mouse[2];
73 
75  float vinit_rotation[2];
76 
79 
80 enum {
84  GP_UV_ALL = 3,
85 };
86 
87 #define SMOOTH_FACTOR 0.3f
88 
90 {
91  const int mode = RNA_enum_get(op->ptr, "mode");
92  const char *str = TIP_("Confirm: Enter/LClick, Cancel: (Esc/RClick) %s");
93 
94  char msg[UI_MAX_DRAW_STR];
96 
97  if (area) {
98  char flts_str[NUM_STR_REP_LEN * 2];
99  switch (mode) {
100  case GP_UV_TRANSLATE: {
101  float location[2];
102  RNA_float_get_array(op->ptr, "location", location);
103  BLI_snprintf(
104  flts_str, NUM_STR_REP_LEN, ", Translation: (%f, %f)", location[0], location[1]);
105  break;
106  }
107  case GP_UV_ROTATE: {
108  BLI_snprintf(flts_str,
110  ", Rotation: %f",
111  RAD2DEG(RNA_float_get(op->ptr, "rotation")));
112  break;
113  }
114  case GP_UV_SCALE: {
115  BLI_snprintf(
116  flts_str, NUM_STR_REP_LEN, ", Scale: %f", RAD2DEG(RNA_float_get(op->ptr, "scale")));
117  break;
118  }
119  default:
120  break;
121  }
122  BLI_snprintf(msg, sizeof(msg), str, flts_str, flts_str + NUM_STR_REP_LEN);
124  }
125 }
126 
127 /* Helper: Get stroke center. */
128 static void gpencil_stroke_center(bGPDstroke *gps, float r_center[3])
129 {
130  bGPDspoint *pt;
131  int i;
132 
133  zero_v3(r_center);
134  if (gps->totpoints > 0) {
135  for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
136  add_v3_v3(r_center, &pt->x);
137  }
138 
139  mul_v3_fl(r_center, 1.0f / gps->totpoints);
140  }
141 }
142 
144 {
145  GpUvData *opdata;
146 
147  op->customdata = opdata = MEM_mallocN(sizeof(GpUvData), __func__);
148 
149  opdata->ob = CTX_data_active_object(C);
150  opdata->gpd = (bGPdata *)opdata->ob->data;
152  opdata->array_loc = NULL;
153  opdata->array_rot = NULL;
154  opdata->array_scale = NULL;
155  opdata->ob_scale = mat4_to_scale(opdata->ob->obmat);
156 
157  opdata->vinit_rotation[0] = 1.0f;
158  opdata->vinit_rotation[1] = 0.0f;
159 
160  ARegion *region = CTX_wm_region(C);
161 
164 
165  /* Calc selected strokes center. */
166  zero_v2(opdata->mcenter);
167  float center[3] = {0.0f};
168  int i = 0;
169  /* Need use evaluated to get the viewport final position. */
170  GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
171  if (gps->flag & GP_STROKE_SELECT) {
172  float r_center[3];
173  gpencil_stroke_center(gps, r_center);
174  /* Add object location. */
175  add_v3_v3(r_center, opdata->ob->obmat[3]);
176  add_v3_v3(center, r_center);
177  i++;
178  }
179  }
180  GP_EVALUATED_STROKES_END(gpstroke_iter);
181 
182  if (i > 0) {
183  mul_v3_fl(center, 1.0f / i);
184  /* Create arrays to save all transformations. */
185  opdata->array_loc = MEM_calloc_arrayN(i, sizeof(float[2]), __func__);
186  opdata->array_rot = MEM_calloc_arrayN(i, sizeof(float), __func__);
187  opdata->array_scale = MEM_calloc_arrayN(i, sizeof(float), __func__);
188  i = 0;
189  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
190  if (gps->flag & GP_STROKE_SELECT) {
191  copy_v2_v2(opdata->array_loc[i], gps->uv_translation);
192  opdata->array_rot[i] = gps->uv_rotation;
193  opdata->array_scale[i] = gps->uv_scale;
194  i++;
195  }
196  }
197  GP_EDITABLE_STROKES_END(gpstroke_iter);
198  }
199  /* Convert to 2D. */
201 
202  return true;
203 }
204 
206 {
207  GpUvData *opdata;
209 
210  opdata = op->customdata;
211 
212  ARegion *region = CTX_wm_region(C);
213 
215 
217 
218  if (area) {
220  }
222 
223  MEM_SAFE_FREE(opdata->array_loc);
224  MEM_SAFE_FREE(opdata->array_rot);
225  MEM_SAFE_FREE(opdata->array_scale);
227 }
228 
230 {
231  GpUvData *opdata = op->customdata;
232  UNUSED_VARS(opdata);
233 
235 
236  /* need to force redisplay or we may still view the modified result */
238 }
239 
241 {
242  const int mode = RNA_enum_get(op->ptr, "mode");
243  GpUvData *opdata = op->customdata;
244  bGPdata *gpd = opdata->gpd;
245 
246  bool changed = false;
247  /* Get actual vector. */
248  float vr[2];
249  float mdiff[2];
250 
251  sub_v2_v2v2(vr, opdata->mouse, opdata->mcenter);
252  normalize_v2(vr);
253 
254  float uv_rotation = angle_signed_v2v2(opdata->vinit_rotation, vr);
255 
256  int i = 0;
257 
258  /* Translate. */
259  if (mode == GP_UV_TRANSLATE) {
260 
261  mdiff[0] = opdata->mouse[0] - opdata->initial_transform[0];
262  /* Y axis is inverted. */
263  mdiff[1] = (opdata->mouse[1] - opdata->initial_transform[1]) * -1.0f;
264 
265  /* Apply a big amount of smooth always for translate to get smooth result. */
266  mul_v2_fl(mdiff, 0.002f);
267  RNA_float_set_array(op->ptr, "location", mdiff);
268 
269  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
270  if (gps->flag & GP_STROKE_SELECT) {
271 
272  sub_v2_v2v2(gps->uv_translation, opdata->array_loc[i], mdiff);
273  changed = true;
274 
275  /* Calc geometry data. */
277  i++;
278  }
279  }
280  GP_EDITABLE_STROKES_END(gpstroke_iter);
281  }
282 
283  /* Rotate. */
284  if (mode == GP_UV_ROTATE) {
285  changed |= (bool)(uv_rotation != 0.0f);
286  RNA_float_set(op->ptr, "rotation", uv_rotation);
287 
288  if (changed) {
289  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
290  if (gps->flag & GP_STROKE_SELECT) {
291  gps->uv_rotation = opdata->array_rot[i] - uv_rotation;
292 
293  /* Calc geometry data. */
295  i++;
296  }
297  }
298  GP_EDITABLE_STROKES_END(gpstroke_iter);
299  }
300  }
301 
302  /* Scale. */
303  if (mode == GP_UV_SCALE) {
304  mdiff[0] = opdata->mcenter[0] - opdata->mouse[0];
305  mdiff[1] = opdata->mcenter[1] - opdata->mouse[1];
306  float scale = ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
307  opdata->ob_scale;
308 
309  scale *= SMOOTH_FACTOR;
310  RNA_float_set(op->ptr, "scale", scale);
311 
312  changed |= (bool)(scale != 0.0f);
313 
314  if (changed) {
315  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
316  if (gps->flag & GP_STROKE_SELECT) {
317  gps->uv_scale = opdata->array_scale[i] + scale;
318  /* Calc geometry data. */
320  i++;
321  }
322  }
323  GP_EDITABLE_STROKES_END(gpstroke_iter);
324  }
325  }
326 
327  if (changed) {
328  /* Update cursor line. */
332  }
333 
334  return changed;
335 }
336 
338 {
340  return false;
341  }
343  if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
344  return false;
345  }
346  bGPdata *gpd = (bGPdata *)ob->data;
347  if (gpd == NULL) {
348  return false;
349  }
350 
352 
353  if ((gpl == NULL) || (ob->mode != OB_MODE_EDIT_GPENCIL)) {
354  return false;
355  }
356 
357  return true;
358 }
359 
361 {
363  float mlen[2];
364  float center_3d[3];
365 
366  if (!gpencil_uv_transform_init(C, op)) {
367  return OPERATOR_CANCELLED;
368  }
369 
370  GpUvData *opdata = op->customdata;
371  /* initialize mouse values */
372  opdata->mouse[0] = event->mval[0];
373  opdata->mouse[1] = event->mval[1];
374 
375  copy_v3_v3(center_3d, opdata->ob->loc);
376  mlen[0] = event->mval[0] - opdata->mcenter[0];
377  mlen[1] = event->mval[1] - opdata->mcenter[1];
378  opdata->initial_length = len_v2(mlen);
379 
380  /* Consider initial offset as zero position. */
381  copy_v2fl_v2i(opdata->initial_transform, event->mval);
382 
383  /* Consider initial position as the orientation vector. */
384  const int mode = RNA_enum_get(op->ptr, "mode");
385  if (mode == GP_UV_ROTATE) {
386  opdata->vinit_rotation[0] = mlen[0];
387  opdata->vinit_rotation[1] = mlen[1];
388  normalize_v2(opdata->vinit_rotation);
389  }
390 
391  opdata->pixel_size = rv3d ? ED_view3d_pixel_size(rv3d, center_3d) : 1.0f;
392 
394 
397 
399  return OPERATOR_RUNNING_MODAL;
400 }
401 
403 {
404  GpUvData *opdata = op->customdata;
405 
406  switch (event->type) {
407  case EVT_ESCKEY:
408  case RIGHTMOUSE: {
410  return OPERATOR_CANCELLED;
411  }
412  case MOUSEMOVE: {
413  opdata->mouse[0] = event->mval[0];
414  opdata->mouse[1] = event->mval[1];
415 
416  if (gpencil_uv_transform_calc(C, op)) {
418  }
419  else {
421  return OPERATOR_CANCELLED;
422  }
423  break;
424  }
425  case LEFTMOUSE:
426  case EVT_PADENTER:
427  case EVT_RETKEY: {
428  if ((event->val == KM_PRESS) ||
429  ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) {
432  return OPERATOR_FINISHED;
433  }
434  break;
435  }
436  }
437 
438  return OPERATOR_RUNNING_MODAL;
439 }
440 
442 {
443  static const EnumPropertyItem uv_mode[] = {
444  {GP_UV_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
445  {GP_UV_ROTATE, "ROTATE", 0, "Rotate", ""},
446  {GP_UV_SCALE, "SCALE", 0, "Scale", ""},
447  {0, NULL, 0, NULL, NULL},
448  };
449 
450  PropertyRNA *prop;
451 
452  /* identifiers */
453  ot->name = "Transform Stroke Fill";
454  ot->idname = "GPENCIL_OT_transform_fill";
455  ot->description = "Transform grease pencil stroke fill";
456 
457  /* api callbacks */
462 
463  /* flags */
465 
466  /* properties */
467  ot->prop = RNA_def_enum(ot->srna, "mode", uv_mode, GP_UV_ROTATE, "Mode", "");
468 
469  prop = RNA_def_float_vector(
470  ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "", -FLT_MAX, FLT_MAX);
472 
474  "rotation",
475  0,
476  NULL,
477  DEG2RADF(-360.0f),
478  DEG2RADF(360.0f),
479  "Rotation",
480  "",
481  DEG2RADF(-360.0f),
482  DEG2RADF(360.0f));
485 
486  prop = RNA_def_float(ot->srna, "scale", 1.0f, 0.001f, 100.0f, "Scale", "", 0.001f, 100.0f);
487  RNA_def_property_float_default(prop, 0.0f);
489 
490  prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "");
492 }
493 
494 /* Clear UV transformations. */
496 {
497  const int mode = RNA_enum_get(op->ptr, "mode");
499  bGPdata *gpd = (bGPdata *)ob->data;
500  bool changed = false;
501 
502  /* Loop all selected strokes and reset. */
503  GP_EDITABLE_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
504  if (gps->flag & GP_STROKE_SELECT) {
505  if (ELEM(mode, GP_UV_TRANSLATE, GP_UV_ALL)) {
506  zero_v2(gps->uv_translation);
507  }
508  if (ELEM(mode, GP_UV_ROTATE, GP_UV_ALL)) {
509  gps->uv_rotation = 0.0f;
510  }
511  if (ELEM(mode, GP_UV_SCALE, GP_UV_ALL)) {
512  gps->uv_scale = 1.0f;
513  }
514  /* Calc geometry data. */
516  changed = true;
517  }
518  }
519  GP_EDITABLE_STROKES_END(gpstroke_iter);
520 
521  /* notifiers */
522  if (changed) {
525  }
526 
527  return OPERATOR_FINISHED;
528 }
529 
531 {
532  static const EnumPropertyItem uv_clear_mode[] = {
533  {GP_UV_ALL, "ALL", 0, "All", ""},
534  {GP_UV_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
535  {GP_UV_ROTATE, "ROTATE", 0, "Rotate", ""},
536  {GP_UV_SCALE, "SCALE", 0, "Scale", ""},
537  {0, NULL, 0, NULL, NULL},
538  };
539 
540  /* identifiers */
541  ot->name = "Reset Fill Transformations";
542  ot->idname = "GPENCIL_OT_reset_transform_fill";
543  ot->description = "Reset any UV transformation and back to default values";
544 
545  /* callbacks */
548 
549  /* flags */
551 
552  /* properties */
553  ot->prop = RNA_def_enum(ot->srna, "mode", uv_clear_mode, GP_UV_ALL, "Mode", "");
554 }
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:769
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1650
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:2196
#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:499
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:611
@ 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:27
void ED_area_status_text(ScrArea *area, const char *str)
Definition: area.c:815
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:667
bool ED_operator_view3d_active(struct bContext *C)
Definition: screen_ops.c:230
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
Definition: spacetypes.c:238
#define REGION_DRAW_POST_PIXEL
Definition: ED_space_api.h:67
void ED_region_draw_cb_exit(struct ARegionType *, void *)
Definition: spacetypes.c:253
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:204
@ PROP_HIDDEN
Definition: RNA_types.h:202
#define C
Definition: RandGen.cpp:39
#define UI_MAX_DRAW_STR
Definition: UI_interface.h:90
#define NC_GEOM
Definition: WM_types.h:294
@ OPTYPE_BLOCKING
Definition: WM_types.h:157
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_GRAB_CURSOR_XY
Definition: WM_types.h:161
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define ND_DATA
Definition: WM_types.h:408
#define NA_EDITED
Definition: WM_types.h:462
#define KM_PRESS
Definition: WM_types.h:242
#define NC_GPENCIL
Definition: WM_types.h:300
#define KM_RELEASE
Definition: WM_types.h:243
#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, const 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)
Definition: gpencil_uv.c:143
static int gpencil_reset_transform_fill_exec(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:495
static void gpencil_uv_transform_exit(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:205
static void gpencil_uv_transform_update_header(wmOperator *op, bContext *C)
Definition: gpencil_uv.c:89
static int gpencil_transform_fill_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: gpencil_uv.c:360
#define SMOOTH_FACTOR
Definition: gpencil_uv.c:87
void GPENCIL_OT_transform_fill(wmOperatorType *ot)
Definition: gpencil_uv.c:441
static bool gpencil_transform_fill_poll(bContext *C)
Definition: gpencil_uv.c:337
void GPENCIL_OT_reset_transform_fill(wmOperatorType *ot)
Definition: gpencil_uv.c:530
static void gpencil_transform_fill_cancel(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:229
struct GpUvData GpUvData
static bool gpencil_uv_transform_calc(bContext *C, wmOperator *op)
Definition: gpencil_uv.c:240
@ GP_UV_ROTATE
Definition: gpencil_uv.c:81
@ GP_UV_ALL
Definition: gpencil_uv.c:84
@ GP_UV_SCALE
Definition: gpencil_uv.c:83
@ GP_UV_TRANSLATE
Definition: gpencil_uv.c:82
static void gpencil_stroke_center(bGPDstroke *gps, float r_center[3])
Definition: gpencil_uv.c:128
static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: gpencil_uv.c:402
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:46
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
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:6378
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6355
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
Definition: rna_access.c:6366
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
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:3825
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2042
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:3851
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
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:4005
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:3771
struct ARegionType * type
void * draw_handle_pixel
Definition: gpencil_uv.c:77
float vinit_rotation[2]
Definition: gpencil_uv.c:75
Object * ob
Definition: gpencil_uv.c:56
float pixel_size
Definition: gpencil_uv.c:63
float * array_rot
Definition: gpencil_uv.c:67
float(* array_loc)[2]
Definition: gpencil_uv.c:66
float * array_scale
Definition: gpencil_uv.c:68
bGPdata * gpd
Definition: gpencil_uv.c:57
float mcenter[2]
Definition: gpencil_uv.c:71
float mouse[2]
Definition: gpencil_uv.c:72
float ob_scale
Definition: gpencil_uv.c:59
float initial_transform[2]
Definition: gpencil_uv.c:62
float initial_length
Definition: gpencil_uv.c:61
GP_SpaceConversion gsc
Definition: gpencil_uv.c:58
float loc[3]
float obmat[4][4]
void * data
bGPDspoint * points
short val
Definition: WM_types.h:579
int mval[2]
Definition: WM_types.h:583
short type
Definition: WM_types.h:577
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
PropertyRNA * prop
Definition: WM_types.h:814
struct PointerRNA * ptr
void WM_cursor_set(wmWindow *win, int curs)
Definition: wm_cursors.c:142
@ WM_CURSOR_DEFAULT
Definition: wm_cursors.h:34
@ WM_CURSOR_EW_ARROW
Definition: wm_cursors.h:61
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:3156