Blender V4.5
interface_template_curve_mapping.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_colortools.hh"
10#include "BKE_context.hh"
11#include "BKE_library.hh"
12
13#include "BLI_rect.h"
14#include "BLI_string_ref.hh"
15
16#include "BLT_translation.hh"
17
18#include "ED_screen.hh"
19#include "ED_undo.hh"
20
21#include "RNA_access.hh"
22#include "RNA_prototypes.hh"
23
24#include "UI_interface.hh"
25#include "interface_intern.hh"
27
29
31{
32 return BLI_rctf_size_x(&cumap->curr) < BLI_rctf_size_x(&cumap->clipr);
33}
34
36{
37 return BLI_rctf_size_x(&cumap->curr) > CURVE_ZOOM_MAX * BLI_rctf_size_x(&cumap->clipr);
38}
39
41{
42 if (curvemap_can_zoom_in(cumap)) {
43 const float dx = 0.1154f * BLI_rctf_size_x(&cumap->curr);
44 cumap->curr.xmin += dx;
45 cumap->curr.xmax -= dx;
46 const float dy = 0.1154f * BLI_rctf_size_y(&cumap->curr);
47 cumap->curr.ymin += dy;
48 cumap->curr.ymax -= dy;
49 }
50
52}
53
55{
56 float d, d1;
57
58 if (curvemap_can_zoom_out(cumap)) {
59 d = d1 = 0.15f * BLI_rctf_size_x(&cumap->curr);
60
61 if (cumap->flag & CUMA_DO_CLIP) {
62 if (cumap->curr.xmin - d < cumap->clipr.xmin) {
63 d1 = cumap->curr.xmin - cumap->clipr.xmin;
64 }
65 }
66 cumap->curr.xmin -= d1;
67
68 d1 = d;
69 if (cumap->flag & CUMA_DO_CLIP) {
70 if (cumap->curr.xmax + d > cumap->clipr.xmax) {
71 d1 = -cumap->curr.xmax + cumap->clipr.xmax;
72 }
73 }
74 cumap->curr.xmax += d1;
75
76 d = d1 = 0.15f * BLI_rctf_size_y(&cumap->curr);
77
78 if (cumap->flag & CUMA_DO_CLIP) {
79 if (cumap->curr.ymin - d < cumap->clipr.ymin) {
80 d1 = cumap->curr.ymin - cumap->clipr.ymin;
81 }
82 }
83 cumap->curr.ymin -= d1;
84
85 d1 = d;
86 if (cumap->flag & CUMA_DO_CLIP) {
87 if (cumap->curr.ymax + d > cumap->clipr.ymax) {
88 d1 = -cumap->curr.ymax + cumap->clipr.ymax;
89 }
90 }
91 cumap->curr.ymax += d1;
92 }
93
95}
96
97/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
98static uiBlock *curvemap_clipping_func(bContext *C, ARegion *region, void *cumap_v)
99{
100 CurveMapping *cumap = static_cast<CurveMapping *>(cumap_v);
101 uiBut *bt;
102 const float width = 8 * UI_UNIT_X;
103
104 uiBlock *block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
107
108 bt = uiDefButBitI(block,
111 1,
112 IFACE_("Use Clipping"),
113 0,
114 5 * UI_UNIT_Y,
115 width,
116 UI_UNIT_Y,
117 &cumap->flag,
118 0.0,
119 0.0,
120 "");
121 UI_but_func_set(bt, [cumap](bContext & /*C*/) { BKE_curvemapping_changed(cumap, false); });
122
124 bt = uiDefButF(block,
126 0,
127 IFACE_("Min X:"),
128 0,
129 4 * UI_UNIT_Y,
130 width,
131 UI_UNIT_Y,
132 &cumap->clipr.xmin,
133 -100.0,
134 cumap->clipr.xmax,
135 "");
138 bt = uiDefButF(block,
140 0,
141 IFACE_("Min Y:"),
142 0,
143 3 * UI_UNIT_Y,
144 width,
145 UI_UNIT_Y,
146 &cumap->clipr.ymin,
147 -100.0,
148 cumap->clipr.ymax,
149 "");
152 bt = uiDefButF(block,
154 0,
155 IFACE_("Max X:"),
156 0,
157 2 * UI_UNIT_Y,
158 width,
159 UI_UNIT_Y,
160 &cumap->clipr.xmax,
161 cumap->clipr.xmin,
162 100.0,
163 "");
166 bt = uiDefButF(block,
168 0,
169 IFACE_("Max Y:"),
170 0,
171 UI_UNIT_Y,
172 width,
173 UI_UNIT_Y,
174 &cumap->clipr.ymax,
175 cumap->clipr.ymin,
176 100.0,
177 "");
180
181 UI_block_bounds_set_normal(block, 0.3f * U.widget_unit);
183
184 return block;
185}
186
188 bContext *C, ARegion *region, RNAUpdateCb &cb, bool show_extend, int reset_mode)
189{
190 PointerRNA cumap_ptr = RNA_property_pointer_get(&cb.ptr, cb.prop);
191 CurveMapping *cumap = static_cast<CurveMapping *>(cumap_ptr.data);
192
193 short yco = 0;
194 const short menuwidth = 10 * UI_UNIT_X;
195
196 uiBlock *block = UI_block_begin(C, region, __func__, blender::ui::EmbossType::Emboss);
197
198 {
199 uiBut *but = uiDefIconTextBut(block,
201 1,
202 ICON_BLANK1,
203 IFACE_("Reset View"),
204 0,
205 yco -= UI_UNIT_Y,
206 menuwidth,
207 UI_UNIT_Y,
208 nullptr,
209 0.0,
210 0.0,
211 "");
212 UI_but_func_set(but, [cumap](bContext &C) {
215 });
216 }
217
218 if (show_extend && !(cumap->flag & CUMA_USE_WRAPPING)) {
219 {
220 uiBut *but = uiDefIconTextBut(block,
222 1,
223 ICON_BLANK1,
224 IFACE_("Extend Horizontal"),
225 0,
226 yco -= UI_UNIT_Y,
227 menuwidth,
228 UI_UNIT_Y,
229 nullptr,
230 0.0,
231 0.0,
232 "");
233 UI_but_func_set(but, [cumap, cb](bContext &C) {
235 BKE_curvemapping_changed(cumap, false);
236 rna_update_cb(C, cb);
237 ED_undo_push(&C, "CurveMap tools");
239 });
240 }
241 {
242 uiBut *but = uiDefIconTextBut(block,
244 1,
245 ICON_BLANK1,
246 IFACE_("Extend Extrapolated"),
247 0,
248 yco -= UI_UNIT_Y,
249 menuwidth,
250 UI_UNIT_Y,
251 nullptr,
252 0.0,
253 0.0,
254 "");
255 UI_but_func_set(but, [cumap, cb](bContext &C) {
257 BKE_curvemapping_changed(cumap, false);
258 rna_update_cb(C, cb);
259 ED_undo_push(&C, "CurveMap tools");
261 });
262 }
263 }
264
265 {
266 uiBut *but = uiDefIconTextBut(block,
268 1,
269 ICON_BLANK1,
270 IFACE_("Reset Curve"),
271 0,
272 yco -= UI_UNIT_Y,
273 menuwidth,
274 UI_UNIT_Y,
275 nullptr,
276 0.0,
277 0.0,
278 "");
279 UI_but_func_set(but, [cumap, cb, reset_mode](bContext &C) {
280 CurveMap *cuma = cumap->cm + cumap->cur;
281 BKE_curvemap_reset(cuma, &cumap->clipr, cumap->preset, reset_mode);
282 BKE_curvemapping_changed(cumap, false);
283 rna_update_cb(C, cb);
284 ED_undo_push(&C, "CurveMap tools");
286 });
287 }
288
290 UI_block_bounds_set_text(block, 3.0f * UI_UNIT_X);
291
292 return block;
293}
294
296{
297 return curvemap_tools_func(
298 C, region, *static_cast<RNAUpdateCb *>(cb_v), true, CURVEMAP_SLOPE_POSITIVE);
299}
300
302{
303 return curvemap_tools_func(
304 C, region, *static_cast<RNAUpdateCb *>(cb_v), true, CURVEMAP_SLOPE_NEGATIVE);
305}
306
307static uiBlock *curvemap_brush_tools_func(bContext *C, ARegion *region, void *cb_v)
308{
309 return curvemap_tools_func(
310 C, region, *static_cast<RNAUpdateCb *>(cb_v), false, CURVEMAP_SLOPE_POSITIVE);
311}
312
314{
315 return curvemap_tools_func(
316 C, region, *static_cast<RNAUpdateCb *>(cb_v), false, CURVEMAP_SLOPE_POSITIVE);
317}
318
323
331 char labeltype,
332 bool levels,
333 bool brush,
334 bool neg_slope,
335 bool tone,
336 const RNAUpdateCb &cb)
337{
338 CurveMapping *cumap = static_cast<CurveMapping *>(ptr->data);
339 CurveMap *cm = &cumap->cm[cumap->cur];
340 uiBut *bt;
341 const float dx = UI_UNIT_X;
343
344 uiBlock *block = uiLayoutGetBlock(layout);
345
347
348 if (tone) {
349 uiLayout *split = &layout->split(0.0f, false);
350 split->row(false).prop(ptr, "tone", UI_ITEM_R_EXPAND, std::nullopt, ICON_NONE);
351 }
352
353 /* curve chooser */
354 uiLayout *row = &layout->row(false);
355
356 if (labeltype == 'v') {
357 /* vector */
358 uiLayout *sub = &row->row(true);
360
361 if (cumap->cm[0].curve) {
362 bt = uiDefButI(block, UI_BTYPE_ROW, 0, "X", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, "");
364 }
365 if (cumap->cm[1].curve) {
366 bt = uiDefButI(block, UI_BTYPE_ROW, 0, "Y", 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, "");
368 }
369 if (cumap->cm[2].curve) {
370 bt = uiDefButI(block, UI_BTYPE_ROW, 0, "Z", 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, "");
372 }
373 }
374 else if (labeltype == 'c' && cumap->tone != CURVE_TONE_FILMLIKE) {
375 /* color */
376 uiLayout *sub = &row->row(true);
378
379 if (cumap->cm[3].curve) {
380 bt = uiDefButI(block,
382 0,
384 0,
385 0,
386 dx,
387 dx,
388 &cumap->cur,
389 0.0,
390 3.0,
391 TIP_("Combined channels"));
393 }
394 if (cumap->cm[0].curve) {
395 bt = uiDefButI(block,
397 0,
399 0,
400 0,
401 dx,
402 dx,
403 &cumap->cur,
404 0.0,
405 0.0,
406 TIP_("Red channel"));
408 }
409 if (cumap->cm[1].curve) {
410 bt = uiDefButI(block,
412 0,
414 0,
415 0,
416 dx,
417 dx,
418 &cumap->cur,
419 0.0,
420 1.0,
421 TIP_("Green channel"));
423 }
424 if (cumap->cm[2].curve) {
425 bt = uiDefButI(block,
427 0,
429 0,
430 0,
431 dx,
432 dx,
433 &cumap->cur,
434 0.0,
435 2.0,
436 TIP_("Blue channel"));
438 }
439 }
440 else if (labeltype == 'h') {
441 /* HSV */
442 uiLayout *sub = &row->row(true);
444
445 if (cumap->cm[0].curve) {
446 bt = uiDefButI(block,
448 0,
449 IFACE_("H"),
450 0,
451 0,
452 dx,
453 dx,
454 &cumap->cur,
455 0.0,
456 0.0,
457 TIP_("Hue level"));
459 }
460 if (cumap->cm[1].curve) {
461 bt = uiDefButI(block,
463 0,
464 IFACE_("S"),
465 0,
466 0,
467 dx,
468 dx,
469 &cumap->cur,
470 0.0,
471 1.0,
472 TIP_("Saturation level"));
474 }
475 if (cumap->cm[2].curve) {
476 bt = uiDefButI(block,
478 0,
479 IFACE_("V"),
480 0,
481 0,
482 dx,
483 dx,
484 &cumap->cur,
485 0.0,
486 2.0,
487 TIP_("Value level"));
489 }
490 }
491 else {
493 }
494
495 if (labeltype == 'h') {
496 bg = UI_GRAD_H;
497 }
498
499 /* operation buttons */
500 /* (Right aligned) */
501 uiLayout *sub = &row->row(true);
503
504 if (!(cumap->flag & CUMA_USE_WRAPPING)) {
505 /* Zoom in */
506 bt = uiDefIconBut(
507 block, UI_BTYPE_BUT, 0, ICON_ZOOM_IN, 0, 0, dx, dx, nullptr, 0.0, 0.0, TIP_("Zoom in"));
508 UI_but_func_set(bt, [cumap](bContext &C) { curvemap_buttons_zoom_in(&C, cumap); });
509 if (!curvemap_can_zoom_in(cumap)) {
510 UI_but_disable(bt, "");
511 }
512
513 /* Zoom out */
514 bt = uiDefIconBut(
515 block, UI_BTYPE_BUT, 0, ICON_ZOOM_OUT, 0, 0, dx, dx, nullptr, 0.0, 0.0, TIP_("Zoom out"));
516 UI_but_func_set(bt, [cumap](bContext &C) { curvemap_buttons_zoom_out(&C, cumap); });
517 if (!curvemap_can_zoom_out(cumap)) {
518 UI_but_disable(bt, "");
519 }
520
521 /* Clipping button. */
522 const int icon = (cumap->flag & CUMA_DO_CLIP) ? ICON_CLIPUV_HLT : ICON_CLIPUV_DEHLT;
524 block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, TIP_("Clipping Options"));
526 UI_but_func_set(bt, [cb](bContext &C) { rna_update_cb(C, cb); });
527 }
528
529 RNAUpdateCb *tools_cb = MEM_new<RNAUpdateCb>(__func__, cb);
530 if (brush && neg_slope) {
531 bt = uiDefIconBlockBut(block,
533 tools_cb,
534 0,
535 ICON_NONE,
536 0,
537 0,
538 dx,
539 dx,
540 TIP_("Tools"));
541 }
542 else if (brush) {
544 block, curvemap_brush_tools_func, tools_cb, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
545 }
546 else if (neg_slope) {
548 block, curvemap_tools_negslope_func, tools_cb, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
549 }
550 else {
552 block, curvemap_tools_posslope_func, tools_cb, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
553 }
554 /* Pass ownership of `tools_cb` to the button. */
556 bt,
557 [](bContext *, void *, void *) {},
558 tools_cb,
559 nullptr,
562
563 UI_block_funcN_set(block,
565 MEM_new<RNAUpdateCb>(__func__, cb),
566 nullptr,
569
570 /* Curve itself. */
571 const int size = max_ii(uiLayoutGetWidth(layout), UI_UNIT_X);
572 row = &layout->row(false);
573 uiButCurveMapping *curve_but = (uiButCurveMapping *)uiDefBut(block,
575 0,
576 IFACE_("Edit Curve Map"),
577 0,
578 0,
579 size,
580 8.0f * UI_UNIT_X,
581 cumap,
582 0.0f,
583 1.0f,
584 "");
585 curve_but->gradient_type = bg;
586
587 /* Sliders for selected curve point. */
588 int i;
589 CurveMapPoint *cmp = nullptr;
590 bool point_last_or_first = false;
591 for (i = 0; i < cm->totpoint; i++) {
592 if (cm->curve[i].flag & CUMA_SELECT) {
593 cmp = &cm->curve[i];
594 break;
595 }
596 }
597 if (ELEM(i, 0, cm->totpoint - 1)) {
598 point_last_or_first = true;
599 }
600
601 if (cmp) {
602 rctf bounds;
603 if (cumap->flag & CUMA_DO_CLIP) {
604 bounds = cumap->clipr;
605 }
606 else {
607 bounds.xmin = bounds.ymin = -1000.0;
608 bounds.xmax = bounds.ymax = 1000.0;
609 }
610
612
613 layout->row(true);
614
615 /* Curve handle buttons. */
616 bt = uiDefIconBut(block,
618 1,
619 ICON_HANDLE_AUTO,
620 0,
621 UI_UNIT_Y,
622 UI_UNIT_X,
623 UI_UNIT_Y,
624 nullptr,
625 0.0,
626 0.0,
627 TIP_("Auto Handle"));
628 UI_but_func_set(bt, [cumap, cb](bContext &C) {
629 CurveMap *cuma = cumap->cm + cumap->cur;
631 BKE_curvemapping_changed(cumap, false);
632 rna_update_cb(C, cb);
633 });
634 if (((cmp->flag & CUMA_HANDLE_AUTO_ANIM) == false) &&
635 ((cmp->flag & CUMA_HANDLE_VECTOR) == false))
636 {
637 bt->flag |= UI_SELECT_DRAW;
638 }
639
640 bt = uiDefIconBut(block,
642 1,
643 ICON_HANDLE_VECTOR,
644 0,
645 UI_UNIT_Y,
646 UI_UNIT_X,
647 UI_UNIT_Y,
648 nullptr,
649 0.0,
650 0.0,
651 TIP_("Vector Handle"));
652 UI_but_func_set(bt, [cumap, cb](bContext &C) {
653 CurveMap *cuma = cumap->cm + cumap->cur;
655 BKE_curvemapping_changed(cumap, false);
656 rna_update_cb(C, cb);
657 });
658 if (cmp->flag & CUMA_HANDLE_VECTOR) {
659 bt->flag |= UI_SELECT_DRAW;
660 }
661
662 bt = uiDefIconBut(block,
664 1,
665 ICON_HANDLE_AUTOCLAMPED,
666 0,
667 UI_UNIT_Y,
668 UI_UNIT_X,
669 UI_UNIT_Y,
670 nullptr,
671 0.0,
672 0.0,
673 TIP_("Auto Clamped"));
674 UI_but_func_set(bt, [cumap, cb](bContext &C) {
675 CurveMap *cuma = cumap->cm + cumap->cur;
677 BKE_curvemapping_changed(cumap, false);
678 rna_update_cb(C, cb);
679 });
680 if (cmp->flag & CUMA_HANDLE_AUTO_ANIM) {
681 bt->flag |= UI_SELECT_DRAW;
682 }
683
684 /* Curve handle position */
685 bt = uiDefButF(block,
687 0,
688 "X:",
689 0,
690 2 * UI_UNIT_Y,
691 UI_UNIT_X * 10,
692 UI_UNIT_Y,
693 &cmp->x,
694 bounds.xmin,
695 bounds.xmax,
696 "");
699 UI_but_func_set(bt, [cumap, cb](bContext &C) {
700 BKE_curvemapping_changed(cumap, true);
701 rna_update_cb(C, cb);
702 });
703
704 bt = uiDefButF(block,
706 0,
707 "Y:",
708 0,
709 1 * UI_UNIT_Y,
710 UI_UNIT_X * 10,
711 UI_UNIT_Y,
712 &cmp->y,
713 bounds.ymin,
714 bounds.ymax,
715 "");
718 UI_but_func_set(bt, [cumap, cb](bContext &C) {
719 BKE_curvemapping_changed(cumap, true);
720 rna_update_cb(C, cb);
721 });
722
723 /* Curve handle delete point */
724 bt = uiDefIconBut(
725 block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, dx, dx, nullptr, 0.0, 0.0, TIP_("Delete points"));
726 UI_but_func_set(bt, [cumap, cb](bContext &C) {
727 BKE_curvemap_remove(cumap->cm + cumap->cur, SELECT);
728 BKE_curvemapping_changed(cumap, false);
729 rna_update_cb(C, cb);
730 });
731 if (point_last_or_first) {
733 }
734 }
735
736 /* black/white levels */
737 if (levels) {
738 uiLayout *split = &layout->split(0.0f, false);
739 split->column(false).prop(ptr, "black_level", UI_ITEM_R_EXPAND, std::nullopt, ICON_NONE);
740 split->column(false).prop(ptr, "white_level", UI_ITEM_R_EXPAND, std::nullopt, ICON_NONE);
741
742 layout->row(false);
743 bt = uiDefBut(block,
745 0,
746 IFACE_("Reset"),
747 0,
748 0,
749 UI_UNIT_X * 10,
750 UI_UNIT_Y,
751 nullptr,
752 0.0f,
753 0.0f,
754 TIP_("Reset Black/White point and curves"));
755 UI_but_func_set(bt, [cumap, cb](bContext &C) {
756 cumap->preset = CURVE_PRESET_LINE;
757 for (int a = 0; a < CM_TOT; a++) {
758 BKE_curvemap_reset(cumap->cm + a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
759 }
760
761 cumap->black[0] = cumap->black[1] = cumap->black[2] = 0.0f;
762 cumap->white[0] = cumap->white[1] = cumap->white[2] = 1.0f;
763 BKE_curvemapping_set_black_white(cumap, nullptr, nullptr);
764
765 BKE_curvemapping_changed(cumap, false);
766 rna_update_cb(C, cb);
767 });
768 }
769
770 UI_block_funcN_set(block, nullptr, nullptr, nullptr);
771}
772
775 const StringRefNull propname,
776 int type,
777 bool levels,
778 bool brush,
779 bool neg_slope,
780 bool tone)
781{
782 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
783 uiBlock *block = uiLayoutGetBlock(layout);
784
785 if (!prop) {
787 "curve property not found: %s.%s", RNA_struct_identifier(ptr->type), propname.c_str());
788 return;
789 }
790
791 if (RNA_property_type(prop) != PROP_POINTER) {
793 "curve is not a pointer: %s.%s", RNA_struct_identifier(ptr->type), propname.c_str());
794 return;
795 }
796
798 if (!cptr.data || !RNA_struct_is_a(cptr.type, &RNA_CurveMapping)) {
799 return;
800 }
801
802 ID *id = cptr.owner_id;
804
806 layout, &cptr, type, levels, brush, neg_slope, tone, RNAUpdateCb{*ptr, prop});
807
808 UI_block_lock_clear(block);
809}
void BKE_curvemapping_set_black_white(CurveMapping *cumap, const float black[3], const float white[3])
@ CURVEMAP_SLOPE_NEGATIVE
@ CURVEMAP_SLOPE_POSITIVE
void BKE_curvemapping_reset_view(CurveMapping *cumap)
void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
void BKE_curvemapping_changed(CurveMapping *cumap, bool rem_doubles)
void BKE_curvemap_remove(CurveMap *cuma, short flag)
void BKE_curvemap_handle_set(CurveMap *cuma, int type)
ARegion * CTX_wm_region(const bContext *C)
MINLINE int max_ii(int a, int b)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:202
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:206
#define ELEM(...)
#define TIP_(msgid)
#define CTX_IFACE_(context, msgid)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_COLOR
@ CUMA_EXTEND_EXTRAPOLATE
@ CUMA_DO_CLIP
@ CUMA_USE_WRAPPING
@ CUMA_HANDLE_AUTO_ANIM
@ CUMA_SELECT
@ CUMA_HANDLE_VECTOR
@ CURVE_TONE_FILMLIKE
@ CURVE_PRESET_LINE
@ HD_AUTO_ANIM
@ HD_VECT
@ HD_AUTO
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:639
void ED_undo_push(bContext *C, const char *str)
Definition ed_undo.cc:99
static void split(const char *text, const char *seps, char ***str, int *count)
#define RNA_warning(format,...)
@ PROP_POINTER
Definition RNA_types.hh:155
#define C
Definition RandGen.cpp:29
void UI_but_func_set(uiBut *but, std::function< void(bContext &)> func)
void * but_func_argN_copy(const void *argN)
void but_func_argN_free(void *argN)
void UI_but_disable(uiBut *but, const char *disabled_hint)
@ UI_BLOCK_THEME_STYLE_POPUP
#define UI_UNIT_Y
uiBut * uiDefButBitI(uiBlock *block, int type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
void UI_block_theme_style_set(uiBlock *block, char theme_style)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
@ UI_BUT_ICON_LEFT
void UI_block_lock_clear(uiBlock *block)
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
Definition interface.cc:625
void UI_but_number_step_size_set(uiBut *but, float step_size)
@ UI_DIR_DOWN
uiBut * uiDefButI(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_bounds_set_text(uiBlock *block, int addval)
Definition interface.cc:635
void UI_block_align_begin(uiBlock *block)
eButGradientType
@ UI_GRAD_H
@ UI_GRAD_NONE
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void UI_but_number_precision_set(uiBut *but, float precision)
@ UI_BLOCK_MOVEMOUSE_QUIT
@ UI_BLOCK_KEEP_OPEN
void UI_block_direction_set(uiBlock *block, char direction)
#define UI_UNIT_X
void UI_block_flag_enable(uiBlock *block, int flag)
uiBut * uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
@ UI_BTYPE_BUT
@ UI_BTYPE_BUT_MENU
@ UI_BTYPE_CURVE
@ UI_BTYPE_ROW
@ UI_BTYPE_NUM
@ UI_BTYPE_CHECKBOX
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
uiBut * uiDefButF(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, float *poin, float min, float max, std::optional< blender::StringRef > tip)
@ UI_BUT_DISABLED
void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr)
void UI_but_flag_enable(uiBut *but, int flag)
@ UI_ITEM_R_EXPAND
@ UI_LAYOUT_ALIGN_LEFT
@ UI_LAYOUT_ALIGN_RIGHT
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
int uiLayoutGetWidth(uiLayout *layout)
#define U
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition btDbvt.cpp:299
constexpr const char * c_str() const
#define SELECT
#define CM_TOT
#define ID_IS_EDITABLE(_id)
@ UI_SELECT_DRAW
static void curvemap_buttons_redraw(bContext &C)
static uiBlock * curvemap_tools_negslope_func(bContext *C, ARegion *region, void *cb_v)
void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, int type, bool levels, bool brush, bool neg_slope, bool tone)
static bool curvemap_can_zoom_in(CurveMapping *cumap)
static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labeltype, bool levels, bool brush, bool neg_slope, bool tone, const RNAUpdateCb &cb)
static uiBlock * curvemap_brush_tools_func(bContext *C, ARegion *region, void *cb_v)
static uiBlock * curvemap_tools_func(bContext *C, ARegion *region, RNAUpdateCb &cb, bool show_extend, int reset_mode)
static void curvemap_buttons_zoom_in(bContext *C, CurveMapping *cumap)
static uiBlock * curvemap_tools_posslope_func(bContext *C, ARegion *region, void *cb_v)
static bool curvemap_can_zoom_out(CurveMapping *cumap)
static void curvemap_buttons_zoom_out(bContext *C, CurveMapping *cumap)
static uiBlock * curvemap_brush_tools_negslope_func(bContext *C, ARegion *region, void *cb_v)
static uiBlock * curvemap_clipping_func(bContext *C, ARegion *region, void *cumap_v)
#define CURVE_ZOOM_MAX
static void rna_update_cb(bContext &C, const RNAUpdateCb &cb)
#define ERROR_LIBDATA_MESSAGE
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
CurveMapPoint * curve
CurveMap cm[4]
Definition DNA_ID.h:404
ID * owner_id
Definition RNA_types.hh:51
StructRNA * type
Definition RNA_types.hh:52
void * data
Definition RNA_types.hh:53
float xmax
float xmin
float ymax
float ymin
eButGradientType gradient_type
uiLayout & row(bool align)
uiLayout & split(float percentage, bool align)
i
Definition text_draw.cc:230
PointerRNA * ptr
Definition wm_files.cc:4226