44#include "RNA_prototypes.hh"
118 const char *category,
140 const char *category)
152 const char *category)
155 for (
bNode *node : ntree->all_nodes()) {
168 else if (node->is_group() && node->id) {
184 for (
bNode *node : node_tree->all_nodes()) {
185 if (node->is_group() && node->id) {
186 if (handled_groups.
add(
reinterpret_cast<bNodeTree *
>(node->id))) {
204 if (tex !=
nullptr) {
212 N_(
"Geometry Nodes"),
247 Scene *scene =
nullptr;
250 Brush *brush =
nullptr;
257 scene = (
Scene *)pinid;
263 brush =
reinterpret_cast<Brush *
>(pinid);
275 if (!pinid || id_type ==
ID_SCE) {
294 if (linestyle && !limited_mode) {
313 if (psys && !limited_mode) {
321 &psys->
part->
id, &RNA_ParticleSettingsTextureSlot, mtex);
343 users, &ob->
id,
ptr, prop,
N_(
"Fields"), ICON_FORCE_TEXTURE,
IFACE_(
"Texture Field"));
450 for (
bNode *node : user->
ntree->all_nodes()) {
462 if (user->
ptr.
type == &RNA_ParticleSettingsTextureSlot) {
490 const char *last_category =
nullptr;
497 if (!last_category || !
STREQ(last_category, user->category)) {
520 block,
ButType::But, 0, user->icon,
name, 0, 0,
UI_UNIT_X * 4,
UI_UNIT_Y,
nullptr,
"");
523 MEM_new<ButsTextureUser>(
"ButsTextureUser", *user),
528 last_category = user->category;
552 layout->
label(
TIP_(
"No textures in context"), ICON_NONE);
606 if (area !=
nullptr) {
615 if (data_p ==
nullptr || prop_p ==
nullptr) {
620 if (area ==
nullptr) {
632 if (user->
ptr.
data == data_p && user->
prop == prop_p) {
670 bool user_found =
false;
694 TIP_(
"Show texture in texture tab"));
697 user_found ? user->
ptr.
data :
nullptr,
698 user_found ? user->
prop :
nullptr);
700 UI_but_disable(but,
"No (unpinned) Properties Editor found to display texture in");
702 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)
const char * BKE_id_name(const ID &id)
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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
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 * uiDefIconTextBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, std::optional< blender::StringRef > tip)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefIconBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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_but_type_set_menu_from_pulldown(uiBut *but)
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_mtex_add(ListBase *users, ID *id, MTex *mtex, const char *category)
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)
const T & last(const int64_t n=0) const
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
void * MEM_callocN(size_t len, const char *str)
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_discrete(ID *id, StructRNA *type, void *data)
struct ButsTextureUser * user
struct bNodeTree * nodetree
struct bNodeTree * node_group
struct bNodeTree * compositing_node_group
blender::Vector< std::unique_ptr< uiBut > > buttons
void label(blender::StringRef name, int icon)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)