Blender V5.0
node_view.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "DNA_node_types.h"
10
11#include "BLI_rect.h"
12#include "BLI_utildefines.h"
13
14#include "BKE_context.hh"
15#include "BKE_image.hh"
16#include "BKE_node_runtime.hh"
17#include "BKE_screen.hh"
18
19#include "ED_image.hh"
20#include "ED_node.hh" /* own include */
21#include "ED_screen.hh"
22#include "ED_space_api.hh"
23
24#include "RNA_access.hh"
25#include "RNA_define.hh"
26
27#include "WM_api.hh"
28#include "WM_types.hh"
29
30#include "UI_view2d.hh"
31
32#include "MEM_guardedalloc.h"
33
35#include "IMB_imbuf.hh"
36#include "IMB_imbuf_types.hh"
37
38#include "node_intern.hh" /* own include */
39
41
42/* -------------------------------------------------------------------- */
45
47{
49 return false;
50 }
51 const ARegion *region = CTX_wm_region(C);
52 if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
53 return false;
54 }
55 return true;
56}
57
59{
61 return false;
62 }
63 const ARegion *region = CTX_wm_region(C);
64 if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
65 return false;
66 }
67 return true;
68}
69
71
72/* -------------------------------------------------------------------- */
75
77 bContext &C, SpaceNode &snode, ARegion &region, const int node_flag, const int smooth_viewtx)
78{
79 const float oldwidth = BLI_rctf_size_x(&region.v2d.cur);
80 const float oldheight = BLI_rctf_size_y(&region.v2d.cur);
81
82 const float old_aspect = oldwidth / oldheight;
83
84 rctf cur_new;
85 BLI_rctf_init_minmax(&cur_new);
86
87 int tot = 0;
88 bool has_frame = false;
89 if (snode.edittree) {
90 for (const bNode *node : snode.edittree->all_nodes()) {
91 if ((node->flag & node_flag) == node_flag) {
92 BLI_rctf_union(&cur_new, &node->runtime->draw_bounds);
93 tot++;
94
95 if (node->is_frame()) {
96 has_frame = true;
97 }
98 }
99 }
100 }
101
102 if (tot == 0) {
103 return false;
104 }
105
106 const float width = BLI_rctf_size_x(&cur_new);
107 const float height = BLI_rctf_size_y(&cur_new);
108 const float new_aspect = width / height;
109
110 /* for single non-frame nodes, don't zoom in, just pan view,
111 * but do allow zooming out, this allows for big nodes to be zoomed out */
112 if ((tot == 1) && (has_frame == false) && ((oldwidth * oldheight) > (width * height))) {
113 /* center, don't zoom */
114 BLI_rctf_resize(&cur_new, oldwidth, oldheight);
115 }
116 else {
117 if (old_aspect < new_aspect) {
118 const float height_new = width / old_aspect;
119 cur_new.ymin = cur_new.ymin - height_new / 2.0f;
120 cur_new.ymax = cur_new.ymax + height_new / 2.0f;
121 }
122 else {
123 const float width_new = height * old_aspect;
124 cur_new.xmin = cur_new.xmin - width_new / 2.0f;
125 cur_new.xmax = cur_new.xmax + width_new / 2.0f;
126 }
127
128 /* add some padding */
129 BLI_rctf_scale(&cur_new, 1.1f);
130 }
131
132 UI_view2d_smooth_view(&C, &region, &cur_new, smooth_viewtx);
133
134 return true;
135}
136
138{
139 ARegion *region = CTX_wm_region(C);
140 SpaceNode *snode = CTX_wm_space_node(C);
141 const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
142
143 /* is this really needed? */
144 snode->xof = 0;
145 snode->yof = 0;
146
147 if (space_node_view_flag(*C, *snode, *region, 0, smooth_viewtx)) {
148 return OPERATOR_FINISHED;
149 }
150 return OPERATOR_CANCELLED;
151}
152
154{
155 /* identifiers */
156 ot->name = "Frame All";
157 ot->idname = "NODE_OT_view_all";
158 ot->description = "Resize view so you can see all nodes";
159
160 /* API callbacks. */
161 ot->exec = node_view_all_exec;
163
164 /* flags */
165 ot->flag = 0;
166}
167
169
170/* -------------------------------------------------------------------- */
173
175{
176 ARegion *region = CTX_wm_region(C);
177 SpaceNode *snode = CTX_wm_space_node(C);
178 const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
179
180 if (space_node_view_flag(*C, *snode, *region, NODE_SELECT, smooth_viewtx)) {
181 return OPERATOR_FINISHED;
182 }
183 return OPERATOR_CANCELLED;
184}
185
187{
188 /* identifiers */
189 ot->name = "Frame Selected";
190 ot->idname = "NODE_OT_view_selected";
191 ot->description = "Resize view so you can see selected nodes";
192
193 /* API callbacks. */
196
197 /* flags */
198 ot->flag = 0;
199}
200
202
203/* -------------------------------------------------------------------- */
206
213
215{
216 SpaceNode *snode = CTX_wm_space_node(C);
217 ARegion *region = CTX_wm_region(C);
219
220 switch (event->type) {
221 case MOUSEMOVE:
222
223 snode->xof -= (nvm->mvalo.x - event->mval[0]);
224 snode->yof -= (nvm->mvalo.y - event->mval[1]);
225 nvm->mvalo.x = event->mval[0];
226 nvm->mvalo.y = event->mval[1];
227
228 /* prevent dragging image outside of the window and losing it! */
229 CLAMP(snode->xof, nvm->xmin, nvm->xmax);
230 CLAMP(snode->yof, nvm->ymin, nvm->ymax);
231
232 ED_region_tag_redraw(region);
235
236 break;
237
238 case LEFTMOUSE:
239 case MIDDLEMOUSE:
240 if (event->val == KM_RELEASE) {
241 MEM_freeN(nvm);
242 op->customdata = nullptr;
243 return OPERATOR_FINISHED;
244 }
245 break;
246 case EVT_ESCKEY:
247 case RIGHTMOUSE:
248 snode->xof = nvm->xof_orig;
249 snode->yof = nvm->yof_orig;
250 ED_region_tag_redraw(region);
253
254 MEM_freeN(nvm);
255 op->customdata = nullptr;
256
257 return OPERATOR_CANCELLED;
258 default: {
259 break;
260 }
261 }
262
264}
265
267{
268 Main *bmain = CTX_data_main(C);
269 SpaceNode *snode = CTX_wm_space_node(C);
270 ARegion *region = CTX_wm_region(C);
271 NodeViewMove *nvm;
272 Image *ima;
273 ImBuf *ibuf;
274 const float pad = 32.0f; /* Better be bigger than scroll-bars. */
275
276 void *lock;
277
278 ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
279 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
280
281 if (ibuf == nullptr) {
282 BKE_image_release_ibuf(ima, ibuf, lock);
283 return OPERATOR_CANCELLED;
284 }
285
286 nvm = MEM_callocN<NodeViewMove>(__func__);
287 op->customdata = nvm;
288 nvm->mvalo.x = event->mval[0];
289 nvm->mvalo.y = event->mval[1];
290
291 nvm->xmin = -(region->winx / 2) - (ibuf->x * (0.5f * snode->zoom)) + pad;
292 nvm->xmax = (region->winx / 2) + (ibuf->x * (0.5f * snode->zoom)) - pad;
293 nvm->ymin = -(region->winy / 2) - (ibuf->y * (0.5f * snode->zoom)) + pad;
294 nvm->ymax = (region->winy / 2) + (ibuf->y * (0.5f * snode->zoom)) - pad;
295
296 nvm->xof_orig = snode->xof;
297 nvm->yof_orig = snode->yof;
298
299 BKE_image_release_ibuf(ima, ibuf, lock);
300
301 /* add modal handler */
303
305}
306
308{
310 MEM_freeN(nvm);
311 op->customdata = nullptr;
312}
313
315{
316 /* identifiers */
317 ot->name = "Background Image Move";
318 ot->description = "Move node backdrop";
319 ot->idname = "NODE_OT_backimage_move";
320
321 /* API callbacks. */
326
327 /* flags */
329}
330
332
333/* -------------------------------------------------------------------- */
336
338{
339 SpaceNode *snode = CTX_wm_space_node(C);
340 ARegion *region = CTX_wm_region(C);
341 float fac = RNA_float_get(op->ptr, "factor");
342
343 snode->zoom *= fac;
344 ED_region_tag_redraw(region);
347
348 return OPERATOR_FINISHED;
349}
350
352{
353
354 /* identifiers */
355 ot->name = "Background Image Zoom";
356 ot->idname = "NODE_OT_backimage_zoom";
357 ot->description = "Zoom in/out the background image";
358
359 /* API callbacks. */
360 ot->exec = backimage_zoom_exec;
362
363 /* flags */
364 ot->flag = OPTYPE_BLOCKING;
365
366 /* internal */
367 RNA_def_float(ot->srna, "factor", 1.2f, 0.0f, 10.0f, "Factor", "", 0.0f, 10.0f);
368}
369
371
372/* -------------------------------------------------------------------- */
375
377{
378 Main *bmain = CTX_data_main(C);
379 SpaceNode *snode = CTX_wm_space_node(C);
380 ARegion *region = CTX_wm_region(C);
381
382 Image *ima;
383 ImBuf *ibuf;
384
385 const float pad = 32.0f;
386
387 void *lock;
388
389 float facx, facy;
390
391 ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
392 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
393
394 if ((ibuf == nullptr) || (ibuf->x == 0) || (ibuf->y == 0)) {
395 BKE_image_release_ibuf(ima, ibuf, lock);
396 return OPERATOR_CANCELLED;
397 }
398
399 facx = 1.0f * (region->sizex - pad) / (ibuf->x * snode->zoom);
400 facy = 1.0f * (region->sizey - pad) / (ibuf->y * snode->zoom);
401
402 BKE_image_release_ibuf(ima, ibuf, lock);
403
404 snode->zoom *= min_ff(facx, facy) * UI_SCALE_FAC;
405
406 snode->xof = 0;
407 snode->yof = 0;
408
409 ED_region_tag_redraw(region);
412
413 return OPERATOR_FINISHED;
414}
415
417{
418
419 /* identifiers */
420 ot->name = "Background Image Fit";
421 ot->idname = "NODE_OT_backimage_fit";
422 ot->description = "Fit the background image to the view";
423
424 /* API callbacks. */
425 ot->exec = backimage_fit_exec;
427
428 /* flags */
429 ot->flag = OPTYPE_BLOCKING;
430}
431
433
434/* -------------------------------------------------------------------- */
437
441 int x, y;
443
445 float colf[4];
446 float linearcol[4];
447
448 int draw;
450};
451
452static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
453{
454 Scene *scene = CTX_data_scene(C);
455 ImageSampleInfo *info = (ImageSampleInfo *)arg_info;
456
457 if (info->draw) {
458 ED_image_draw_info(scene,
459 region,
460 info->color_manage,
461 false,
462 info->channels,
463 info->x,
464 info->y,
465 info->col,
466 info->colf,
467 info->linearcol);
468 }
469}
470
471} // namespace blender::ed::space_node
472
474 Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float fpos[2])
475{
476 if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
477 return false;
478 }
479
480 void *lock;
481 Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
482 ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
483 if (!ibuf) {
484 BKE_image_release_ibuf(ima, ibuf, lock);
485 return false;
486 }
487
488 /* map the mouse coords to the backdrop image space */
489 float bufx = ibuf->x * snode->zoom;
490 float bufy = ibuf->y * snode->zoom;
491 fpos[0] = (bufx > 0.0f ? (float(mval[0]) - 0.5f * region->winx - snode->xof) / bufx + 0.5f :
492 0.0f);
493 fpos[1] = (bufy > 0.0f ? (float(mval[1]) - 0.5f * region->winy - snode->yof) / bufy + 0.5f :
494 0.0f);
495
496 BKE_image_release_ibuf(ima, ibuf, lock);
497 return true;
498}
499
501 Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3])
502{
503 void *lock;
504 Image *ima;
505 ImBuf *ibuf;
506 float fx, fy, bufx, bufy;
507 bool ret = false;
508
509 if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
510 /* use viewer image for color sampling only if we're in compositor tree
511 * with backdrop enabled
512 */
513 return false;
514 }
515
516 ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
517 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
518 if (!ibuf) {
519 return false;
520 }
521
522 /* map the mouse coords to the backdrop image space */
523 bufx = ibuf->x * snode->zoom;
524 bufy = ibuf->y * snode->zoom;
525 fx = (bufx > 0.0f ? (float(mval[0]) - 0.5f * region->winx - snode->xof) / bufx + 0.5f : 0.0f);
526 fy = (bufy > 0.0f ? (float(mval[1]) - 0.5f * region->winy - snode->yof) / bufy + 0.5f : 0.0f);
527
528 if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
529 const float *fp;
530 uchar *cp;
531 int x = int(fx * ibuf->x), y = int(fy * ibuf->y);
532
533 CLAMP(x, 0, ibuf->x - 1);
534 CLAMP(y, 0, ibuf->y - 1);
535
536 if (ibuf->float_buffer.data) {
537 fp = (ibuf->float_buffer.data + (ibuf->channels) * (y * ibuf->x + x));
538 /* #IB_PROFILE_NONE is default but in fact its linear. */
539 copy_v3_v3(r_col, fp);
540 ret = true;
541 }
542 else if (ibuf->byte_buffer.data) {
543 cp = ibuf->byte_buffer.data + 4 * (y * ibuf->x + x);
544 rgb_uchar_to_float(r_col, cp);
546 ret = true;
547 }
548 }
549
550 BKE_image_release_ibuf(ima, ibuf, lock);
551
552 return ret;
553}
554
555namespace blender::ed::space_node {
556
557static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
558{
559 Main *bmain = CTX_data_main(C);
560 SpaceNode *snode = CTX_wm_space_node(C);
561 ARegion *region = CTX_wm_region(C);
563 void *lock;
564 Image *ima;
565 ImBuf *ibuf;
566 float fx, fy, bufx, bufy;
567
568 ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node");
569 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
570 if (!ibuf) {
571 info->draw = 0;
572 return;
573 }
574
575 if (!ibuf->byte_buffer.data) {
577 }
578
579 /* map the mouse coords to the backdrop image space */
580 bufx = ibuf->x * snode->zoom;
581 bufy = ibuf->y * snode->zoom;
582 fx = (bufx > 0.0f ? (float(event->mval[0]) - 0.5f * region->winx - snode->xof) / bufx + 0.5f :
583 0.0f);
584 fy = (bufy > 0.0f ? (float(event->mval[1]) - 0.5f * region->winy - snode->yof) / bufy + 0.5f :
585 0.0f);
586
587 if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
588 const float *fp;
589 uchar *cp;
590 int x = int(fx * ibuf->x), y = int(fy * ibuf->y);
591
592 CLAMP(x, 0, ibuf->x - 1);
593 CLAMP(y, 0, ibuf->y - 1);
594
595 info->x = x;
596 info->y = y;
597 info->draw = 1;
598 info->channels = ibuf->channels;
599
600 if (ibuf->byte_buffer.data) {
601 cp = ibuf->byte_buffer.data + 4 * (y * ibuf->x + x);
602
603 info->col[0] = cp[0];
604 info->col[1] = cp[1];
605 info->col[2] = cp[2];
606 info->col[3] = cp[3];
607
608 info->colf[0] = float(cp[0]) / 255.0f;
609 info->colf[1] = float(cp[1]) / 255.0f;
610 info->colf[2] = float(cp[2]) / 255.0f;
611 info->colf[3] = float(cp[3]) / 255.0f;
612
613 copy_v4_v4(info->linearcol, info->colf);
615 info->linearcol, false, ibuf->byte_buffer.colorspace);
616
617 info->color_manage = true;
618 }
619 if (ibuf->float_buffer.data) {
620 fp = (ibuf->float_buffer.data + (ibuf->channels) * (y * ibuf->x + x));
621
622 info->colf[0] = fp[0];
623 info->colf[1] = fp[1];
624 info->colf[2] = fp[2];
625 info->colf[3] = fp[3];
626
627 info->color_manage = true;
628 }
629
631 }
632 else {
633 info->draw = 0;
634 ED_node_sample_set(nullptr);
635 }
636
637 BKE_image_release_ibuf(ima, ibuf, lock);
638
640}
641
643{
645
646 ED_node_sample_set(nullptr);
649 MEM_freeN(info);
650}
651
653{
654 SpaceNode *snode = CTX_wm_space_node(C);
655 ARegion *region = CTX_wm_region(C);
656 ImageSampleInfo *info;
657
658 /* Don't handle events intended for nodes (which rely on click/drag distinction).
659 * which this operator would use since sampling is normally activated on press, see: #98191. */
660 if (node_or_socket_isect_event(*C, *event)) {
662 }
663
664 if (!ED_node_is_compositor(snode) || !(snode->flag & SNODE_BACKDRAW)) {
665 return OPERATOR_CANCELLED;
666 }
667
668 info = MEM_callocN<ImageSampleInfo>("ImageSampleInfo");
669 info->art = region->runtime->type;
671 region->runtime->type, sample_draw, info, REGION_DRAW_POST_PIXEL);
672 op->customdata = info;
673
674 sample_apply(C, op, event);
675
677
679}
680
682{
683 switch (event->type) {
684 case LEFTMOUSE:
685 case RIGHTMOUSE: /* XXX hardcoded */
686 if (event->val == KM_RELEASE) {
687 sample_exit(C, op);
688 return OPERATOR_CANCELLED;
689 }
690 break;
691 case MOUSEMOVE:
692 sample_apply(C, op, event);
693 break;
694 default: {
695 break;
696 }
697 }
698
700}
701
703{
704 sample_exit(C, op);
705}
706
708{
709 /* identifiers */
710 ot->name = "Backimage Sample";
711 ot->idname = "NODE_OT_backimage_sample";
712 ot->description = "Use mouse to sample background image";
713
714 /* API callbacks. */
715 ot->invoke = sample_invoke;
716 ot->modal = sample_modal;
717 ot->cancel = sample_cancel;
719
720 /* flags */
721 ot->flag = OPTYPE_BLOCKING;
722}
723
725
726} // namespace blender::ed::space_node
SpaceNode * CTX_wm_space_node(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(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)
MINLINE float min_ff(float a, float b)
MINLINE void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
void BLI_rctf_scale(rctf *rect, float scale)
Definition rct.cc:677
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:202
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.cc:657
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:206
void BLI_rctf_init_minmax(struct rctf *rect)
Definition rct.cc:480
unsigned char uchar
#define CLAMP(a, b, c)
@ IMA_TYPE_COMPOSITE
@ NODE_SELECT
@ RGN_TYPE_WINDOW
@ SNODE_BACKDRAW
#define UI_SCALE_FAC
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
void ED_image_draw_info(Scene *scene, ARegion *region, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4])
void ED_node_sample_set(const float col[4])
Definition drawnode.cc:132
bool ED_node_is_compositor(const SpaceNode *snode)
Definition node_edit.cc:487
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:693
bool ED_operator_node_active(bContext *C)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
bool ED_region_draw_cb_exit(ARegionType *art, void *handle)
#define REGION_DRAW_POST_PIXEL
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], const ColorSpace *colorspace)
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, const ColorSpace *colorspace)
void IMB_byte_from_float(ImBuf *ibuf)
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
void UI_view2d_smooth_view(const bContext *C, ARegion *region, const rctf *cur, int smooth_viewtx)
#define NC_NODE
Definition WM_types.hh:394
@ KM_RELEASE
Definition WM_types.hh:312
#define ND_DISPLAY
Definition WM_types.hh:491
#define ND_SPACE_NODE_VIEW
Definition WM_types.hh:536
@ OPTYPE_BLOCKING
Definition WM_types.hh:184
@ OPTYPE_GRAB_CURSOR_XY
Definition WM_types.hh:188
#define NC_SPACE
Definition WM_types.hh:392
int pad[32 - sizeof(int)]
volatile int lock
nullptr float
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
static bool space_node_composite_active_view_poll(bContext *C)
Definition node_view.cc:58
static wmOperatorStatus node_view_all_exec(bContext *C, wmOperator *op)
Definition node_view.cc:137
static wmOperatorStatus backimage_fit_exec(bContext *C, wmOperator *)
Definition node_view.cc:376
bool space_node_view_flag(bContext &C, SpaceNode &snode, ARegion &region, int node_flag, int smooth_viewtx)
Definition node_view.cc:76
void NODE_OT_backimage_sample(wmOperatorType *ot)
Definition node_view.cc:707
static wmOperatorStatus sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition node_view.cc:652
void NODE_OT_backimage_zoom(wmOperatorType *ot)
Definition node_view.cc:351
static wmOperatorStatus node_view_selected_exec(bContext *C, wmOperator *op)
Definition node_view.cc:174
void NODE_OT_backimage_move(wmOperatorType *ot)
Definition node_view.cc:314
static void sample_exit(bContext *C, wmOperator *op)
Definition node_view.cc:642
static void sample_cancel(bContext *C, wmOperator *op)
Definition node_view.cc:702
void NODE_OT_view_selected(wmOperatorType *ot)
Definition node_view.cc:186
static wmOperatorStatus sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition node_view.cc:681
static wmOperatorStatus snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition node_view.cc:266
static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
Definition node_view.cc:452
static bool space_node_active_view_poll(bContext *C)
Definition node_view.cc:46
static void snode_bg_viewmove_cancel(bContext *, wmOperator *op)
Definition node_view.cc:307
void NODE_OT_view_all(wmOperatorType *ot)
Definition node_view.cc:153
bool node_or_socket_isect_event(const bContext &C, const wmEvent &event)
static wmOperatorStatus backimage_zoom_exec(bContext *C, wmOperator *op)
Definition node_view.cc:337
bool composite_node_active(bContext *C)
Definition node_edit.cc:443
static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
Definition node_view.cc:557
static wmOperatorStatus snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition node_view.cc:214
void NODE_OT_backimage_fit(wmOperatorType *ot)
Definition node_view.cc:416
VecBase< int32_t, 2 > int2
bool ED_space_node_get_position(Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float fpos[2])
Definition node_view.cc:473
bool ED_space_node_color_sample(Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3])
Definition node_view.cc:500
return ret
float RNA_float_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
ARegionRuntimeHandle * runtime
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct bNodeTree * edittree
float xmax
float xmin
float ymax
float ymin
wmEventType type
Definition WM_types.hh:757
short val
Definition WM_types.hh:759
int mval[2]
Definition WM_types.hh:763
struct PointerRNA * ptr
void WM_main_add_notifier(uint type, void *reference)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
@ RIGHTMOUSE
@ MOUSEMOVE
@ LEFTMOUSE
@ MIDDLEMOUSE
@ EVT_ESCKEY
wmOperatorType * ot
Definition wm_files.cc:4237
int WM_operator_smooth_viewtx_get(const wmOperator *op)