42#include "RNA_prototypes.hh"
116 const char *category,
138 const char *category)
142 if (node->type == CMP_NODE_TEXTURE) {
160 else if (node->type ==
NODE_GROUP && node->id) {
178 if (handled_groups.
add(
reinterpret_cast<bNodeTree *
>(node->id))) {
196 if (
tex !=
nullptr) {
204 N_(
"Geometry Nodes"),
239 Scene *scene =
nullptr;
242 Brush *brush =
nullptr;
249 scene = (
Scene *)pinid;
255 brush = (
Brush *)pinid;
267 if (!pinid || id_type ==
ID_SCE) {
281 if (scene && scene->nodetree) {
299 if (psys && !limited_mode) {
307 &psys->
part->
id, &RNA_ParticleSettingsTextureSlot, mtex);
329 users, &ob->
id,
ptr, prop,
N_(
"Fields"), ICON_FORCE_TEXTURE,
IFACE_(
"Texture Field"));
361 ct = MEM_cnew<ButsContextTexture>(
"ButsContextTexture");
436 for (
bNode *node : user->
ntree->all_nodes()) {
448 if (user->
ptr.
type == &RNA_ParticleSettingsTextureSlot) {
455 if (user->
ptr.
data == part->mtex[a]) {
476 const char *last_category =
nullptr;
483 if (!last_category || !
STREQ(last_category, user->category)) {
520 MEM_new<ButsTextureUser>(
"ButsTextureUser", *user),
525 last_category = user->category;
549 uiItemL(layout,
TIP_(
"No textures in context"), ICON_NONE);
576 but->
flag &= ~UI_BUT_ICON_SUBMENU;
603 if (area !=
nullptr) {
612 if (data_p ==
nullptr || prop_p ==
nullptr) {
617 if (area ==
nullptr) {
629 if (user->
ptr.
data == data_p && user->
prop == prop_p) {
652 if (texture ==
nullptr) {
667 bool user_found =
false;
691 TIP_(
"Show texture in texture tab"));
694 user_found ? user->
ptr.
data :
nullptr,
695 user_found ? user->
prop :
nullptr);
697 UI_but_disable(but,
"No (unpinned) Properties Editor found to display texture in");
699 else if (!user_found) {
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)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void BKE_modifiers_foreach_tex_link(Object *ob, TexWalkFunc walk, void *user_data)
#define NODE_CLASS_TEXTURE
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
struct ParticleSystem * psys_get_current(struct Object *ob)
#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)
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)
#define SNPRINTF(dst, format,...)
ID and Library types, which are fundamental for SDNA.
Object is a sort of wrapper for general info.
void ED_node_set_active(Main *bmain, SpaceNode *snode, bNodeTree *ntree, bNode *node, bool *r_active_texture_changed)
void ED_area_tag_redraw(ScrArea *area)
Read Guarded memory(de)allocation.
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)
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)
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)
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)
FreestyleLineStyle linestyle
bool node_set_selected(bNode *node, bool select)
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 ButsTextureUser * user
struct bNodeTree * nodetree
struct bNodeTree * node_group
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)