32#include <fmt/format.h>
59 if (node_tree ==
nullptr) {
63 const bNode *node = node_tree->node_by_id(
data.node_id);
64 if (node ==
nullptr) {
72 const ContextualGeoTreeLogs tree_logs = GeoNodesLog::get_contextual_tree_logs(*snode);
76 GeoTreeLog *tree_log = tree_logs.get_main_tree_log(*node);
80 tree_log->ensure_socket_values();
81 GeoNodeLog *node_log = tree_log->nodes.lookup_ptr(node->
identifier);
82 if (node_log ==
nullptr) {
87 for (
const bNodeSocket *input_socket : node->input_sockets()) {
91 const ValueLog *value_log = tree_log->find_socket_value_log(*input_socket);
92 if (value_log ==
nullptr) {
96 if (
const std::optional<GeometryInfoLog::VolumeInfo> &volume_info =
geo_log->volume_info) {
110 const char *
name =
nullptr;
117 std::string
text = fmt::format(
123 const bool can_create_grid,
128 static std::string dummy_str;
131 if (!
str.is_empty()) {
132 bool contained =
false;
134 if (info->name ==
str) {
141 &seach_items,
str, &dummy_str, can_create_grid ? ICON_ADD : ICON_NONE, 0, 0);
145 if (
str.is_empty() && !is_first) {
158 search.
add(info->name, info);
189 std::string *item =
static_cast<std::string *
>(item_v);
190 if (item ==
nullptr) {
199 if (node_tree ==
nullptr) {
204 bNode *node = node_tree->node_by_id(
data->node_id);
205 if (node ==
nullptr) {
211 if (socket ==
nullptr) {
248 data->can_create_grid = node.is_type(
"GeometryNodeStoreNamedGrid");
256 static_cast<void *
>(
data),
SpaceNode * CTX_wm_space_node(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
#define BLI_assert_unreachable()
#define BLI_STATIC_ASSERT(a, msg)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_undo_push(bContext *C, const char *str)
void UI_but_placeholder_set(uiBut *but, blender::StringRef placeholder_text)
void UI_but_func_search_set_results_are_suggestions(uiBut *but, bool value)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
bool UI_search_item_add(uiSearchItems *items, blender::StringRef name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
uiBut * uiDefIconTextButR(uiBlock *block, ButType type, int retval, int icon, std::optional< blender::StringRefNull > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, std::optional< blender::StringRef > tip)
void append(const T &value)
void add(const StringRef str, T *user_data, const int weight=0)
Vector< T * > query(const StringRef query) const
void * MEM_callocN(size_t len, const char *str)
bNodeSocket * node_find_enabled_input_socket(bNode &node, StringRef name)
static void grid_search_update_fn(const bContext *C, void *arg, const char *str, uiSearchItems *items, const bool is_first)
static void grid_search_exec_fn(bContext *C, void *data_v, void *item_v)
NodeLinkData data[NODELINK_GROUP_SIZE]
static StringRef grid_data_type_string(const VolumeGridType type)
static bool grid_search_item_add(uiSearchItems &items, const VolumeGridInfo &item)
static void volume_grid_search_add_items(const StringRef str, const bool can_create_grid, const Span< const VolumeGridInfo * > grids, uiSearchItems &seach_items, const bool is_first)
static Vector< const VolumeGridInfo * > get_grid_names_from_context(const bContext &C, GridSearchData &data)
void node_geometry_add_volume_grid_search_button(const bContext &, const bNode &node, PointerRNA &socket_ptr, uiLayout &layout, const StringRef placeholder)
bool RNA_enum_name_from_value(const EnumPropertyItem *item, int value, const char **r_name)
const EnumPropertyItem rna_enum_volume_grid_data_type_items[]
#define UI_MENU_ARROW_SEP
struct bNodeTree * edittree
char socket_identifier[MAX_NAME]