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