Blender  V3.3
node_gizmo.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <cmath>
8 
9 #include "BLI_math_matrix.h"
10 #include "BLI_math_vector.h"
11 #include "BLI_rect.h"
12 #include "BLI_utildefines.h"
13 
14 #include "BKE_context.h"
15 #include "BKE_image.h"
16 #include "BKE_main.h"
17 
18 #include "ED_gizmo_library.h"
19 #include "ED_screen.h"
20 
21 #include "IMB_imbuf_types.h"
22 
23 #include "MEM_guardedalloc.h"
24 
25 #include "RNA_access.h"
26 #include "RNA_prototypes.h"
27 
28 #include "WM_api.h"
29 #include "WM_types.h"
30 
31 #include "node_intern.hh"
32 
33 namespace blender::ed::space_node {
34 
35 /* -------------------------------------------------------------------- */
39 static void node_gizmo_calc_matrix_space(const SpaceNode *snode,
40  const ARegion *region,
41  float matrix_space[4][4])
42 {
43  unit_m4(matrix_space);
44  mul_v3_fl(matrix_space[0], snode->zoom);
45  mul_v3_fl(matrix_space[1], snode->zoom);
46  matrix_space[3][0] = (region->winx / 2) + snode->xof;
47  matrix_space[3][1] = (region->winy / 2) + snode->yof;
48 }
49 
51  const ARegion *region,
52  const float image_dims[2],
53  float matrix_space[4][4])
54 {
55  unit_m4(matrix_space);
56  mul_v3_fl(matrix_space[0], snode->zoom * image_dims[0]);
57  mul_v3_fl(matrix_space[1], snode->zoom * image_dims[1]);
58  matrix_space[3][0] = ((region->winx / 2) + snode->xof) - ((image_dims[0] / 2.0f) * snode->zoom);
59  matrix_space[3][1] = ((region->winy / 2) + snode->yof) - ((image_dims[1] / 2.0f) * snode->zoom);
60 }
61 
64 /* -------------------------------------------------------------------- */
69  wmGizmoProperty *gz_prop,
70  void *value_p)
71 {
72  float(*matrix)[4] = (float(*)[4])value_p;
73  BLI_assert(gz_prop->type->array_length == 16);
74  const SpaceNode *snode = (const SpaceNode *)gz_prop->custom_func.user_data;
75  matrix[0][0] = snode->zoom;
76  matrix[1][1] = snode->zoom;
77  matrix[3][0] = snode->xof;
78  matrix[3][1] = snode->yof;
79 }
80 
82  wmGizmoProperty *gz_prop,
83  const void *value_p)
84 {
85  const float(*matrix)[4] = (const float(*)[4])value_p;
86  BLI_assert(gz_prop->type->array_length == 16);
87  SpaceNode *snode = (SpaceNode *)gz_prop->custom_func.user_data;
88  snode->zoom = matrix[0][0];
89  snode->xof = matrix[3][0];
90  snode->yof = matrix[3][1];
91 }
92 
94 {
95  SpaceNode *snode = CTX_wm_space_node(C);
96 
97  if ((snode->flag & SNODE_BACKDRAW) == 0) {
98  return false;
99  }
100 
101  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
102  bNode *node = nodeGetActive(snode->edittree);
103 
105  return true;
106  }
107  }
108 
109  return false;
110 }
111 
113 {
114  wmGizmoWrapper *wwrapper = (wmGizmoWrapper *)MEM_mallocN(sizeof(wmGizmoWrapper), __func__);
115 
116  wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
117 
118  RNA_enum_set(wwrapper->gizmo->ptr,
119  "transform",
121 
122  gzgroup->customdata = wwrapper;
123 }
124 
126 {
127  Main *bmain = CTX_data_main(C);
128  wmGizmo *cage = ((wmGizmoWrapper *)gzgroup->customdata)->gizmo;
129  const ARegion *region = CTX_wm_region(C);
130  /* center is always at the origin */
131  const float origin[3] = {float(region->winx / 2), float(region->winy / 2), 0.0f};
132 
133  void *lock;
134  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
135  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
136 
137  if (ibuf) {
138  const float dims[2] = {
139  (ibuf->x > 0) ? ibuf->x : 64.0f,
140  (ibuf->y > 0) ? ibuf->y : 64.0f,
141  };
142 
143  RNA_float_set_array(cage->ptr, "dimensions", dims);
144  WM_gizmo_set_matrix_location(cage, origin);
145  WM_gizmo_set_flag(cage, WM_GIZMO_HIDDEN, false);
146 
147  /* Need to set property here for undo. TODO: would prefer to do this in _init. */
148  SpaceNode *snode = CTX_wm_space_node(C);
149 #if 0
150  PointerRNA nodeptr;
151  RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode, &nodeptr);
152  WM_gizmo_target_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1);
153  WM_gizmo_target_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1);
154 #endif
155 
159  params.range_get_fn = nullptr;
160  params.user_data = snode;
161  WM_gizmo_target_property_def_func(cage, "matrix", &params);
162  }
163  else {
164  WM_gizmo_set_flag(cage, WM_GIZMO_HIDDEN, true);
165  }
166 
167  BKE_image_release_ibuf(ima, ibuf, lock);
168 }
169 
171 {
172  gzgt->name = "Backdrop Transform Widget";
173  gzgt->idname = "NODE_GGT_backdrop_transform";
174 
176 
181 }
182 
185 /* -------------------------------------------------------------------- */
191 
192  struct {
193  float dims[2];
194  } state;
195 
196  struct {
201 };
202 
203 static void gizmo_node_crop_update(struct NodeCropWidgetGroup *crop_group)
204 {
206  crop_group->update_data.context, &crop_group->update_data.ptr, crop_group->update_data.prop);
207 }
208 
209 static void two_xy_to_rect(const NodeTwoXYs *nxy,
210  rctf *rect,
211  const float dims[2],
212  bool is_relative)
213 {
214  if (is_relative) {
215  rect->xmin = nxy->fac_x1;
216  rect->xmax = nxy->fac_x2;
217  rect->ymin = nxy->fac_y1;
218  rect->ymax = nxy->fac_y2;
219  }
220  else {
221  rect->xmin = nxy->x1 / dims[0];
222  rect->xmax = nxy->x2 / dims[0];
223  rect->ymin = nxy->y1 / dims[1];
224  rect->ymax = nxy->y2 / dims[1];
225  }
226 }
227 
228 static void two_xy_from_rect(NodeTwoXYs *nxy,
229  const rctf *rect,
230  const float dims[2],
231  bool is_relative)
232 {
233  if (is_relative) {
234  nxy->fac_x1 = rect->xmin;
235  nxy->fac_x2 = rect->xmax;
236  nxy->fac_y1 = rect->ymin;
237  nxy->fac_y2 = rect->ymax;
238  }
239  else {
240  nxy->x1 = rect->xmin * dims[0];
241  nxy->x2 = rect->xmax * dims[0];
242  nxy->y1 = rect->ymin * dims[1];
243  nxy->y2 = rect->ymax * dims[1];
244  }
245 }
246 
247 /* scale callbacks */
249  wmGizmoProperty *gz_prop,
250  void *value_p)
251 {
252  float(*matrix)[4] = (float(*)[4])value_p;
253  BLI_assert(gz_prop->type->array_length == 16);
255  const float *dims = crop_group->state.dims;
256  const bNode *node = (const bNode *)gz_prop->custom_func.user_data;
257  const NodeTwoXYs *nxy = (const NodeTwoXYs *)node->storage;
258  bool is_relative = (bool)node->custom2;
259  rctf rct;
260  two_xy_to_rect(nxy, &rct, dims, is_relative);
261  matrix[0][0] = fabsf(BLI_rctf_size_x(&rct));
262  matrix[1][1] = fabsf(BLI_rctf_size_y(&rct));
263  matrix[3][0] = (BLI_rctf_cent_x(&rct) - 0.5f) * dims[0];
264  matrix[3][1] = (BLI_rctf_cent_y(&rct) - 0.5f) * dims[1];
265 }
266 
268  wmGizmoProperty *gz_prop,
269  const void *value_p)
270 {
271  const float(*matrix)[4] = (const float(*)[4])value_p;
272  BLI_assert(gz_prop->type->array_length == 16);
274  const float *dims = crop_group->state.dims;
275  bNode *node = (bNode *)gz_prop->custom_func.user_data;
276  NodeTwoXYs *nxy = (NodeTwoXYs *)node->storage;
277  bool is_relative = (bool)node->custom2;
278  rctf rct;
279  two_xy_to_rect(nxy, &rct, dims, is_relative);
280  const bool nx = rct.xmin > rct.xmax;
281  const bool ny = rct.ymin > rct.ymax;
282  BLI_rctf_resize(&rct, fabsf(matrix[0][0]), fabsf(matrix[1][1]));
283  BLI_rctf_recenter(&rct, (matrix[3][0] / dims[0]) + 0.5f, (matrix[3][1] / dims[1]) + 0.5f);
284  rctf rct_isect{};
285  rct_isect.xmin = 0;
286  rct_isect.xmax = 1;
287  rct_isect.ymin = 0;
288  rct_isect.ymax = 1;
289  BLI_rctf_isect(&rct_isect, &rct, &rct);
290  if (nx) {
291  SWAP(float, rct.xmin, rct.xmax);
292  }
293  if (ny) {
294  SWAP(float, rct.ymin, rct.ymax);
295  }
296  two_xy_from_rect(nxy, &rct, dims, is_relative);
297  gizmo_node_crop_update(crop_group);
298 }
299 
301 {
302  SpaceNode *snode = CTX_wm_space_node(C);
303 
304  if ((snode->flag & SNODE_BACKDRAW) == 0) {
305  return false;
306  }
307 
308  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
309  bNode *node = nodeGetActive(snode->edittree);
310 
311  if (node && ELEM(node->type, CMP_NODE_CROP)) {
312  /* ignore 'use_crop_size', we can't usefully edit the crop in this case. */
313  if ((node->custom1 & (1 << 0)) == 0) {
314  return true;
315  }
316  }
317  }
318 
319  return false;
320 }
321 
322 static void WIDGETGROUP_node_crop_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
323 {
324  struct NodeCropWidgetGroup *crop_group = (NodeCropWidgetGroup *)MEM_mallocN(
325  sizeof(struct NodeCropWidgetGroup), __func__);
326 
327  crop_group->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
328 
329  RNA_enum_set(crop_group->border->ptr,
330  "transform",
332 
333  gzgroup->customdata = crop_group;
334 }
335 
337 {
338  ARegion *region = CTX_wm_region(C);
339  wmGizmo *gz = (wmGizmo *)gzgroup->gizmos.first;
340 
341  SpaceNode *snode = CTX_wm_space_node(C);
342 
343  node_gizmo_calc_matrix_space(snode, region, gz->matrix_space);
344 }
345 
347 {
348  Main *bmain = CTX_data_main(C);
349  NodeCropWidgetGroup *crop_group = (NodeCropWidgetGroup *)gzgroup->customdata;
350  wmGizmo *gz = crop_group->border;
351 
352  void *lock;
353  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
354  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
355 
356  if (ibuf) {
357  crop_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
358  crop_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
359 
360  RNA_float_set_array(gz->ptr, "dimensions", crop_group->state.dims);
362 
363  SpaceNode *snode = CTX_wm_space_node(C);
364  bNode *node = nodeGetActive(snode->edittree);
365 
366  crop_group->update_data.context = (bContext *)C;
368  (ID *)snode->edittree, &RNA_CompositorNodeCrop, node, &crop_group->update_data.ptr);
369  crop_group->update_data.prop = RNA_struct_find_property(&crop_group->update_data.ptr,
370  "relative");
371 
375  params.range_get_fn = nullptr;
376  params.user_data = node;
378  }
379  else {
381  }
382 
383  BKE_image_release_ibuf(ima, ibuf, lock);
384 }
385 
387 {
388  gzgt->name = "Backdrop Crop Widget";
389  gzgt->idname = "NODE_GGT_backdrop_crop";
390 
392 
398 }
399 
402 /* -------------------------------------------------------------------- */
408 
409  struct {
410  float dims[2];
411  } state;
412 };
413 
415 {
416  SpaceNode *snode = CTX_wm_space_node(C);
417 
418  if ((snode->flag & SNODE_BACKDRAW) == 0) {
419  return false;
420  }
421 
422  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
423  bNode *node = nodeGetActive(snode->edittree);
424 
425  if (node && ELEM(node->type, CMP_NODE_SUNBEAMS)) {
426  return true;
427  }
428  }
429 
430  return false;
431 }
432 
434 {
436  sizeof(NodeSunBeamsWidgetGroup), __func__);
437 
438  sbeam_group->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, nullptr);
439  wmGizmo *gz = sbeam_group->gizmo;
440 
441  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_MOVE_STYLE_CROSS_2D);
442 
443  gz->scale_basis = 0.05f / 75.0f;
444 
445  gzgroup->customdata = sbeam_group;
446 }
447 
449 {
451  ARegion *region = CTX_wm_region(C);
452  wmGizmo *gz = (wmGizmo *)gzgroup->gizmos.first;
453 
454  SpaceNode *snode = CTX_wm_space_node(C);
455 
457  snode, region, sbeam_group->state.dims, gz->matrix_space);
458 }
459 
460 static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgroup)
461 {
462  Main *bmain = CTX_data_main(C);
464  wmGizmo *gz = sbeam_group->gizmo;
465 
466  void *lock;
467  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
468  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
469 
470  if (ibuf) {
471  sbeam_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
472  sbeam_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
473 
474  SpaceNode *snode = CTX_wm_space_node(C);
475  bNode *node = nodeGetActive(snode->edittree);
476 
477  /* Need to set property here for undo. TODO: would prefer to do this in _init. */
478  PointerRNA nodeptr;
479  RNA_pointer_create((ID *)snode->edittree, &RNA_CompositorNodeSunBeams, node, &nodeptr);
480  WM_gizmo_target_property_def_rna(gz, "offset", &nodeptr, "source", -1);
481 
483  }
484  else {
486  }
487 
488  BKE_image_release_ibuf(ima, ibuf, lock);
489 }
490 
492 {
493  gzgt->name = "Sun Beams Widget";
494  gzgt->idname = "NODE_GGT_sbeam";
495 
497 
503 }
504 
507 /* -------------------------------------------------------------------- */
513 
514  struct {
515  float dims[2];
516  } state;
517 };
518 
520 {
521  SpaceNode *snode = CTX_wm_space_node(C);
522 
523  if ((snode->flag & SNODE_BACKDRAW) == 0) {
524  return false;
525  }
526 
527  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
528  bNode *node = nodeGetActive(snode->edittree);
529 
530  if (node && ELEM(node->type, CMP_NODE_CORNERPIN)) {
531  return true;
532  }
533  }
534 
535  return false;
536 }
537 
539 {
541  sizeof(NodeCornerPinWidgetGroup), __func__);
542  const wmGizmoType *gzt_move_3d = WM_gizmotype_find("GIZMO_GT_move_3d", false);
543 
544  for (int i = 0; i < 4; i++) {
545  cpin_group->gizmos[i] = WM_gizmo_new_ptr(gzt_move_3d, gzgroup, nullptr);
546  wmGizmo *gz = cpin_group->gizmos[i];
547 
548  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_MOVE_STYLE_CROSS_2D);
549 
550  gz->scale_basis = 0.01f / 75.0;
551  }
552 
553  gzgroup->customdata = cpin_group;
554 }
555 
557 {
559  ARegion *region = CTX_wm_region(C);
560 
561  SpaceNode *snode = CTX_wm_space_node(C);
562 
563  float matrix_space[4][4];
565  snode, region, cpin_group->state.dims, matrix_space);
566 
567  for (int i = 0; i < 4; i++) {
568  wmGizmo *gz = cpin_group->gizmos[i];
569  copy_m4_m4(gz->matrix_space, matrix_space);
570  }
571 }
572 
574 {
575  Main *bmain = CTX_data_main(C);
577 
578  void *lock;
579  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
580  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
581 
582  if (ibuf) {
583  cpin_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
584  cpin_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
585 
586  SpaceNode *snode = CTX_wm_space_node(C);
587  bNode *node = nodeGetActive(snode->edittree);
588 
589  /* need to set property here for undo. TODO: would prefer to do this in _init. */
590  int i = 0;
591  for (bNodeSocket *sock = (bNodeSocket *)node->inputs.first; sock && i < 4; sock = sock->next) {
592  if (sock->type == SOCK_VECTOR) {
593  wmGizmo *gz = cpin_group->gizmos[i++];
594 
595  PointerRNA sockptr;
596  RNA_pointer_create((ID *)snode->edittree, &RNA_NodeSocket, sock, &sockptr);
597  WM_gizmo_target_property_def_rna(gz, "offset", &sockptr, "default_value", -1);
598 
600  }
601  }
602  }
603  else {
604  for (int i = 0; i < 4; i++) {
605  wmGizmo *gz = cpin_group->gizmos[i];
607  }
608  }
609 
610  BKE_image_release_ibuf(ima, ibuf, lock);
611 }
612 
614 {
615  gzgt->name = "Corner Pin Widget";
616  gzgt->idname = "NODE_GGT_backdrop_corner_pin";
617 
619 
625 }
626 
629 } // namespace blender::ed::space_node
typedef float(TangentPoint)[2]
struct SpaceNode * CTX_wm_space_node(const bContext *C)
Definition: context.c:878
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
#define CMP_NODE_SPLITVIEWER
Definition: BKE_node.h:1235
#define CMP_NODE_VIEWER
Definition: BKE_node.h:1196
#define CMP_NODE_CORNERPIN
Definition: BKE_node.h:1287
struct bNode * nodeGetActive(struct bNodeTree *ntree)
Definition: node.cc:3601
#define CMP_NODE_CROP
Definition: BKE_node.h:1248
#define CMP_NODE_SUNBEAMS
Definition: BKE_node.h:1275
#define BLI_assert(a)
Definition: BLI_assert.h:46
void unit_m4(float m[4][4])
Definition: rct.c:1090
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
MINLINE void mul_v3_fl(float r[3], float f)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
Definition: BLI_rect.h:181
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
Definition: BLI_rect.h:177
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition: rct.c:580
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition: rct.c:635
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
#define SWAP(type, a, b)
#define UNUSED(x)
#define ELEM(...)
@ IMA_TYPE_COMPOSITE
#define NTREE_COMPOSIT
@ SOCK_VECTOR
@ SNODE_BACKDRAW
@ ED_GIZMO_MOVE_STYLE_CROSS_2D
@ ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble ny
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_DRAW_MODAL
@ WM_GIZMOGROUPTYPE_PERSISTENT
volatile int lock
OperationNode * node
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
static ulong * next
#define fabsf(x)
Definition: metal/compat.h:219
static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.cc:300
static void WIDGETGROUP_node_corner_pin_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:538
static void WIDGETGROUP_node_corner_pin_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:556
static void gizmo_node_crop_update(struct NodeCropWidgetGroup *crop_group)
Definition: node_gizmo.cc:203
static void WIDGETGROUP_node_crop_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:322
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt)
Definition: node_gizmo.cc:613
static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:125
static bool WIDGETGROUP_node_transform_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.cc:93
static void WIDGETGROUP_node_sbeam_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:448
static void WIDGETGROUP_node_transform_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:112
static void WIDGETGROUP_node_corner_pin_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:573
static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:460
static void gizmo_node_crop_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
Definition: node_gizmo.cc:248
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt)
Definition: node_gizmo.cc:386
static void gizmo_node_backdrop_prop_matrix_set(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, const void *value_p)
Definition: node_gizmo.cc:81
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt)
Definition: node_gizmo.cc:170
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt)
Definition: node_gizmo.cc:491
static bool WIDGETGROUP_node_sbeam_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.cc:414
static void node_gizmo_calc_matrix_space(const SpaceNode *snode, const ARegion *region, float matrix_space[4][4])
Definition: node_gizmo.cc:39
static void WIDGETGROUP_node_crop_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:346
static void WIDGETGROUP_node_sbeam_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:433
static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
Definition: node_gizmo.cc:267
static void WIDGETGROUP_node_crop_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.cc:336
static void node_gizmo_calc_matrix_space_with_image_dims(const SpaceNode *snode, const ARegion *region, const float image_dims[2], float matrix_space[4][4])
Definition: node_gizmo.cc:50
static void two_xy_from_rect(NodeTwoXYs *nxy, const rctf *rect, const float dims[2], bool is_relative)
Definition: node_gizmo.cc:228
static void gizmo_node_backdrop_prop_matrix_get(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, void *value_p)
Definition: node_gizmo.cc:68
static bool WIDGETGROUP_node_corner_pin_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.cc:519
static void two_xy_to_rect(const NodeTwoXYs *nxy, rctf *rect, const float dims[2], bool is_relative)
Definition: node_gizmo.cc:209
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2138
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:5015
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:4992
Definition: DNA_ID.h:368
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct bNodeTree * edittree
struct ID * id
struct blender::ed::space_node::NodeCornerPinWidgetGroup::@540 state
struct blender::ed::space_node::NodeCropWidgetGroup::@538 update_data
struct blender::ed::space_node::NodeCropWidgetGroup::@537 state
struct blender::ed::space_node::NodeSunBeamsWidgetGroup::@539 state
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
const char * name
wmGizmoGroupFnDrawPrepare draw_prepare
ListBase gizmos
const struct wmGizmoPropertyType * type
struct wmGizmoProperty::@1185 custom_func
struct wmGizmo * gizmo
struct wmGizmoGroup * parent_gzgroup
struct PointerRNA * ptr
float scale_basis
float matrix_space[4][4]
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:81
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:284
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:304
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:94
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *UNUSED(gzgt), wmKeyConfig *kc)
void WM_gizmo_target_property_def_rna(wmGizmo *gz, const char *idname, PointerRNA *ptr, const char *propname, int index)
void WM_gizmo_target_property_def_func(wmGizmo *gz, const char *idname, const wmGizmoPropertyFnParams *params)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
Definition: wm_gizmo_type.c:45