Blender V4.3
node_gizmo.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cmath>
10
11#include "BLI_math_matrix.h"
12#include "BLI_math_vector.h"
13#include "BLI_rect.h"
14#include "BLI_utildefines.h"
15
16#include "BKE_context.hh"
17#include "BKE_image.hh"
18
19#include "ED_gizmo_library.hh"
20#include "ED_screen.hh"
21
22#include "IMB_imbuf_types.hh"
23
24#include "MEM_guardedalloc.h"
25
26#include "RNA_access.hh"
27#include "RNA_prototypes.hh"
28
29#include "WM_types.hh"
30
31#include "node_intern.hh"
32
34
35/* -------------------------------------------------------------------- */
39static 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 float2 &image_dims,
53 const float2 &image_offset,
54 float matrix_space[4][4])
55{
56 unit_m4(matrix_space);
57 mul_v3_fl(matrix_space[0], snode->zoom * image_dims.x);
58 mul_v3_fl(matrix_space[1], snode->zoom * image_dims.y);
59 matrix_space[3][0] = ((region->winx / 2) + snode->xof) -
60 ((image_dims.x / 2.0f - image_offset.x) * snode->zoom);
61 matrix_space[3][1] = ((region->winy / 2) + snode->yof) -
62 ((image_dims.y / 2.0f - image_offset.y) * snode->zoom);
63}
64
67/* -------------------------------------------------------------------- */
72 wmGizmoProperty *gz_prop,
73 void *value_p)
74{
75 float(*matrix)[4] = (float(*)[4])value_p;
76 BLI_assert(gz_prop->type->array_length == 16);
77 const SpaceNode *snode = (const SpaceNode *)gz_prop->custom_func.user_data;
78 matrix[0][0] = snode->zoom;
79 matrix[1][1] = snode->zoom;
80 matrix[3][0] = snode->xof;
81 matrix[3][1] = snode->yof;
82}
83
85 wmGizmoProperty *gz_prop,
86 const void *value_p)
87{
88 const float(*matrix)[4] = (const float(*)[4])value_p;
89 BLI_assert(gz_prop->type->array_length == 16);
90 SpaceNode *snode = (SpaceNode *)gz_prop->custom_func.user_data;
91 snode->zoom = matrix[0][0];
92 snode->xof = matrix[3][0];
93 snode->yof = matrix[3][1];
94}
95
97{
98 SpaceNode *snode = CTX_wm_space_node(C);
99
100 if ((snode->flag & SNODE_BACKDRAW) == 0) {
101 return false;
102 }
103
104 if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
105 bNode *node = bke::node_get_active(snode->edittree);
106
107 if (node && ELEM(node->type, CMP_NODE_VIEWER)) {
108 return true;
109 }
110 }
111
112 return false;
113}
114
115static void WIDGETGROUP_node_transform_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
116{
117 wmGizmoWrapper *wwrapper = (wmGizmoWrapper *)MEM_mallocN(sizeof(wmGizmoWrapper), __func__);
118
119 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
120
121 RNA_enum_set(wwrapper->gizmo->ptr,
122 "transform",
124
125 gzgroup->customdata = wwrapper;
126}
127
129{
130 Main *bmain = CTX_data_main(C);
131 wmGizmo *cage = ((wmGizmoWrapper *)gzgroup->customdata)->gizmo;
132 const ARegion *region = CTX_wm_region(C);
133 /* center is always at the origin */
134 const float origin[3] = {float(region->winx / 2), float(region->winy / 2), 0.0f};
135
136 void *lock;
137 Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
138 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
139
140 if (ibuf) {
141 const float2 dims = {
142 (ibuf->x > 0) ? ibuf->x : 64.0f,
143 (ibuf->y > 0) ? ibuf->y : 64.0f,
144 };
145
146 RNA_float_set_array(cage->ptr, "dimensions", dims);
147 WM_gizmo_set_matrix_location(cage, origin);
149
150 /* Need to set property here for undo. TODO: would prefer to do this in _init. */
151 SpaceNode *snode = CTX_wm_space_node(C);
152#if 0
153 PointerRNA nodeptr = RNA_pointer_create(snode->id, &RNA_SpaceNodeEditor, snode);
154 WM_gizmo_target_property_def_rna(cage, "offset", &nodeptr, "backdrop_offset", -1);
155 WM_gizmo_target_property_def_rna(cage, "scale", &nodeptr, "backdrop_zoom", -1);
156#endif
157
161 params.range_get_fn = nullptr;
162 params.user_data = snode;
164 }
165 else {
167 }
168
169 BKE_image_release_ibuf(ima, ibuf, lock);
170}
171
173{
174 gzgt->name = "Backdrop Transform Widget";
175 gzgt->idname = "NODE_GGT_backdrop_transform";
176
178
183}
184
187/* -------------------------------------------------------------------- */
205
207{
209 crop_group->update_data.context, &crop_group->update_data.ptr, crop_group->update_data.prop);
210}
211
212static void two_xy_to_rect(
213 const NodeTwoXYs *nxy, const float2 &dims, const float2 offset, bool is_relative, rctf *r_rect)
214{
215 if (is_relative) {
216 r_rect->xmin = nxy->fac_x1 + (offset.x / dims.x);
217 r_rect->xmax = nxy->fac_x2 + (offset.x / dims.x);
218 r_rect->ymin = nxy->fac_y2 + (offset.y / dims.y);
219 r_rect->ymax = nxy->fac_y1 + (offset.y / dims.y);
220 }
221 else {
222 r_rect->xmin = (nxy->x1 + offset.x) / dims.x;
223 r_rect->xmax = (nxy->x2 + offset.x) / dims.x;
224 r_rect->ymin = (nxy->y2 + offset.y) / dims.y;
225 r_rect->ymax = (nxy->y1 + offset.y) / dims.y;
226 }
227}
228
230 NodeTwoXYs *nxy, const rctf *rect, const float2 &dims, const float2 &offset, bool is_relative)
231{
232 if (is_relative) {
233 nxy->fac_x1 = rect->xmin - (offset.x / dims.x);
234 nxy->fac_x2 = rect->xmax - (offset.x / dims.x);
235 nxy->fac_y2 = rect->ymin - (offset.y / dims.y);
236 nxy->fac_y1 = rect->ymax - (offset.y / dims.y);
237 }
238 else {
239 nxy->x1 = rect->xmin * dims.x - offset.x;
240 nxy->x2 = rect->xmax * dims.x - offset.x;
241 nxy->y2 = rect->ymin * dims.y - offset.y;
242 nxy->y1 = rect->ymax * dims.y - offset.y;
243 }
244}
245
246/* scale callbacks */
248 wmGizmoProperty *gz_prop,
249 void *value_p)
250{
251 float(*matrix)[4] = (float(*)[4])value_p;
252 BLI_assert(gz_prop->type->array_length == 16);
254 const float2 dims = crop_group->state.dims;
255 const float2 offset = crop_group->state.offset;
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, dims, offset, is_relative, &rct);
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 float2 dims = crop_group->state.dims;
275 const float2 offset = crop_group->state.offset;
276 bNode *node = (bNode *)gz_prop->custom_func.user_data;
277 NodeTwoXYs *nxy = (NodeTwoXYs *)node->storage;
278 bool is_relative = bool(node->custom2);
279 rctf rct;
280 two_xy_to_rect(nxy, dims, offset, is_relative, &rct);
281 BLI_rctf_resize(&rct, fabsf(matrix[0][0]), fabsf(matrix[1][1]));
282 BLI_rctf_recenter(&rct, ((matrix[3][0]) / dims[0]) + 0.5f, ((matrix[3][1]) / dims[1]) + 0.5f);
283 rctf rct_isect{};
284 rct_isect.xmin = offset.x / dims.x;
285 rct_isect.xmax = offset.x / dims.x + 1;
286 rct_isect.ymin = offset.y;
287 rct_isect.ymax = offset.y / dims.y + 1;
288 BLI_rctf_isect(&rct_isect, &rct, &rct);
289 two_xy_from_rect(nxy, &rct, dims, offset, is_relative);
290 gizmo_node_crop_update(crop_group);
291}
292
293static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType * /*gzgt*/)
294{
295 SpaceNode *snode = CTX_wm_space_node(C);
296
297 if ((snode->flag & SNODE_BACKDRAW) == 0) {
298 return false;
299 }
300
301 if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
302 bNode *node = bke::node_get_active(snode->edittree);
303
304 if (node && ELEM(node->type, CMP_NODE_CROP)) {
305 /* ignore 'use_crop_size', we can't usefully edit the crop in this case. */
306 if ((node->custom1 & (1 << 0)) == 0) {
307 return true;
308 }
309 }
310 }
311
312 return false;
313}
314
315static void WIDGETGROUP_node_crop_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
316{
317 NodeCropWidgetGroup *crop_group = MEM_new<NodeCropWidgetGroup>(__func__);
318 crop_group->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
319
320 RNA_enum_set(crop_group->border->ptr,
321 "transform",
323
324 gzgroup->customdata = crop_group;
325 gzgroup->customdata_free = [](void *customdata) {
326 MEM_delete(static_cast<NodeCropWidgetGroup *>(customdata));
327 };
328}
329
331{
332 ARegion *region = CTX_wm_region(C);
333 wmGizmo *gz = (wmGizmo *)gzgroup->gizmos.first;
334
335 SpaceNode *snode = CTX_wm_space_node(C);
336
337 node_gizmo_calc_matrix_space(snode, region, gz->matrix_space);
338}
339
341{
342 Main *bmain = CTX_data_main(C);
343 NodeCropWidgetGroup *crop_group = (NodeCropWidgetGroup *)gzgroup->customdata;
344 wmGizmo *gz = crop_group->border;
345
346 void *lock;
347 Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
348 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
349
350 if (ibuf) {
351 crop_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
352 crop_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
353 copy_v2_v2(crop_group->state.offset, ima->runtime.backdrop_offset);
354
355 RNA_float_set_array(gz->ptr, "dimensions", crop_group->state.dims);
357
358 SpaceNode *snode = CTX_wm_space_node(C);
359 bNode *node = bke::node_get_active(snode->edittree);
360
361 crop_group->update_data.context = (bContext *)C;
362 crop_group->update_data.ptr = RNA_pointer_create(
363 (ID *)snode->edittree, &RNA_CompositorNodeCrop, node);
364 crop_group->update_data.prop = RNA_struct_find_property(&crop_group->update_data.ptr,
365 "relative");
366
370 params.range_get_fn = nullptr;
371 params.user_data = node;
373 }
374 else {
376 }
377
378 BKE_image_release_ibuf(ima, ibuf, lock);
379}
380
382{
383 gzgt->name = "Backdrop Crop Widget";
384 gzgt->idname = "NODE_GGT_backdrop_crop";
385
387
393}
394
397/* -------------------------------------------------------------------- */
409
411{
412 SpaceNode *snode = CTX_wm_space_node(C);
413
414 if ((snode->flag & SNODE_BACKDRAW) == 0) {
415 return false;
416 }
417
418 if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
419 bNode *node = bke::node_get_active(snode->edittree);
420
421 if (node && ELEM(node->type, CMP_NODE_SUNBEAMS)) {
422 return true;
423 }
424 }
425
426 return false;
427}
428
429static void WIDGETGROUP_node_sbeam_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
430{
432 sizeof(NodeSunBeamsWidgetGroup), __func__);
433
434 sbeam_group->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, nullptr);
435 wmGizmo *gz = sbeam_group->gizmo;
436
438
439 gz->scale_basis = 0.05f / 75.0f;
440
441 gzgroup->customdata = sbeam_group;
442}
443
445{
447 ARegion *region = CTX_wm_region(C);
448 wmGizmo *gz = (wmGizmo *)gzgroup->gizmos.first;
449
450 SpaceNode *snode = CTX_wm_space_node(C);
451
453 snode, region, sbeam_group->state.dims, sbeam_group->state.offset, gz->matrix_space);
454}
455
457{
458 Main *bmain = CTX_data_main(C);
460 wmGizmo *gz = sbeam_group->gizmo;
461
462 void *lock;
463 Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
464 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
465
466 if (ibuf) {
467 sbeam_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
468 sbeam_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
469 copy_v2_v2(sbeam_group->state.offset, ima->runtime.backdrop_offset);
470
471 SpaceNode *snode = CTX_wm_space_node(C);
472 bNode *node = bke::node_get_active(snode->edittree);
473
474 /* Need to set property here for undo. TODO: would prefer to do this in _init. */
476 (ID *)snode->edittree, &RNA_CompositorNodeSunBeams, node);
477 WM_gizmo_target_property_def_rna(gz, "offset", &nodeptr, "source", -1);
478
480 }
481 else {
483 }
484
485 BKE_image_release_ibuf(ima, ibuf, lock);
486}
487
501
504/* -------------------------------------------------------------------- */
516
518{
519 SpaceNode *snode = CTX_wm_space_node(C);
520
521 if ((snode->flag & SNODE_BACKDRAW) == 0) {
522 return false;
523 }
524
525 if (snode && snode->edittree && snode->edittree->type == NTREE_COMPOSIT) {
526 bNode *node = bke::node_get_active(snode->edittree);
527
528 if (node && ELEM(node->type, CMP_NODE_CORNERPIN)) {
529 return true;
530 }
531 }
532
533 return false;
534}
535
536static void WIDGETGROUP_node_corner_pin_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
537{
539 sizeof(NodeCornerPinWidgetGroup), __func__);
540 const wmGizmoType *gzt_move_3d = WM_gizmotype_find("GIZMO_GT_move_3d", false);
541
542 for (int i = 0; i < 4; i++) {
543 cpin_group->gizmos[i] = WM_gizmo_new_ptr(gzt_move_3d, gzgroup, nullptr);
544 wmGizmo *gz = cpin_group->gizmos[i];
545
547
548 gz->scale_basis = 0.05f / 75.0;
549 }
550
551 gzgroup->customdata = cpin_group;
552}
553
555{
557 ARegion *region = CTX_wm_region(C);
558
559 SpaceNode *snode = CTX_wm_space_node(C);
560
561 float matrix_space[4][4];
563 snode, region, cpin_group->state.dims, cpin_group->state.offset, matrix_space);
564
565 for (int i = 0; i < 4; i++) {
566 wmGizmo *gz = cpin_group->gizmos[i];
567 copy_m4_m4(gz->matrix_space, matrix_space);
568 }
569}
570
572{
573 Main *bmain = CTX_data_main(C);
575
576 void *lock;
577 Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
578 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
579
580 if (ibuf) {
581 cpin_group->state.dims[0] = (ibuf->x > 0) ? ibuf->x : 64.0f;
582 cpin_group->state.dims[1] = (ibuf->y > 0) ? ibuf->y : 64.0f;
583 copy_v2_v2(cpin_group->state.offset, ima->runtime.backdrop_offset);
584
585 SpaceNode *snode = CTX_wm_space_node(C);
586 bNode *node = bke::node_get_active(snode->edittree);
587
588 /* need to set property here for undo. TODO: would prefer to do this in _init. */
589 int i = 0;
590 for (bNodeSocket *sock = (bNodeSocket *)node->inputs.first; sock && i < 4; sock = sock->next) {
591 if (sock->type == SOCK_VECTOR) {
592 wmGizmo *gz = cpin_group->gizmos[i++];
593
594 PointerRNA sockptr = RNA_pointer_create((ID *)snode->edittree, &RNA_NodeSocket, sock);
595 WM_gizmo_target_property_def_rna(gz, "offset", &sockptr, "default_value", -1);
596
598 }
599 }
600 }
601 else {
602 for (int i = 0; i < 4; i++) {
603 wmGizmo *gz = cpin_group->gizmos[i];
605 }
606 }
607
608 BKE_image_release_ibuf(ima, ibuf, lock);
609}
610
624
627} // namespace blender::ed::space_node
SpaceNode * CTX_wm_space_node(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
Image * BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
#define BLI_assert(a)
Definition BLI_assert.h:50
void unit_m4(float m[4][4])
Definition rct.c:1127
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
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:184
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:180
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition rct.c:596
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:197
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.c:651
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:201
#define ELEM(...)
@ IMA_TYPE_COMPOSITE
@ NTREE_COMPOSIT
@ SOCK_VECTOR
@ SNODE_BACKDRAW
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE_UNIFORM
@ ED_GIZMO_MOVE_STYLE_CROSS_2D
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_DRAW_MODAL
@ WM_GIZMOGROUPTYPE_PERSISTENT
volatile int lock
OperationNode * node
#define fabsf(x)
draw_view in_light_buf[] float
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
bNode * node_get_active(bNodeTree *ntree)
Definition node.cc:3849
static void two_xy_from_rect(NodeTwoXYs *nxy, const rctf *rect, const float2 &dims, const float2 &offset, bool is_relative)
static bool WIDGETGROUP_node_transform_poll(const bContext *C, wmGizmoGroupType *)
Definition node_gizmo.cc:96
static void WIDGETGROUP_node_sbeam_setup(const bContext *, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_corner_pin_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_corner_pin_setup(const bContext *, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_node_sbeam_poll(const bContext *C, wmGizmoGroupType *)
static void WIDGETGROUP_node_crop_setup(const bContext *, wmGizmoGroup *gzgroup)
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_node_crop_update(NodeCropWidgetGroup *crop_group)
static void WIDGETGROUP_node_sbeam_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_corner_pin_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void two_xy_to_rect(const NodeTwoXYs *nxy, const float2 &dims, const float2 offset, bool is_relative, rctf *r_rect)
static void gizmo_node_crop_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_node_transform_setup(const bContext *, wmGizmoGroup *gzgroup)
static void gizmo_node_backdrop_prop_matrix_get(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
Definition node_gizmo.cc:71
static void gizmo_node_backdrop_prop_matrix_set(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
Definition node_gizmo.cc:84
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt)
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt)
static void node_gizmo_calc_matrix_space(const SpaceNode *snode, const ARegion *region, float matrix_space[4][4])
Definition node_gizmo.cc:39
static bool WIDGETGROUP_node_corner_pin_poll(const bContext *C, wmGizmoGroupType *)
static void WIDGETGROUP_node_crop_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void node_gizmo_calc_matrix_space_with_image_dims(const SpaceNode *snode, const ARegion *region, const float2 &image_dims, const float2 &image_offset, float matrix_space[4][4])
Definition node_gizmo.cc:50
static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
static void WIDGETGROUP_node_crop_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType *)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
Definition DNA_ID.h:413
float backdrop_offset[2]
Image_Runtime runtime
void * first
struct bNodeTree * edittree
struct ID * id
struct blender::ed::space_node::NodeCornerPinWidgetGroup::@507 state
struct blender::ed::space_node::NodeCropWidgetGroup::@505 update_data
struct blender::ed::space_node::NodeCropWidgetGroup::@504 state
struct blender::ed::space_node::NodeSunBeamsWidgetGroup::@506 state
float xmax
float xmin
float ymax
float ymin
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
wmGizmoGroupFnDrawPrepare draw_prepare
void(* customdata_free)(void *)
const wmGizmoPropertyType * type
struct wmGizmoProperty::@1373 custom_func
wmGizmoGroup * parent_gzgroup
PointerRNA * ptr
float scale_basis
float matrix_space[4][4]
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:94
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:81
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition wm_gizmo.cc:283
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition wm_gizmo.cc:303
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *, 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)