Blender  V2.93
node_gizmo.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 <math.h>
22 
23 #include "BLI_math_matrix.h"
24 #include "BLI_math_vector.h"
25 #include "BLI_rect.h"
26 #include "BLI_utildefines.h"
27 
28 #include "BKE_context.h"
29 #include "BKE_image.h"
30 #include "BKE_main.h"
31 
32 #include "ED_gizmo_library.h"
33 #include "ED_screen.h"
34 
35 #include "IMB_imbuf_types.h"
36 
37 #include "MEM_guardedalloc.h"
38 
39 #include "RNA_access.h"
40 
41 #include "WM_api.h"
42 #include "WM_types.h"
43 
44 #include "node_intern.h"
45 
46 /* -------------------------------------------------------------------- */
50 static void node_gizmo_calc_matrix_space(const SpaceNode *snode,
51  const ARegion *region,
52  float matrix_space[4][4])
53 {
54  unit_m4(matrix_space);
55  mul_v3_fl(matrix_space[0], snode->zoom);
56  mul_v3_fl(matrix_space[1], snode->zoom);
57  matrix_space[3][0] = (region->winx / 2) + snode->xof;
58  matrix_space[3][1] = (region->winy / 2) + snode->yof;
59 }
60 
62  const ARegion *region,
63  const float image_dims[2],
64  float matrix_space[4][4])
65 {
66  unit_m4(matrix_space);
67  mul_v3_fl(matrix_space[0], snode->zoom * image_dims[0]);
68  mul_v3_fl(matrix_space[1], snode->zoom * image_dims[1]);
69  matrix_space[3][0] = ((region->winx / 2) + snode->xof) - ((image_dims[0] / 2.0f) * snode->zoom);
70  matrix_space[3][1] = ((region->winy / 2) + snode->yof) - ((image_dims[1] / 2.0f) * snode->zoom);
71 }
72 
75 /* -------------------------------------------------------------------- */
80  wmGizmoProperty *gz_prop,
81  void *value_p)
82 {
83  float(*matrix)[4] = value_p;
84  BLI_assert(gz_prop->type->array_length == 16);
85  const SpaceNode *snode = gz_prop->custom_func.user_data;
86  matrix[0][0] = snode->zoom;
87  matrix[1][1] = snode->zoom;
88  matrix[3][0] = snode->xof;
89  matrix[3][1] = snode->yof;
90 }
91 
93  wmGizmoProperty *gz_prop,
94  const void *value_p)
95 {
96  const float(*matrix)[4] = value_p;
97  BLI_assert(gz_prop->type->array_length == 16);
98  SpaceNode *snode = gz_prop->custom_func.user_data;
99  snode->zoom = matrix[0][0];
100  snode->zoom = matrix[1][1];
101  snode->xof = matrix[3][0];
102  snode->yof = matrix[3][1];
103 }
104 
106 {
107  SpaceNode *snode = CTX_wm_space_node(C);
108 
109  if ((snode->flag & SNODE_BACKDRAW) == 0) {
110  return false;
111  }
112 
113  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
114  bNode *node = nodeGetActive(snode->edittree);
115 
117  return true;
118  }
119  }
120 
121  return false;
122 }
123 
125 {
126  wmGizmoWrapper *wwrapper = MEM_mallocN(sizeof(wmGizmoWrapper), __func__);
127 
128  wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, NULL);
129 
130  RNA_enum_set(wwrapper->gizmo->ptr,
131  "transform",
133 
134  gzgroup->customdata = wwrapper;
135 }
136 
138 {
139  Main *bmain = CTX_data_main(C);
140  wmGizmo *cage = ((wmGizmoWrapper *)gzgroup->customdata)->gizmo;
141  const ARegion *region = CTX_wm_region(C);
142  /* center is always at the origin */
143  const float origin[3] = {region->winx / 2, region->winy / 2};
144 
145  void *lock;
146  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
147  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
148 
149  if (ibuf) {
150  const float dims[2] = {
151  (ibuf->x > 0) ? ibuf->x : 64.0f,
152  (ibuf->y > 0) ? ibuf->y : 64.0f,
153  };
154 
155  RNA_float_set_array(cage->ptr, "dimensions", dims);
156  WM_gizmo_set_matrix_location(cage, origin);
157  WM_gizmo_set_flag(cage, WM_GIZMO_HIDDEN, false);
158 
159  /* need to set property here for undo. TODO would prefer to do this in _init */
160  SpaceNode *snode = CTX_wm_space_node(C);
161 #if 0
162  PointerRNA nodeptr;
163  RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode, &nodeptr);
164  WM_gizmo_target_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1);
165  WM_gizmo_target_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1);
166 #endif
167 
169  "matrix",
170  &(const struct wmGizmoPropertyFnParams){
171  .value_get_fn = gizmo_node_backdrop_prop_matrix_get,
172  .value_set_fn = gizmo_node_backdrop_prop_matrix_set,
173  .range_get_fn = NULL,
174  .user_data = snode,
175  });
176  }
177  else {
178  WM_gizmo_set_flag(cage, WM_GIZMO_HIDDEN, true);
179  }
180 
181  BKE_image_release_ibuf(ima, ibuf, lock);
182 }
183 
185 {
186  gzgt->name = "Backdrop Transform Widget";
187  gzgt->idname = "NODE_GGT_backdrop_transform";
188 
190 
195 }
196 
199 /* -------------------------------------------------------------------- */
205 
206  struct {
207  float dims[2];
208  } state;
209 
210  struct {
215 };
216 
217 static void gizmo_node_crop_update(struct NodeCropWidgetGroup *crop_group)
218 {
220  crop_group->update_data.context, &crop_group->update_data.ptr, crop_group->update_data.prop);
221 }
222 
223 static void two_xy_to_rect(const NodeTwoXYs *nxy,
224  rctf *rect,
225  const float dims[2],
226  bool is_relative)
227 {
228  if (is_relative) {
229  rect->xmin = nxy->fac_x1;
230  rect->xmax = nxy->fac_x2;
231  rect->ymin = nxy->fac_y1;
232  rect->ymax = nxy->fac_y2;
233  }
234  else {
235  rect->xmin = nxy->x1 / dims[0];
236  rect->xmax = nxy->x2 / dims[0];
237  rect->ymin = nxy->y1 / dims[1];
238  rect->ymax = nxy->y2 / dims[1];
239  }
240 }
241 
242 static void two_xy_from_rect(NodeTwoXYs *nxy,
243  const rctf *rect,
244  const float dims[2],
245  bool is_relative)
246 {
247  if (is_relative) {
248  nxy->fac_x1 = rect->xmin;
249  nxy->fac_x2 = rect->xmax;
250  nxy->fac_y1 = rect->ymin;
251  nxy->fac_y2 = rect->ymax;
252  }
253  else {
254  nxy->x1 = rect->xmin * dims[0];
255  nxy->x2 = rect->xmax * dims[0];
256  nxy->y1 = rect->ymin * dims[1];
257  nxy->y2 = rect->ymax * dims[1];
258  }
259 }
260 
261 /* scale callbacks */
263  wmGizmoProperty *gz_prop,
264  void *value_p)
265 {
266  float(*matrix)[4] = value_p;
267  BLI_assert(gz_prop->type->array_length == 16);
268  struct NodeCropWidgetGroup *crop_group = gz->parent_gzgroup->customdata;
269  const float *dims = crop_group->state.dims;
270  const bNode *node = gz_prop->custom_func.user_data;
271  const NodeTwoXYs *nxy = node->storage;
272  bool is_relative = (bool)node->custom2;
273  rctf rct;
274  two_xy_to_rect(nxy, &rct, dims, is_relative);
275  matrix[0][0] = fabsf(BLI_rctf_size_x(&rct));
276  matrix[1][1] = fabsf(BLI_rctf_size_y(&rct));
277  matrix[3][0] = (BLI_rctf_cent_x(&rct) - 0.5f) * dims[0];
278  matrix[3][1] = (BLI_rctf_cent_y(&rct) - 0.5f) * dims[1];
279 }
280 
282  wmGizmoProperty *gz_prop,
283  const void *value_p)
284 {
285  const float(*matrix)[4] = value_p;
286  BLI_assert(gz_prop->type->array_length == 16);
287  struct NodeCropWidgetGroup *crop_group = gz->parent_gzgroup->customdata;
288  const float *dims = crop_group->state.dims;
289  bNode *node = gz_prop->custom_func.user_data;
290  NodeTwoXYs *nxy = node->storage;
291  bool is_relative = (bool)node->custom2;
292  rctf rct;
293  two_xy_to_rect(nxy, &rct, dims, is_relative);
294  const bool nx = rct.xmin > rct.xmax;
295  const bool ny = rct.ymin > rct.ymax;
296  BLI_rctf_resize(&rct, fabsf(matrix[0][0]), fabsf(matrix[1][1]));
297  BLI_rctf_recenter(&rct, (matrix[3][0] / dims[0]) + 0.5f, (matrix[3][1] / dims[1]) + 0.5f);
299  &(rctf){
300  .xmin = 0,
301  .ymin = 0,
302  .xmax = 1,
303  .ymax = 1,
304  },
305  &rct,
306  &rct);
307  if (nx) {
308  SWAP(float, rct.xmin, rct.xmax);
309  }
310  if (ny) {
311  SWAP(float, rct.ymin, rct.ymax);
312  }
313  two_xy_from_rect(nxy, &rct, dims, is_relative);
314  gizmo_node_crop_update(crop_group);
315 }
316 
318 {
319  SpaceNode *snode = CTX_wm_space_node(C);
320 
321  if ((snode->flag & SNODE_BACKDRAW) == 0) {
322  return false;
323  }
324 
325  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
326  bNode *node = nodeGetActive(snode->edittree);
327 
328  if (node && ELEM(node->type, CMP_NODE_CROP)) {
329  /* ignore 'use_crop_size', we can't usefully edit the crop in this case. */
330  if ((node->custom1 & (1 << 0)) == 0) {
331  return true;
332  }
333  }
334  }
335 
336  return false;
337 }
338 
340 {
341  struct NodeCropWidgetGroup *crop_group = MEM_mallocN(sizeof(struct NodeCropWidgetGroup),
342  __func__);
343 
344  crop_group->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, NULL);
345 
346  RNA_enum_set(crop_group->border->ptr,
347  "transform",
349 
350  gzgroup->customdata = crop_group;
351 }
352 
354 {
355  ARegion *region = CTX_wm_region(C);
356  wmGizmo *gz = gzgroup->gizmos.first;
357 
358  SpaceNode *snode = CTX_wm_space_node(C);
359 
360  node_gizmo_calc_matrix_space(snode, region, gz->matrix_space);
361 }
362 
364 {
365  Main *bmain = CTX_data_main(C);
366  struct NodeCropWidgetGroup *crop_group = gzgroup->customdata;
367  wmGizmo *gz = crop_group->border;
368 
369  void *lock;
370  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
371  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
372 
373  if (ibuf) {
374  crop_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
375  crop_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
376 
377  RNA_float_set_array(gz->ptr, "dimensions", crop_group->state.dims);
379 
380  SpaceNode *snode = CTX_wm_space_node(C);
381  bNode *node = nodeGetActive(snode->edittree);
382 
383  crop_group->update_data.context = (bContext *)C;
385  (ID *)snode->edittree, &RNA_CompositorNodeCrop, node, &crop_group->update_data.ptr);
386  crop_group->update_data.prop = RNA_struct_find_property(&crop_group->update_data.ptr,
387  "relative");
388 
390  "matrix",
391  &(const struct wmGizmoPropertyFnParams){
392  .value_get_fn = gizmo_node_crop_prop_matrix_get,
393  .value_set_fn = gizmo_node_crop_prop_matrix_set,
394  .range_get_fn = NULL,
395  .user_data = node,
396  });
397  }
398  else {
400  }
401 
402  BKE_image_release_ibuf(ima, ibuf, lock);
403 }
404 
406 {
407  gzgt->name = "Backdrop Crop Widget";
408  gzgt->idname = "NODE_GGT_backdrop_crop";
409 
411 
417 }
418 
421 /* -------------------------------------------------------------------- */
427 
428  struct {
429  float dims[2];
430  } state;
431 };
432 
434 {
435  SpaceNode *snode = CTX_wm_space_node(C);
436 
437  if ((snode->flag & SNODE_BACKDRAW) == 0) {
438  return false;
439  }
440 
441  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
442  bNode *node = nodeGetActive(snode->edittree);
443 
444  if (node && ELEM(node->type, CMP_NODE_SUNBEAMS)) {
445  return true;
446  }
447  }
448 
449  return false;
450 }
451 
453 {
454  struct NodeSunBeamsWidgetGroup *sbeam_group = MEM_mallocN(sizeof(struct NodeSunBeamsWidgetGroup),
455  __func__);
456 
457  sbeam_group->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, NULL);
458  wmGizmo *gz = sbeam_group->gizmo;
459 
460  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_MOVE_STYLE_CROSS_2D);
461 
462  gz->scale_basis = 0.05f / 75.0f;
463 
464  gzgroup->customdata = sbeam_group;
465 }
466 
468 {
469  struct NodeSunBeamsWidgetGroup *sbeam_group = gzgroup->customdata;
470  ARegion *region = CTX_wm_region(C);
471  wmGizmo *gz = gzgroup->gizmos.first;
472 
473  SpaceNode *snode = CTX_wm_space_node(C);
474 
476  snode, region, sbeam_group->state.dims, gz->matrix_space);
477 }
478 
480 {
481  Main *bmain = CTX_data_main(C);
482  struct NodeSunBeamsWidgetGroup *sbeam_group = gzgroup->customdata;
483  wmGizmo *gz = sbeam_group->gizmo;
484 
485  void *lock;
486  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
487  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
488 
489  if (ibuf) {
490  sbeam_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
491  sbeam_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
492 
493  SpaceNode *snode = CTX_wm_space_node(C);
494  bNode *node = nodeGetActive(snode->edittree);
495 
496  /* need to set property here for undo. TODO would prefer to do this in _init */
497  PointerRNA nodeptr;
499  WM_gizmo_target_property_def_rna(gz, "offset", &nodeptr, "source", -1);
500 
502  }
503  else {
505  }
506 
507  BKE_image_release_ibuf(ima, ibuf, lock);
508 }
509 
511 {
512  gzgt->name = "Sun Beams Widget";
513  gzgt->idname = "NODE_GGT_sbeam";
514 
516 
522 }
523 
526 /* -------------------------------------------------------------------- */
532 
533  struct {
534  float dims[2];
535  } state;
536 };
537 
539 {
540  SpaceNode *snode = CTX_wm_space_node(C);
541 
542  if ((snode->flag & SNODE_BACKDRAW) == 0) {
543  return false;
544  }
545 
546  if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
547  bNode *node = nodeGetActive(snode->edittree);
548 
549  if (node && ELEM(node->type, CMP_NODE_CORNERPIN)) {
550  return true;
551  }
552  }
553 
554  return false;
555 }
556 
558 {
559  struct NodeCornerPinWidgetGroup *cpin_group = MEM_mallocN(
560  sizeof(struct NodeCornerPinWidgetGroup), __func__);
561  const wmGizmoType *gzt_move_3d = WM_gizmotype_find("GIZMO_GT_move_3d", false);
562 
563  for (int i = 0; i < 4; i++) {
564  cpin_group->gizmos[i] = WM_gizmo_new_ptr(gzt_move_3d, gzgroup, NULL);
565  wmGizmo *gz = cpin_group->gizmos[i];
566 
567  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_MOVE_STYLE_CROSS_2D);
568 
569  gz->scale_basis = 0.01f / 75.0;
570  }
571 
572  gzgroup->customdata = cpin_group;
573 }
574 
576 {
577  struct NodeCornerPinWidgetGroup *cpin_group = gzgroup->customdata;
578  ARegion *region = CTX_wm_region(C);
579 
580  SpaceNode *snode = CTX_wm_space_node(C);
581 
582  float matrix_space[4][4];
584  snode, region, cpin_group->state.dims, matrix_space);
585 
586  for (int i = 0; i < 4; i++) {
587  wmGizmo *gz = cpin_group->gizmos[i];
588  copy_m4_m4(gz->matrix_space, matrix_space);
589  }
590 }
591 
593 {
594  Main *bmain = CTX_data_main(C);
595  struct NodeCornerPinWidgetGroup *cpin_group = gzgroup->customdata;
596 
597  void *lock;
598  Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
599  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
600 
601  if (ibuf) {
602  cpin_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
603  cpin_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
604 
605  SpaceNode *snode = CTX_wm_space_node(C);
606  bNode *node = nodeGetActive(snode->edittree);
607 
608  /* need to set property here for undo. TODO would prefer to do this in _init */
609  int i = 0;
610  for (bNodeSocket *sock = node->inputs.first; sock && i < 4; sock = sock->next) {
611  if (sock->type == SOCK_VECTOR) {
612  wmGizmo *gz = cpin_group->gizmos[i++];
613 
614  PointerRNA sockptr;
615  RNA_pointer_create((ID *)snode->edittree, &RNA_NodeSocket, sock, &sockptr);
616  WM_gizmo_target_property_def_rna(gz, "offset", &sockptr, "default_value", -1);
617 
619  }
620  }
621  }
622  else {
623  for (int i = 0; i < 4; i++) {
624  wmGizmo *gz = cpin_group->gizmos[i];
626  }
627  }
628 
629  BKE_image_release_ibuf(ima, ibuf, lock);
630 }
631 
633 {
634  gzgt->name = "Corner Pin Widget";
635  gzgt->idname = "NODE_GGT_backdrop_corner_pin";
636 
638 
644 }
645 
typedef float(TangentPoint)[2]
struct SpaceNode * CTX_wm_space_node(const bContext *C)
Definition: context.c:854
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
Definition: image.c:5113
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
Definition: image.c:5100
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
Definition: image.c:3162
struct bNode * nodeGetActive(struct bNodeTree *ntree)
Definition: node.cc:3561
#define CMP_NODE_CROP
Definition: BKE_node.h:1184
#define CMP_NODE_SUNBEAMS
Definition: BKE_node.h:1211
#define BLI_assert(a)
Definition: BLI_assert.h:58
void unit_m4(float m[4][4])
Definition: rct.c:1140
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
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:148
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:144
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition: rct.c:618
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:161
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition: rct.c:674
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:165
#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.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel CMP_NODE_SPLITVIEWER
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White CMP_NODE_VIEWER
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View CMP_NODE_CORNERPIN
StructRNA RNA_CompositorNodeSunBeams
StructRNA RNA_SpaceNodeEditor
StructRNA RNA_CompositorNodeCrop
StructRNA RNA_NodeSocket
#define C
Definition: RandGen.cpp:39
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_DRAW_MODAL
@ WM_GIZMOGROUPTYPE_PERSISTENT
OperationNode * node
#define fabsf(x)
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static ulong * next
static void WIDGETGROUP_node_corner_pin_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:557
static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:137
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt)
Definition: node_gizmo.c:632
static void WIDGETGROUP_node_crop_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:363
static void WIDGETGROUP_node_transform_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:124
static void WIDGETGROUP_node_sbeam_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:452
static void WIDGETGROUP_node_crop_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:353
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.c:61
static bool WIDGETGROUP_node_sbeam_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.c:433
static void WIDGETGROUP_node_corner_pin_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:592
static void two_xy_from_rect(NodeTwoXYs *nxy, const rctf *rect, const float dims[2], bool is_relative)
Definition: node_gizmo.c:242
static void gizmo_node_backdrop_prop_matrix_set(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, const void *value_p)
Definition: node_gizmo.c:92
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt)
Definition: node_gizmo.c:510
static void gizmo_node_crop_update(struct NodeCropWidgetGroup *crop_group)
Definition: node_gizmo.c:217
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt)
Definition: node_gizmo.c:184
static void WIDGETGROUP_node_sbeam_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:467
static void node_gizmo_calc_matrix_space(const SpaceNode *snode, const ARegion *region, float matrix_space[4][4])
Definition: node_gizmo.c:50
static void WIDGETGROUP_node_crop_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:339
static void gizmo_node_backdrop_prop_matrix_get(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, void *value_p)
Definition: node_gizmo.c:79
static void WIDGETGROUP_node_corner_pin_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:575
static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.c:317
static void gizmo_node_crop_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
Definition: node_gizmo.c:262
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt)
Definition: node_gizmo.c:405
static void two_xy_to_rect(const NodeTwoXYs *nxy, rctf *rect, const float dims[2], bool is_relative)
Definition: node_gizmo.c:223
static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgroup)
Definition: node_gizmo.c:479
static bool WIDGETGROUP_node_corner_pin_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.c:538
static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
Definition: node_gizmo.c:281
static bool WIDGETGROUP_node_transform_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
Definition: node_gizmo.c:105
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2317
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
Definition: DNA_ID.h:273
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
struct NodeCornerPinWidgetGroup::@516 state
bContext * context
Definition: node_gizmo.c:213
struct NodeCropWidgetGroup::@514 update_data
PropertyRNA * prop
Definition: node_gizmo.c:212
struct NodeCropWidgetGroup::@513 state
struct NodeSunBeamsWidgetGroup::@515 state
struct bNodeTree * edittree
struct ID * id
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymax
Definition: DNA_vec_types.h:86
float ymin
Definition: DNA_vec_types.h:86
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
const char * name
wmGizmoGroupFnDrawPrepare draw_prepare
ListBase gizmos
struct wmGizmoProperty::@1149 custom_func
const struct wmGizmoPropertyType * type
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:96
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:316
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:339
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:114
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:58