Blender  V2.93
buttons_texture.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <stdlib.h>
25 #include <string.h>
26 
27 #include "MEM_guardedalloc.h"
28 
29 #include "BLI_listbase.h"
30 #include "BLI_string.h"
31 #include "BLI_utildefines.h"
32 
33 #include "BLT_translation.h"
34 
35 #include "DNA_ID.h"
36 #include "DNA_brush_types.h"
37 #include "DNA_linestyle_types.h"
38 #include "DNA_node_types.h"
39 #include "DNA_object_force_types.h"
40 #include "DNA_object_types.h"
41 #include "DNA_particle_types.h"
42 #include "DNA_scene_types.h"
43 #include "DNA_screen_types.h"
44 #include "DNA_space_types.h"
46 
47 #include "BKE_context.h"
48 #include "BKE_gpencil_modifier.h"
49 #include "BKE_layer.h"
50 #include "BKE_linestyle.h"
51 #include "BKE_modifier.h"
52 #include "BKE_node.h"
53 #include "BKE_paint.h"
54 #include "BKE_particle.h"
55 #ifdef WITH_FREESTYLE
56 #endif
57 
58 #include "RNA_access.h"
59 
60 #include "UI_interface.h"
61 #include "UI_resources.h"
62 
63 #include "ED_node.h"
64 #include "ED_screen.h"
65 
66 #include "WM_api.h"
67 #include "WM_types.h"
68 
69 #include "../interface/interface_intern.h"
70 
71 #include "buttons_intern.h" /* own include */
72 
73 static ScrArea *find_area_properties(const bContext *C);
75 
76 /************************* Texture User **************************/
77 
79  ID *id,
81  PropertyRNA *prop,
83  bNode *node,
84  const char *category,
85  int icon,
86  const char *name)
87 {
88  ButsTextureUser *user = MEM_callocN(sizeof(ButsTextureUser), "ButsTextureUser");
89 
90  user->id = id;
91  user->ptr = ptr;
92  user->prop = prop;
93  user->ntree = ntree;
94  user->node = node;
95  user->category = category;
96  user->icon = icon;
97  user->name = name;
99 
100  BLI_addtail(users, user);
101 }
102 
104  ID *id,
105  PointerRNA ptr,
106  PropertyRNA *prop,
107  const char *category,
108  int icon,
109  const char *name)
110 {
111  ButsTextureUser *user = MEM_callocN(sizeof(ButsTextureUser), "ButsTextureUser");
112 
113  user->id = id;
114  user->ptr = ptr;
115  user->prop = prop;
116  user->category = category;
117  user->icon = icon;
118  user->name = name;
119  user->index = BLI_listbase_count(users);
120 
121  BLI_addtail(users, user);
122 }
123 
125  ID *id,
126  bNodeTree *ntree,
127  bNode *node,
128  const char *category,
129  int icon,
130  const char *name)
131 {
132  ButsTextureUser *user = MEM_callocN(sizeof(ButsTextureUser), "ButsTextureUser");
133 
134  user->id = id;
135  user->ntree = ntree;
136  user->node = node;
137  user->category = category;
138  user->icon = icon;
139  user->name = name;
140  user->index = BLI_listbase_count(users);
141 
142  BLI_addtail(users, user);
143 }
144 
146  ID *id,
147  bNodeTree *ntree,
148  const char *category)
149 {
150  bNode *node;
151 
152  if (ntree) {
153  for (node = ntree->nodes.first; node; node = node->next) {
154  if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
155  PointerRNA ptr;
156  /* PropertyRNA *prop; */ /* UNUSED */
157 
159  /* prop = RNA_struct_find_property(&ptr, "texture"); */ /* UNUSED */
160 
162  users, id, ntree, node, category, RNA_struct_ui_icon(ptr.type), node->name);
163  }
164  else if (node->type == NODE_GROUP && node->id) {
166  }
167  }
168  }
169 }
170 
172  NodesModifierData *nmd,
174  ListBase *users)
175 {
176  PointerRNA ptr;
177  PropertyRNA *prop;
178 
179  LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
180  if (node->type == NODE_GROUP && node->id) {
181  /* Recurse into the node group */
183  }
184  else if (node->type == GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE) {
186  prop = RNA_struct_find_property(&ptr, "texture");
187  if (prop == NULL) {
188  continue;
189  }
190 
191  PointerRNA texptr = RNA_property_pointer_get(&ptr, prop);
192  Tex *tex = (RNA_struct_is_a(texptr.type, &RNA_Texture)) ? (Tex *)texptr.data : NULL;
193  if (tex != NULL) {
195  &ob->id,
196  ptr,
197  prop,
198  node_tree,
199  node,
200  N_("Geometry Nodes"),
202  nmd->modifier.name);
203  }
204  }
205  }
206 }
207 
208 static void buttons_texture_modifier_foreach(void *userData,
209  Object *ob,
210  ModifierData *md,
211  const char *propname)
212 {
213  ListBase *users = userData;
214 
215  if (md->type == eModifierType_Nodes) {
217  if (nmd->node_group != NULL) {
219  }
220  }
221  else {
222  PointerRNA ptr;
223  PropertyRNA *prop;
224 
225  RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr);
226  prop = RNA_struct_find_property(&ptr, propname);
227 
229  users, &ob->id, ptr, prop, N_("Modifiers"), RNA_struct_ui_icon(ptr.type), md->name);
230  }
231 }
232 
233 static void buttons_texture_modifier_gpencil_foreach(void *userData,
234  Object *ob,
236  const char *propname)
237 {
238  PointerRNA ptr;
239  PropertyRNA *prop;
240  ListBase *users = userData;
241 
243  prop = RNA_struct_find_property(&ptr, propname);
244 
246  &ob->id,
247  ptr,
248  prop,
249  N_("Grease Pencil Modifiers"),
251  md->name);
252 }
253 
255  const bContext *C,
256  SpaceProperties *sbuts)
257 {
258  Scene *scene = NULL;
259  Object *ob = NULL;
261  Brush *brush = NULL;
262  ID *pinid = sbuts->pinid;
263  bool limited_mode = (sbuts->flag & SB_TEX_USER_LIMITED) != 0;
264 
265  /* get data from context */
266  if (pinid) {
267  if (GS(pinid->name) == ID_SCE) {
268  scene = (Scene *)pinid;
269  }
270  else if (GS(pinid->name) == ID_OB) {
271  ob = (Object *)pinid;
272  }
273  else if (GS(pinid->name) == ID_BR) {
274  brush = (Brush *)pinid;
275  }
276  else if (GS(pinid->name) == ID_LS) {
277  linestyle = (FreestyleLineStyle *)pinid;
278  }
279  }
280 
281  if (!scene) {
283  }
284 
285  const ID_Type id_type = pinid != NULL ? GS(pinid->name) : -1;
286  if (!pinid || id_type == ID_SCE) {
287  wmWindow *win = CTX_wm_window(C);
288  ViewLayer *view_layer = (win->scene == scene) ? WM_window_get_active_view_layer(win) :
290 
293  ob = OBACT(view_layer);
294  }
295 
296  /* fill users */
298 
299  if (linestyle && !limited_mode) {
301  users, &linestyle->id, linestyle->nodetree, N_("Line Style"));
302  }
303 
304  if (ob) {
305  ParticleSystem *psys = psys_get_current(ob);
306  MTex *mtex;
307  int a;
308 
309  /* modifiers */
311 
312  /* grease pencil modifiers */
314 
315  /* particle systems */
316  if (psys && !limited_mode) {
317  for (a = 0; a < MAX_MTEX; a++) {
318  mtex = psys->part->mtex[a];
319 
320  if (mtex) {
321  PointerRNA ptr;
322  PropertyRNA *prop;
323 
325  prop = RNA_struct_find_property(&ptr, "texture");
326 
328  &psys->part->id,
329  ptr,
330  prop,
331  N_("Particles"),
333  psys->name);
334  }
335  }
336  }
337 
338  /* field */
339  if (ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
340  PointerRNA ptr;
341  PropertyRNA *prop;
342 
344  prop = RNA_struct_find_property(&ptr, "texture");
345 
347  users, &ob->id, ptr, prop, N_("Fields"), ICON_FORCE_TEXTURE, IFACE_("Texture Field"));
348  }
349  }
350 
351  /* brush */
352  if (brush) {
353  PointerRNA ptr;
354  PropertyRNA *prop;
355 
356  /* texture */
357  RNA_pointer_create(&brush->id, &RNA_BrushTextureSlot, &brush->mtex, &ptr);
358  prop = RNA_struct_find_property(&ptr, "texture");
359 
361  users, &brush->id, ptr, prop, N_("Brush"), ICON_BRUSH_DATA, IFACE_("Brush"));
362 
363  /* mask texture */
365  prop = RNA_struct_find_property(&ptr, "texture");
366 
368  users, &brush->id, ptr, prop, N_("Brush"), ICON_BRUSH_DATA, IFACE_("Brush Mask"));
369  }
370 }
371 
373 {
374  /* gather available texture users in context. runs on every draw of
375  * properties editor, before the buttons are created. */
376  ButsContextTexture *ct = sbuts->texuser;
377  ID *pinid = sbuts->pinid;
378 
379  if (!ct) {
380  ct = MEM_callocN(sizeof(ButsContextTexture), "ButsContextTexture");
381  sbuts->texuser = ct;
382  }
383  else {
384  BLI_freelistN(&ct->users);
385  }
386 
388 
389  if (pinid && GS(pinid->name) == ID_TE) {
390  ct->user = NULL;
391  ct->texture = (Tex *)pinid;
392  }
393  else {
394  /* set one user as active based on active index */
395  if (ct->index >= BLI_listbase_count_at_most(&ct->users, ct->index + 1)) {
396  ct->index = 0;
397  }
398 
399  ct->user = BLI_findlink(&ct->users, ct->index);
400  ct->texture = NULL;
401 
402  if (ct->user) {
403  if (ct->user->node != NULL) {
404  /* Detect change of active texture node in same node tree, in that
405  * case we also automatically switch to the other node. */
406  if ((ct->user->node->flag & NODE_ACTIVE_TEXTURE) == 0) {
407  ButsTextureUser *user;
408  for (user = ct->users.first; user; user = user->next) {
409  if (user->ntree == ct->user->ntree && user->node != ct->user->node) {
410  if (user->node->flag & NODE_ACTIVE_TEXTURE) {
411  ct->user = user;
412  ct->index = BLI_findindex(&ct->users, user);
413  break;
414  }
415  }
416  }
417  }
418  }
419  if (ct->user->ptr.data) {
420  PointerRNA texptr;
421  Tex *tex;
422 
423  /* Get texture datablock pointer if it's a property. */
424  texptr = RNA_property_pointer_get(&ct->user->ptr, ct->user->prop);
425  tex = (RNA_struct_is_a(texptr.type, &RNA_Texture)) ? texptr.data : NULL;
426 
427  ct->texture = tex;
428  }
429  }
430  }
431 }
432 
433 static void template_texture_select(bContext *C, void *user_p, void *UNUSED(arg))
434 {
435  /* callback when selecting a texture user in the menu */
437  ButsContextTexture *ct = (sbuts) ? sbuts->texuser : NULL;
438  ButsTextureUser *user = (ButsTextureUser *)user_p;
439  PointerRNA texptr;
440  Tex *tex;
441 
442  if (!ct) {
443  return;
444  }
445 
446  /* set user as active */
447  if (user->node) {
448  ED_node_set_active(CTX_data_main(C), user->ntree, user->node, NULL);
449  ct->texture = NULL;
450 
451  /* Not totally sure if we should also change selection? */
452  LISTBASE_FOREACH (bNode *, node, &user->ntree->nodes) {
453  nodeSetSelected(node, false);
454  }
455  nodeSetSelected(user->node, true);
457  }
458  if (user->ptr.data) {
459  texptr = RNA_property_pointer_get(&user->ptr, user->prop);
460  tex = (RNA_struct_is_a(texptr.type, &RNA_Texture)) ? texptr.data : NULL;
461 
462  ct->texture = tex;
463 
464  if (user->ptr.type == &RNA_ParticleSettingsTextureSlot) {
465  /* stupid exception for particle systems which still uses influence
466  * from the old texture system, set the active texture slots as well */
467  ParticleSettings *part = (ParticleSettings *)user->ptr.owner_id;
468  int a;
469 
470  for (a = 0; a < MAX_MTEX; a++) {
471  if (user->ptr.data == part->mtex[a]) {
472  part->texact = a;
473  }
474  }
475  }
476 
477  if (sbuts && tex) {
478  sbuts->preview = 1;
479  }
480  }
481 
482  ct->user = user;
483  ct->index = user->index;
484 }
485 
486 static void template_texture_user_menu(bContext *C, uiLayout *layout, void *UNUSED(arg))
487 {
488  /* callback when opening texture user selection menu, to create buttons. */
490  ButsContextTexture *ct = sbuts->texuser;
491  ButsTextureUser *user;
492  uiBlock *block = uiLayoutGetBlock(layout);
493  const char *last_category = NULL;
494 
495  for (user = ct->users.first; user; user = user->next) {
496  uiBut *but;
497  char name[UI_MAX_NAME_STR];
498 
499  /* add label per category */
500  if (!last_category || !STREQ(last_category, user->category)) {
501  uiItemL(layout, IFACE_(user->category), ICON_NONE);
502  but = block->buttons.last;
503  but->drawflag = UI_BUT_TEXT_LEFT;
504  }
505 
506  /* create button */
507  if (user->prop) {
508  PointerRNA texptr = RNA_property_pointer_get(&user->ptr, user->prop);
509  Tex *tex = texptr.data;
510 
511  if (tex) {
512  BLI_snprintf(name, UI_MAX_NAME_STR, " %s - %s", user->name, tex->id.name + 2);
513  }
514  else {
515  BLI_snprintf(name, UI_MAX_NAME_STR, " %s", user->name);
516  }
517  }
518  else {
519  BLI_snprintf(name, UI_MAX_NAME_STR, " %s", user->name);
520  }
521 
522  but = uiDefIconTextBut(block,
523  UI_BTYPE_BUT,
524  0,
525  user->icon,
526  name,
527  0,
528  0,
529  UI_UNIT_X * 4,
530  UI_UNIT_Y,
531  NULL,
532  0.0,
533  0.0,
534  0.0,
535  0.0,
536  "");
538 
539  last_category = user->category;
540  }
541 
543 }
544 
546 {
547  /* Texture user selection drop-down menu. the available users have been
548  * gathered before drawing in #ButsContextTexture, we merely need to
549  * display the current item. */
551  ButsContextTexture *ct = (sbuts) ? sbuts->texuser : NULL;
552  uiBlock *block = uiLayoutGetBlock(layout);
553  uiBut *but;
554  ButsTextureUser *user;
555  char name[UI_MAX_NAME_STR];
556 
557  if (!ct) {
558  return;
559  }
560 
561  /* get current user */
562  user = ct->user;
563 
564  if (!user) {
565  uiItemL(layout, TIP_("No textures in context"), ICON_NONE);
566  return;
567  }
568 
569  /* create button */
570  BLI_strncpy(name, user->name, UI_MAX_NAME_STR);
571 
572  if (user->icon) {
573  but = uiDefIconTextMenuBut(block,
575  NULL,
576  user->icon,
577  name,
578  0,
579  0,
580  UI_UNIT_X * 4,
581  UI_UNIT_Y,
582  "");
583  }
584  else {
585  but = uiDefMenuBut(
586  block, template_texture_user_menu, NULL, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, "");
587  }
588 
589  /* some cosmetic tweaks */
591 
592  but->flag &= ~UI_BUT_ICON_SUBMENU;
593 }
594 
595 /************************* Texture Show **************************/
596 
598 {
599  bScreen *screen = CTX_wm_screen(C);
601 
602  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
603  if (area->spacetype == SPACE_PROPERTIES) {
604  /* Only if unpinned, or if pinned object matches. */
605  SpaceProperties *sbuts = area->spacedata.first;
606  ID *pinid = sbuts->pinid;
607  if (pinid == NULL || ((GS(pinid->name) == ID_OB) && (Object *)pinid == ob)) {
608  return area;
609  }
610  }
611  }
612 
613  return NULL;
614 }
615 
617 {
619  if (area != NULL) {
620  return area->spacedata.first;
621  }
622 
623  return NULL;
624 }
625 
626 static void template_texture_show(bContext *C, void *data_p, void *prop_p)
627 {
628  if (data_p == NULL || prop_p == NULL) {
629  return;
630  }
631 
633  if (area == NULL) {
634  return;
635  }
636 
637  SpaceProperties *sbuts = (SpaceProperties *)area->spacedata.first;
638  ButsContextTexture *ct = (sbuts) ? sbuts->texuser : NULL;
639  if (!ct) {
640  return;
641  }
642 
643  ButsTextureUser *user;
644  for (user = ct->users.first; user; user = user->next) {
645  if (user->ptr.data == data_p && user->prop == prop_p) {
646  break;
647  }
648  }
649 
650  if (user) {
651  /* select texture */
653 
654  /* change context */
655  sbuts->mainb = BCONTEXT_TEXTURE;
656  sbuts->mainbuser = sbuts->mainb;
657  sbuts->preview = 1;
658 
659  /* redraw editor */
661  }
662 }
663 
664 /* Button to quickly show texture in Properties Editor texture tab. */
666 {
667  /* Only show the button if there is actually a texture assigned. */
669  if (texture == NULL) {
670  return;
671  }
672 
673  /* Only show the button if we are not in the Properties Editor's texture tab. */
674  SpaceProperties *sbuts_context = CTX_wm_space_properties(C);
675  if (sbuts_context != NULL && sbuts_context->mainb == BCONTEXT_TEXTURE) {
676  return;
677  }
678 
680  ButsContextTexture *ct = (sbuts) ? sbuts->texuser : NULL;
681 
682  /* find corresponding texture user */
683  ButsTextureUser *user;
684  bool user_found = false;
685  if (ct != NULL) {
686  for (user = ct->users.first; user; user = user->next) {
687  if (user->ptr.data == ptr->data && user->prop == prop) {
688  user_found = true;
689  break;
690  }
691  }
692  }
693 
694  /* Draw button (disabled if we cannot find a Properties Editor to display this in). */
695  uiBlock *block = uiLayoutGetBlock(layout);
696  uiBut *but;
697  but = uiDefIconBut(block,
698  UI_BTYPE_BUT,
699  0,
700  ICON_PROPERTIES,
701  0,
702  0,
703  UI_UNIT_X,
704  UI_UNIT_Y,
705  NULL,
706  0.0,
707  0.0,
708  0.0,
709  0.0,
710  TIP_("Show texture in texture tab"));
711  UI_but_func_set(but,
713  user_found ? user->ptr.data : NULL,
714  user_found ? user->prop : NULL);
715  if (ct == NULL) {
716  UI_but_disable(but, TIP_("No (unpinned) Properties Editor found to display texture in"));
717  }
718  else if (!user_found) {
719  UI_but_disable(but, TIP_("No texture user found"));
720  }
721 }
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct SpaceProperties * CTX_wm_space_properties(const bContext *C)
Definition: context.c:809
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
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:818
void BKE_modifiers_foreach_tex_link(struct Object *ob, TexWalkFunc walk, void *userData)
void nodeSetSelected(struct bNode *node, bool select)
Definition: node.cc:3664
#define NODE_CLASS_TEXTURE
Definition: BKE_node.h:346
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:604
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition: particle.c:645
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:128
int BLI_listbase_count_at_most(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
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)
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define UNUSED(x)
#define STREQ(a, b)
#define TIP_(msgid)
#define IFACE_(msgid)
#define N_(msgid)
ID and Library types, which are fundamental for sdna.
ID_Type
Definition: DNA_ID_enums.h:56
@ ID_TE
Definition: DNA_ID_enums.h:64
@ ID_SCE
Definition: DNA_ID_enums.h:57
@ ID_LS
Definition: DNA_ID_enums.h:87
@ ID_BR
Definition: DNA_ID_enums.h:81
@ ID_OB
Definition: DNA_ID_enums.h:59
@ eModifierType_Nodes
#define NODE_ACTIVE_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 bNodeTree *ntree, struct bNode *node, bool *r_active_texture_changed)
Definition: node_edit.c:665
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:745
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute Attribute Attribute Color Attribute Attribute Vector Point GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE
NODE_GROUP
StructRNA RNA_Node
StructRNA RNA_Modifier
StructRNA RNA_FieldSettings
StructRNA RNA_BrushTextureSlot
StructRNA RNA_ParticleSettingsTextureSlot
StructRNA RNA_Texture
StructRNA RNA_GpencilModifier
StructRNA RNA_ParticleSettings
#define C
Definition: RandGen.cpp:39
#define MAX_MTEX
Definition: Stroke.h:45
void UI_but_disable(uiBut *but, const char *disabled_hint)
Definition: interface.c:6102
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.c:5603
#define UI_UNIT_Y
uiBlock * uiLayoutGetBlock(uiLayout *layout)
@ UI_BUT_TEXT_LEFT
Definition: UI_interface.h:259
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.c:6410
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.c:5223
@ UI_BUT_ICON_SUBMENU
Definition: UI_interface.h:192
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
Definition: interface.c:6114
@ UI_BLOCK_NO_FLIP
Definition: UI_interface.h:142
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
Definition: interface.c:6294
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
Definition: interface.c:6393
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
Definition: interface.c:6301
#define UI_UNIT_X
void UI_block_flag_enable(uiBlock *block, int flag)
Definition: interface.c:6067
@ UI_BTYPE_BUT
Definition: UI_interface.h:334
#define UI_MAX_NAME_STR
Definition: UI_interface.h:91
#define NC_NODE
Definition: WM_types.h:295
#define NA_SELECTED
Definition: WM_types.h:467
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_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_user_node_property_add(ListBase *users, ID *id, PointerRNA ptr, PropertyRNA *prop, bNodeTree *ntree, bNode *node, const char *category, int icon, const char *name)
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:90
bNodeTree * ntree
#define GS(x)
Definition: iris.c:241
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:42
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static unsigned a[3]
Definition: RandGen.cpp:92
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:844
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3641
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
int RNA_struct_ui_icon(const StructRNA *type)
Definition: rna_access.c:738
struct MTex mtex
struct MTex mask_mtex
struct ButsTextureUser * user
struct Tex * texture
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:273
char name[66]
Definition: DNA_ID.h:283
void * last
Definition: DNA_listBase.h:47
void * first
Definition: DNA_listBase.h:47
struct bNodeTree * node_group
struct PartDeflect * pd
struct MTex * mtex[18]
ParticleSettings * part
struct StructRNA * type
Definition: RNA_types.h:51
void * data
Definition: RNA_types.h:52
ListBase nodes
ListBase areabase
ListBase buttons
struct Scene * scene
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2286