39 std::string
string = std::string((node_storage->
string) ? node_storage->
string :
"");
46 storage->textbox_state.visible_lines = 1;
56 if (
storage->string !=
nullptr) {
66 MEM_dupalloc(source_storage));
68 if (source_storage->
string) {
69 destination_storage->
string = MEM_dupalloc(source_storage->
string);
71 dest_node->
storage = destination_storage;
97 bNode &
node = params.add_node(
"FunctionNodeInputString"_ustr);
98 params.update_and_connect_available_socket(
node,
"String"_ustr);
104 const float width =
BLF_width(fstyle.
uifont_id,
string.data(),
string.size()) + 40.0f;
105 node.width = std::clamp(width, 140.0f, 1000.0f);
115 ntype.
ui_description =
"Provide a string value that can be connected to other nodes in the tree";
#define FN_NODE_INPUT_STRING
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeSocket & other_socket() const
void construct_and_set_matching_fn(Args &&...args)
#define storage(slot, qualifiers)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
const uiStyle * style_get()
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void BLF_size(int fontid, float size)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void write_string(const char *data)
NodeBlendWriteFunction blend_write_storage_content
std::string ui_description
NodeBlendDataReadFunction blend_data_read_storage_content
NodeMultiFunctionBuildFunction build_multi_function
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void alignment_set(LayoutAlign alignment)
void textbox_with_state(PointerRNA *ptr, StringRefNull propname, TextboxState *textbox_state, std::optional< StringRefNull > name_opt=std::nullopt, std::optional< StringRefNull > placeholder=std::nullopt)