Blender V4.3
buttons_texture.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10#include <cstring>
11
12#include "MEM_guardedalloc.h"
13
14#include "BLI_listbase.h"
15#include "BLI_string.h"
16#include "BLI_utildefines.h"
17
18#include "BLT_translation.hh"
19
20#include "DNA_ID.h"
21#include "DNA_brush_types.h"
22#include "DNA_linestyle_types.h"
23#include "DNA_modifier_types.h"
24#include "DNA_node_types.h"
26#include "DNA_object_types.h"
27#include "DNA_particle_types.h"
28#include "DNA_scene_types.h"
29#include "DNA_screen_types.h"
30#include "DNA_space_types.h"
32
33#include "BKE_context.hh"
34#include "BKE_layer.hh"
35#include "BKE_linestyle.h"
36#include "BKE_modifier.hh"
37#include "BKE_node_runtime.hh"
38#include "BKE_paint.hh"
39#include "BKE_particle.h"
40
41#include "RNA_access.hh"
42#include "RNA_prototypes.hh"
43
44#include "UI_interface.hh"
45#include "UI_resources.hh"
46
47#include "ED_node.hh"
48#include "ED_screen.hh"
49
50#include "WM_api.hh"
51#include "WM_types.hh"
52
54
55#include "buttons_intern.hh" /* own include */
56
57static ScrArea *find_area_properties(const bContext *C);
59
60/************************* Texture User **************************/
61
63 ID *id,
65 PropertyRNA *prop,
66 bNodeTree *ntree,
67 bNode *node,
68 bNodeSocket *socket,
69 const char *category,
70 int icon,
71 const char *name)
72{
73 ButsTextureUser *user = MEM_new<ButsTextureUser>("ButsTextureUser");
74
75 user->id = id;
76 user->ptr = ptr;
77 user->prop = prop;
78 user->ntree = ntree;
79 user->node = node;
80 user->socket = socket;
81 user->category = category;
82 user->icon = icon;
83 user->name = name;
85
86 BLI_addtail(users, user);
87}
88
90 ID *id,
92 PropertyRNA *prop,
93 const char *category,
94 int icon,
95 const char *name)
96{
97 ButsTextureUser *user = MEM_new<ButsTextureUser>("ButsTextureUser");
98
99 user->id = id;
100 user->ptr = ptr;
101 user->prop = prop;
102 user->category = category;
103 user->icon = icon;
104 user->name = name;
106
107 BLI_addtail(users, user);
108}
109
111 ID *id,
112 bNodeTree *ntree,
113 bNode *node,
115 PropertyRNA *prop,
116 const char *category,
117 int icon,
118 const char *name)
119{
120 ButsTextureUser *user = MEM_new<ButsTextureUser>("ButsTextureUser");
121
122 user->id = id;
123 user->ntree = ntree;
124 user->node = node;
125 user->ptr = ptr;
126 user->prop = prop;
127 user->category = category;
128 user->icon = icon;
129 user->name = name;
131
132 BLI_addtail(users, user);
133}
134
136 ID *id,
137 bNodeTree *ntree,
138 const char *category)
139{
140 if (ntree) {
141 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
142 if (node->type == CMP_NODE_TEXTURE) {
143 PointerRNA ptr = RNA_pointer_create(&ntree->id, &RNA_Node, node);
144 PropertyRNA *prop = RNA_struct_find_property(&ptr, "texture");
146 users, id, ntree, node, ptr, prop, category, RNA_struct_ui_icon(ptr.type), node->name);
147 }
148 else if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
149 PointerRNA ptr = RNA_pointer_create(&ntree->id, &RNA_Node, node);
151 id,
152 ntree,
153 node,
154 {nullptr},
155 nullptr,
156 category,
158 node->name);
159 }
160 else if (node->type == NODE_GROUP && node->id) {
161 buttons_texture_users_find_nodetree(users, id, (bNodeTree *)node->id, category);
162 }
163 }
164 }
165}
166
168 Object *ob,
172 blender::Set<const bNodeTree *> &handled_groups)
173{
174 PropertyRNA *prop;
175
176 for (bNode *node : node_tree->all_nodes()) {
177 if (node->type == NODE_GROUP && node->id) {
178 if (handled_groups.add(reinterpret_cast<bNodeTree *>(node->id))) {
179 /* Recurse into the node group */
181 ob, nmd, (bNodeTree *)node->id, users, handled_groups);
182 }
183 }
184 LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
185 if (socket->flag & SOCK_UNAVAIL) {
186 continue;
187 }
188 if (socket->type != SOCK_TEXTURE) {
189 continue;
190 }
191 PointerRNA ptr = RNA_pointer_create(&node_tree->id, &RNA_NodeSocket, socket);
192 prop = RNA_struct_find_property(&ptr, "default_value");
193
194 PointerRNA texptr = RNA_property_pointer_get(&ptr, prop);
195 Tex *tex = RNA_struct_is_a(texptr.type, &RNA_Texture) ? (Tex *)texptr.data : nullptr;
196 if (tex != nullptr) {
198 &ob->id,
199 ptr,
200 prop,
201 node_tree,
202 node,
203 socket,
204 N_("Geometry Nodes"),
206 nmd->modifier.name);
207 }
208 }
209 }
210}
211
212static void buttons_texture_modifier_foreach(void *user_data,
213 Object *ob,
214 ModifierData *md,
215 const PointerRNA *ptr,
216 PropertyRNA *texture_prop)
217{
218 ListBase *users = static_cast<ListBase *>(user_data);
219
220 if (md->type == eModifierType_Nodes) {
222 if (nmd->node_group != nullptr) {
223 blender::Set<const bNodeTree *> handled_groups;
224 buttons_texture_modifier_geonodes_users_add(ob, nmd, nmd->node_group, users, handled_groups);
225 }
226 }
227 else {
228 const ModifierTypeInfo *modifier_type = BKE_modifier_get_info((ModifierType)md->type);
229
231 users, &ob->id, *ptr, texture_prop, N_("Modifiers"), modifier_type->icon, md->name);
232 }
233}
234
236 const bContext *C,
237 SpaceProperties *sbuts)
238{
239 Scene *scene = nullptr;
240 Object *ob = nullptr;
241 FreestyleLineStyle *linestyle = nullptr;
242 Brush *brush = nullptr;
243 ID *pinid = sbuts->pinid;
244 bool limited_mode = (sbuts->flag & SB_TEX_USER_LIMITED) != 0;
245
246 /* get data from context */
247 if (pinid) {
248 if (GS(pinid->name) == ID_SCE) {
249 scene = (Scene *)pinid;
250 }
251 else if (GS(pinid->name) == ID_OB) {
252 ob = (Object *)pinid;
253 }
254 else if (GS(pinid->name) == ID_BR) {
255 brush = (Brush *)pinid;
256 }
257 else if (GS(pinid->name) == ID_LS) {
258 linestyle = (FreestyleLineStyle *)pinid;
259 }
260 }
261
262 if (!scene) {
263 scene = CTX_data_scene(C);
264 }
265
266 const ID_Type id_type = ID_Type(pinid != nullptr ? GS(pinid->name) : -1);
267 if (!pinid || id_type == ID_SCE) {
268 wmWindow *win = CTX_wm_window(C);
269 ViewLayer *view_layer = (win->scene == scene) ? WM_window_get_active_view_layer(win) :
271
274 BKE_view_layer_synced_ensure(scene, view_layer);
275 ob = BKE_view_layer_active_object_get(view_layer);
276 }
277
278 /* fill users */
280
281 if (scene && scene->nodetree) {
282 buttons_texture_users_find_nodetree(users, &scene->id, scene->nodetree, N_("Compositor"));
283 }
284
285 if (linestyle && !limited_mode) {
287 users, &linestyle->id, linestyle->nodetree, N_("Line Style"));
288 }
289
290 if (ob) {
292 MTex *mtex;
293 int a;
294
295 /* modifiers */
297
298 /* particle systems */
299 if (psys && !limited_mode) {
300 for (a = 0; a < MAX_MTEX; a++) {
301 mtex = psys->part->mtex[a];
302
303 if (mtex) {
304 PropertyRNA *prop;
305
307 &psys->part->id, &RNA_ParticleSettingsTextureSlot, mtex);
308 prop = RNA_struct_find_property(&ptr, "texture");
309
311 &psys->part->id,
312 ptr,
313 prop,
314 N_("Particles"),
315 RNA_struct_ui_icon(&RNA_ParticleSettings),
316 psys->name);
317 }
318 }
319 }
320
321 /* field */
322 if (ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
323 PropertyRNA *prop;
324
325 PointerRNA ptr = RNA_pointer_create(&ob->id, &RNA_FieldSettings, ob->pd);
326 prop = RNA_struct_find_property(&ptr, "texture");
327
329 users, &ob->id, ptr, prop, N_("Fields"), ICON_FORCE_TEXTURE, IFACE_("Texture Field"));
330 }
331 }
332
333 /* brush */
334 if (brush) {
335 PropertyRNA *prop;
336
337 /* texture */
338 PointerRNA ptr = RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mtex);
339 prop = RNA_struct_find_property(&ptr, "texture");
340
342 users, &brush->id, ptr, prop, N_("Brush"), ICON_BRUSH_DATA, IFACE_("Brush"));
343
344 /* mask texture */
345 ptr = RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mask_mtex);
346 prop = RNA_struct_find_property(&ptr, "texture");
347
349 users, &brush->id, ptr, prop, N_("Brush"), ICON_BRUSH_DATA, IFACE_("Brush Mask"));
350 }
351}
352
354{
355 /* gather available texture users in context. runs on every draw of
356 * properties editor, before the buttons are created. */
357 ButsContextTexture *ct = static_cast<ButsContextTexture *>(sbuts->texuser);
358 ID *pinid = sbuts->pinid;
359
360 if (!ct) {
361 ct = MEM_cnew<ButsContextTexture>("ButsContextTexture");
362 sbuts->texuser = ct;
363 }
364 else {
366 MEM_delete(user);
367 }
369 }
370
372
373 if (pinid && GS(pinid->name) == ID_TE) {
374 ct->user = nullptr;
375 ct->texture = (Tex *)pinid;
376 }
377 else {
378 /* set one user as active based on active index */
379 if (ct->index >= BLI_listbase_count_at_most(&ct->users, ct->index + 1)) {
380 ct->index = 0;
381 }
382
383 ct->user = static_cast<ButsTextureUser *>(BLI_findlink(&ct->users, ct->index));
384 ct->texture = nullptr;
385
386 if (ct->user) {
387 if (ct->user->node != nullptr) {
388 /* Detect change of active texture node in same node tree, in that
389 * case we also automatically switch to the other node. */
390 if ((ct->user->node->flag & NODE_ACTIVE_TEXTURE) == 0) {
391 LISTBASE_FOREACH (ButsTextureUser *, user, &ct->users) {
392 if (user->ntree == ct->user->ntree && user->node != ct->user->node) {
393 if (user->node->flag & NODE_ACTIVE_TEXTURE) {
394 ct->user = user;
395 ct->index = BLI_findindex(&ct->users, user);
396 break;
397 }
398 }
399 }
400 }
401 }
402 if (ct->user->ptr.data) {
403 PointerRNA texptr;
404 Tex *tex;
405
406 /* Get texture datablock pointer if it's a property. */
407 texptr = RNA_property_pointer_get(&ct->user->ptr, ct->user->prop);
408 tex = RNA_struct_is_a(texptr.type, &RNA_Texture) ? static_cast<Tex *>(texptr.data) :
409 nullptr;
410
411 ct->texture = tex;
412 }
413 }
414 }
415}
416
417static void template_texture_select(bContext *C, void *user_p, void * /*arg*/)
418{
419 /* callback when selecting a texture user in the menu */
421 ButsContextTexture *ct = (sbuts) ? static_cast<ButsContextTexture *>(sbuts->texuser) : nullptr;
422 ButsTextureUser *user = (ButsTextureUser *)user_p;
423 PointerRNA texptr;
424 Tex *tex;
425
426 if (!ct) {
427 return;
428 }
429
430 /* set user as active */
431 if (user->node) {
432 ED_node_set_active(CTX_data_main(C), nullptr, user->ntree, user->node, nullptr);
433 ct->texture = nullptr;
434
435 /* Not totally sure if we should also change selection? */
436 for (bNode *node : user->ntree->all_nodes()) {
438 }
441 }
442 if (user->ptr.data) {
443 texptr = RNA_property_pointer_get(&user->ptr, user->prop);
444 tex = RNA_struct_is_a(texptr.type, &RNA_Texture) ? static_cast<Tex *>(texptr.data) : nullptr;
445
446 ct->texture = tex;
447
448 if (user->ptr.type == &RNA_ParticleSettingsTextureSlot) {
449 /* stupid exception for particle systems which still uses influence
450 * from the old texture system, set the active texture slots as well */
452 int a;
453
454 for (a = 0; a < MAX_MTEX; a++) {
455 if (user->ptr.data == part->mtex[a]) {
456 part->texact = a;
457 }
458 }
459 }
460
461 if (sbuts && tex) {
462 sbuts->preview = 1;
463 }
464 }
465
466 ct->user = user;
467 ct->index = user->index;
468}
469
470static void template_texture_user_menu(bContext *C, uiLayout *layout, void * /*arg*/)
471{
472 /* callback when opening texture user selection menu, to create buttons. */
474 ButsContextTexture *ct = static_cast<ButsContextTexture *>(sbuts->texuser);
475 uiBlock *block = uiLayoutGetBlock(layout);
476 const char *last_category = nullptr;
477
478 LISTBASE_FOREACH (ButsTextureUser *, user, &ct->users) {
479 uiBut *but;
480 char name[UI_MAX_NAME_STR];
481
482 /* add label per category */
483 if (!last_category || !STREQ(last_category, user->category)) {
484 uiItemL(layout, IFACE_(user->category), ICON_NONE);
485 but = static_cast<uiBut *>(block->buttons.last);
487 }
488
489 /* create button */
490 if (user->prop) {
491 PointerRNA texptr = RNA_property_pointer_get(&user->ptr, user->prop);
492 Tex *tex = static_cast<Tex *>(texptr.data);
493
494 if (tex) {
495 SNPRINTF(name, " %s - %s", user->name, tex->id.name + 2);
496 }
497 else {
498 SNPRINTF(name, " %s", user->name);
499 }
500 }
501 else {
502 SNPRINTF(name, " %s", user->name);
503 }
504
505 but = uiDefIconTextBut(block,
507 0,
508 user->icon,
509 name,
510 0,
511 0,
512 UI_UNIT_X * 4,
513 UI_UNIT_Y,
514 nullptr,
515 0.0,
516 0.0,
517 "");
520 MEM_new<ButsTextureUser>("ButsTextureUser", *user),
521 nullptr,
524
525 last_category = user->category;
526 }
527}
528
530{
531 /* Texture user selection drop-down menu. the available users have been
532 * gathered before drawing in #ButsContextTexture, we merely need to
533 * display the current item. */
535 ButsContextTexture *ct = (sbuts) ? static_cast<ButsContextTexture *>(sbuts->texuser) : nullptr;
536 uiBlock *block = uiLayoutGetBlock(layout);
537 uiBut *but;
538 ButsTextureUser *user;
539 char name[UI_MAX_NAME_STR];
540
541 if (!ct) {
542 return;
543 }
544
545 /* get current user */
546 user = ct->user;
547
548 if (!user) {
549 uiItemL(layout, TIP_("No textures in context"), ICON_NONE);
550 return;
551 }
552
553 /* create button */
554 STRNCPY(name, user->name);
555
556 if (user->icon) {
557 but = uiDefIconTextMenuBut(block,
559 nullptr,
560 user->icon,
561 name,
562 0,
563 0,
564 UI_UNIT_X * 4,
565 UI_UNIT_Y,
566 "");
567 }
568 else {
569 but = uiDefMenuBut(
570 block, template_texture_user_menu, nullptr, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, "");
571 }
572
573 /* some cosmetic tweaks */
575
576 but->flag &= ~UI_BUT_ICON_SUBMENU;
577}
578
579/************************* Texture Show **************************/
580
582{
583 bScreen *screen = CTX_wm_screen(C);
585
586 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
587 if (area->spacetype == SPACE_PROPERTIES) {
588 /* Only if unpinned, or if pinned object matches. */
589 SpaceProperties *sbuts = static_cast<SpaceProperties *>(area->spacedata.first);
590 ID *pinid = sbuts->pinid;
591 if (pinid == nullptr || ((GS(pinid->name) == ID_OB) && (Object *)pinid == ob)) {
592 return area;
593 }
594 }
595 }
596
597 return nullptr;
598}
599
601{
602 ScrArea *area = find_area_properties(C);
603 if (area != nullptr) {
604 return static_cast<SpaceProperties *>(area->spacedata.first);
605 }
606
607 return nullptr;
608}
609
610static void template_texture_show(bContext *C, void *data_p, void *prop_p)
611{
612 if (data_p == nullptr || prop_p == nullptr) {
613 return;
614 }
615
616 ScrArea *area = find_area_properties(C);
617 if (area == nullptr) {
618 return;
619 }
620
621 SpaceProperties *sbuts = (SpaceProperties *)area->spacedata.first;
622 ButsContextTexture *ct = (sbuts) ? static_cast<ButsContextTexture *>(sbuts->texuser) : nullptr;
623 if (!ct) {
624 return;
625 }
626
627 ButsTextureUser *user;
628 for (user = static_cast<ButsTextureUser *>(ct->users.first); user; user = user->next) {
629 if (user->ptr.data == data_p && user->prop == prop_p) {
630 break;
631 }
632 }
633
634 if (user) {
635 /* select texture */
636 template_texture_select(C, user, nullptr);
637
638 /* change context */
639 sbuts->mainb = BCONTEXT_TEXTURE;
640 sbuts->mainbuser = sbuts->mainb;
641 sbuts->preview = 1;
642
643 /* redraw editor */
644 ED_area_tag_redraw(area);
645 }
646}
647
649{
650 /* Only show the button if there is actually a texture assigned. */
651 Tex *texture = static_cast<Tex *>(RNA_property_pointer_get(ptr, prop).data);
652 if (texture == nullptr) {
653 return;
654 }
655
656 /* Only show the button if we are not in the Properties Editor's texture tab. */
657 SpaceProperties *sbuts_context = CTX_wm_space_properties(C);
658 if (sbuts_context != nullptr && sbuts_context->mainb == BCONTEXT_TEXTURE) {
659 return;
660 }
661
663 ButsContextTexture *ct = (sbuts) ? static_cast<ButsContextTexture *>(sbuts->texuser) : nullptr;
664
665 /* find corresponding texture user */
666 ButsTextureUser *user;
667 bool user_found = false;
668 if (ct != nullptr) {
669 for (user = static_cast<ButsTextureUser *>(ct->users.first); user; user = user->next) {
670 if (user->ptr.data == ptr->data && user->prop == prop) {
671 user_found = true;
672 break;
673 }
674 }
675 }
676
677 /* Draw button (disabled if we cannot find a Properties Editor to display this in). */
678 uiBlock *block = uiLayoutGetBlock(layout);
679 uiBut *but;
680 but = uiDefIconBut(block,
682 0,
683 ICON_PROPERTIES,
684 0,
685 0,
686 UI_UNIT_X,
687 UI_UNIT_Y,
688 nullptr,
689 0.0,
690 0.0,
691 TIP_("Show texture in texture tab"));
692 UI_but_func_set(but,
694 user_found ? user->ptr.data : nullptr,
695 user_found ? user->prop : nullptr);
696 if (ct == nullptr) {
697 UI_but_disable(but, "No (unpinned) Properties Editor found to display texture in");
698 }
699 else if (!user_found) {
700 UI_but_disable(but, "No texture user found");
701 }
702}
bScreen * CTX_wm_screen(const bContext *C)
SpaceProperties * CTX_wm_space_properties(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_default_view(const Scene *scene)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_active_from_view_layer(struct ViewLayer *view_layer)
Definition linestyle.cc:705
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void BKE_modifiers_foreach_tex_link(Object *ob, TexWalkFunc walk, void *user_data)
#define NODE_GROUP
Definition BKE_node.hh:800
#define NODE_CLASS_TEXTURE
Definition BKE_node.hh:414
Paint * BKE_paint_get_active_from_context(const bContext *C)
Definition paint.cc:477
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:649
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:534
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const struct ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
#define STREQ(a, b)
#define TIP_(msgid)
#define IFACE_(msgid)
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_TE
@ ID_SCE
@ ID_LS
@ ID_BR
@ ID_OB
@ eModifierType_Nodes
@ NODE_ACTIVE_TEXTURE
@ SOCK_UNAVAIL
@ SOCK_TEXTURE
Object is a sort of wrapper for general info.
@ SPACE_PROPERTIES
@ SB_TEX_USER_LIMITED
@ BCONTEXT_TEXTURE
void ED_node_set_active(Main *bmain, SpaceNode *snode, bNodeTree *ntree, bNode *node, bool *r_active_texture_changed)
Definition node_edit.cc:722
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:708
Read Guarded memory(de)allocation.
#define MAX_MTEX
Definition Stroke.h:33
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)
#define UI_UNIT_Y
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, blender::StringRef str, int x, int y, short width, short height, const char *tip)
void uiItemL(uiLayout *layout, const char *name, int icon)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const char *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, const char *tip)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, const char *tip)
#define UI_UNIT_X
@ UI_BTYPE_BUT
#define UI_MAX_NAME_STR
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)
@ UI_BUT_TEXT_LEFT
#define NC_NODE
Definition WM_types.hh:361
#define NA_SELECTED
Definition WM_types.hh:555
static void template_texture_show(bContext *C, void *data_p, void *prop_p)
static void buttons_texture_modifier_foreach(void *user_data, Object *ob, ModifierData *md, const PointerRNA *ptr, PropertyRNA *texture_prop)
void uiTemplateTextureUser(uiLayout *layout, bContext *C)
static void buttons_texture_user_socket_property_add(ListBase *users, ID *id, PointerRNA ptr, PropertyRNA *prop, bNodeTree *ntree, bNode *node, bNodeSocket *socket, const char *category, int icon, const char *name)
static void buttons_texture_user_property_add(ListBase *users, ID *id, PointerRNA ptr, PropertyRNA *prop, const char *category, int icon, const char *name)
static void buttons_texture_user_node_add(ListBase *users, ID *id, bNodeTree *ntree, bNode *node, PointerRNA ptr, PropertyRNA *prop, const char *category, int icon, const char *name)
static ScrArea * find_area_properties(const bContext *C)
static void buttons_texture_modifier_geonodes_users_add(Object *ob, NodesModifierData *nmd, bNodeTree *node_tree, ListBase *users, blender::Set< const bNodeTree * > &handled_groups)
static SpaceProperties * find_space_properties(const bContext *C)
void uiTemplateTextureShow(uiLayout *layout, const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
static void buttons_texture_users_from_context(ListBase *users, const bContext *C, SpaceProperties *sbuts)
void buttons_texture_context_compute(const bContext *C, SpaceProperties *sbuts)
static void template_texture_select(bContext *C, void *user_p, void *)
static void template_texture_user_menu(bContext *C, uiLayout *layout, void *)
static void buttons_texture_users_find_nodetree(ListBase *users, ID *id, bNodeTree *ntree, const char *category)
bool add(const Key &key)
Definition BLI_set.hh:248
OperationNode * node
FreestyleLineStyle linestyle
int users
#define GS(x)
Definition iris.cc:202
bool node_set_selected(bNode *node, bool select)
Definition node.cc:3863
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_struct_ui_icon(const StructRNA *type)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
struct MTex mtex
struct MTex mask_mtex
struct ButsTextureUser * user
const char * category
ButsTextureUser * next
bNodeTree * ntree
const char * name
bNodeSocket * socket
PropertyRNA * prop
struct bNodeTree * nodetree
Definition DNA_ID.h:413
char name[66]
Definition DNA_ID.h:425
void * last
void * first
struct bNodeTree * node_group
struct PartDeflect * pd
struct MTex * mtex[18]
ParticleSettings * part
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
const char * name
ListBase nodes
ListBase buttons
struct Scene * scene
#define N_(msgid)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)