Blender V5.3
node_geo_viewer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include <fmt/format.h>
6
7#include "BKE_context.hh"
8#include "BKE_lib_id.hh"
10
11#include "BLO_read_write.hh"
12
14#include "DNA_image_types.h"
15#include "DNA_modifier_types.h"
16#include "DNA_object_types.h"
17#include "DNA_sound_types.h"
18#include "DNA_vfont_types.h"
19
20#include "NOD_geo_viewer.hh"
26
28#include "UI_resources.hh"
29
30#include "ED_node.hh"
31#include "ED_outliner.hh"
32#include "ED_viewer_path.hh"
33
34#include "RNA_enum_types.hh"
35#include "RNA_prototypes.hh"
36
38
40
41#include "node_geometry_util.hh"
42
43namespace blender {
44
46
48
49static void draw_float(ui::Layout &layout, const float value)
50{
51 const std::string label = fmt::format("{:.5f}", value);
52 layout.label(label, ICON_NONE);
53}
54static void draw_int(ui::Layout &layout, const int value)
55{
56 const std::string label = fmt::format("{}", value);
57 layout.label(label, ICON_NONE);
58}
59static void draw_bool(ui::Layout &layout, const bool value)
60{
61 layout.label(value ? IFACE_("True") : IFACE_("False"), ICON_NONE);
62}
63static void draw_vector(ui::Layout &layout, const float3 &value)
64{
65 ui::Layout &col = layout.column(true);
66 col.label(fmt::format("{}: {:.5f}", IFACE_("X"), value.x), ICON_NONE);
67 col.label(fmt::format("{}: {:.5f}", IFACE_("Y"), value.y), ICON_NONE);
68 col.label(fmt::format("{}: {:.5f}", IFACE_("Z"), value.z), ICON_NONE);
69}
70static void draw_color(ui::Layout &layout, const ColorGeometry4f &value)
71{
72 ui::Layout &col = layout.column(true);
73 col.label(fmt::format("{}: {:.5f}", CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "R"), value.r), ICON_NONE);
74 col.label(fmt::format("{}: {:.5f}", CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "G"), value.g), ICON_NONE);
75 col.label(fmt::format("{}: {:.5f}", CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "B"), value.b), ICON_NONE);
76 col.label(fmt::format("{}: {:.5f}", CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "A"), value.a), ICON_NONE);
77}
78static void draw_string(ui::Layout &layout, const StringRef value)
79{
80 /* The node doesn't get wider than that anyway. */
81 const int max_display_length = 200;
82 layout.label(value.substr(0, max_display_length), ICON_NONE);
83}
84
86{
87 layout.label(IFACE_("(None)"), ICON_NONE);
88}
89
90static void draw_data_block(ui::Layout &layout, const ID *id)
91{
92 if (!id) {
94 return;
95 }
96 const int icon = ED_outliner_icon_from_id(*id);
97 layout.label(BKE_id_name(*id), icon);
98}
99
100static bool draw_gpointer(CustomSocketDrawParams &params, const GPointer value)
101{
102 if (value.is_type<float>()) {
103 draw_float(params.layout, *value.get<float>());
104 return true;
105 }
106 if (value.is_type<float3>()) {
107 draw_vector(params.layout, *value.get<float3>());
108 return true;
109 }
110 if (value.is_type<int>()) {
111 draw_int(params.layout, *value.get<int>());
112 return true;
113 }
114 if (value.is_type<bool>()) {
115 draw_bool(params.layout, *value.get<bool>());
116 return true;
117 }
118 if (value.is_type<std::string>()) {
119 draw_string(params.layout, *value.get<std::string>());
120 return true;
121 }
122 if (value.is_type<ColorGeometry4f>()) {
123 draw_color(params.layout, *value.get<ColorGeometry4f>());
124 return true;
125 }
126 if (value.is_type<Object *>()) {
127 draw_data_block(params.layout, id_cast<const ID *>(*value.get<Object *>()));
128 return true;
129 }
130 if (value.is_type<Collection *>()) {
131 const Collection *collection = *value.get<Collection *>();
132 /* Using original collection because changing the color tag does not cause the eval copy to
133 * be updated. */
134 const Collection *orig_collection = DEG_get_original(collection);
135 if (orig_collection) {
136 const StringRefNull name = BKE_id_name(orig_collection->id);
137 int icon = ED_outliner_icon_from_id(orig_collection->id);
138 if (orig_collection->color_tag != COLLECTION_COLOR_NONE) {
139 icon = int(ICON_COLLECTION_COLOR_01) + int(orig_collection->color_tag);
140 }
141 params.layout.label(name, icon);
142 }
143 else {
145 }
146 return true;
147 }
148 if (value.is_type<Image *>()) {
149 draw_data_block(params.layout, id_cast<const ID *>(*value.get<Image *>()));
150 return true;
151 }
152 if (value.is_type<Material *>()) {
153 draw_data_block(params.layout, id_cast<const ID *>(*value.get<Material *>()));
154 return true;
155 }
156 if (value.is_type<VFont *>()) {
157 draw_data_block(params.layout, id_cast<const ID *>(*value.get<VFont *>()));
158 return true;
159 }
160 if (value.is_type<bSound *>()) {
161 draw_data_block(params.layout, id_cast<const ID *>(*value.get<bSound *>()));
162 return true;
163 }
164 return false;
165}
166
168 eval_log::NodeTreeLog &tree_log)
169{
170 tree_log.ensure_viewer_node_logs();
171 eval_log::ViewerNodeLog *viewer_log = tree_log.viewer_node_logs.lookup_default(
172 params.node.identifier, nullptr);
173 if (!viewer_log) {
174 return false;
175 }
176 const int socket_index = params.socket.index();
177 const auto &storage = *static_cast<NodeGeometryViewer *>(params.node.storage);
178 const NodeGeometryViewerItem &viewer_item = storage.items[socket_index];
179 const eval_log::ViewerNodeLog::Item *item_log = viewer_log->items.lookup_key_ptr_as(
180 viewer_item.identifier);
181 if (!item_log) {
182 return false;
183 }
184 const bke::SocketValueVariant &value = item_log->value;
185 if (!value.is_single()) {
186 return false;
187 }
188 const GPointer single_value = value.get();
189 return draw_gpointer(params, single_value);
190}
191
193{
194 const CPPType &value_type = *value.type();
195 const CPPType &socket_base_cpp_type = *params.socket.typeinfo->base_cpp_type;
197 if (value_type != socket_base_cpp_type) {
198 if (!conversions.is_convertible(value_type, socket_base_cpp_type)) {
199 return false;
200 }
201 }
202 BUFFER_FOR_CPP_TYPE_VALUE(socket_base_cpp_type, socket_value);
203 conversions.convert_to_uninitialized(
204 value_type, socket_base_cpp_type, value.get(), socket_value);
205 BLI_SCOPED_DEFER([&]() { socket_base_cpp_type.destruct(socket_value); });
206 return draw_gpointer(params, {socket_base_cpp_type, socket_value});
207}
208
210 eval_log::NodeTreeLog &tree_log)
211{
212 tree_log.ensure_socket_values();
213 eval_log::ValueLog *value_log = tree_log.find_socket_value_log(params.socket);
214 if (!value_log) {
215 return false;
216 }
217 if (const auto *generic_value_log = dynamic_cast<const eval_log::GenericValueLog *>(value_log)) {
218 return draw_generic_value_log(params, generic_value_log->value);
219 }
220 if (const auto *string_value_log = dynamic_cast<const eval_log::StringLog *>(value_log)) {
221 draw_string(params.layout, string_value_log->value);
222 return true;
223 }
224 return false;
225}
226
228{
229 SpaceNode *snode = CTX_wm_space_node(&params.C);
230 if (!snode) {
231 params.draw_standard(params.layout);
232 return;
233 }
234 snode->edittree->ensure_topology_cache();
235 const bNodeSocket &socket = params.socket;
236 if (!socket.is_directly_linked()) {
237 params.draw_standard(params.layout);
238 return;
239 }
240 const eval_log::ContextualNodeTreeLogs tree_logs =
242 eval_log::NodeTreeLog *tree_log = tree_logs.get_main_tree_log(params.node);
243 if (!tree_log) {
244 params.draw_standard(params.layout);
245 return;
246 }
247 if (draw_from_viewer_log_value(params, *tree_log)) {
248 return;
249 }
250 if (draw_from_socket_log_value(params, *tree_log)) {
251 return;
252 }
253 params.draw_standard(params.layout);
254}
255
257{
258 b.use_custom_socket_order();
259 b.allow_any_socket_order();
260
261 const bNode *node = b.node_or_null();
262 const bNodeTree *tree = b.tree_or_null();
263
264 if (!node || !tree) {
265 return;
266 }
267
268 const NodeGeometryViewer &storage = node_storage(*node);
269
270 bool has_geometry_input = false;
271 bool has_potential_attribute_input = false;
272 for (const int i : IndexRange(storage.items_num)) {
273 const NodeGeometryViewerItem &item = storage.items[i];
274 const eNodeSocketDatatype socket_type = item.socket_type;
275 if (socket_type == SOCK_GEOMETRY) {
276 has_geometry_input = true;
277 }
278 else if (socket_type_supports_attributes(socket_type)) {
279 has_potential_attribute_input = true;
280 }
281 }
282
283 if (has_geometry_input && has_potential_attribute_input) {
284 b.add_layout([](ui::Layout &layout, bContext * /*C*/, PointerRNA *ptr) {
285 layout.prop(ptr, "domain", UI_ITEM_NONE, "", ICON_NONE);
286 });
287 }
288
289 for (const int i : IndexRange(storage.items_num)) {
290 const NodeGeometryViewerItem &item = storage.items[i];
291 const eNodeSocketDatatype socket_type = item.socket_type;
292 const UString name = item.name ? UString(item.name) : ""_ustr;
293 const std::string identifier = GeoViewerItemsAccessor::socket_identifier_for_item(item);
294 auto &input_decl = b.add_input(socket_type, name, UString(identifier))
295 .socket_name_ptr(
296 &tree->id, *GeoViewerItemsAccessor::item_srna, &item, "name");
297 if (socket_type_supports_attributes(socket_type)) {
298 input_decl.evaluated_geometry_field();
299 }
300 input_decl.structure_type(StructureType::Dynamic);
301 input_decl.custom_draw([](CustomSocketDrawParams &params) { draw_input_socket(params); });
302 }
303
304 b.add_input<decl::Extend>(""_ustr, "__extend__"_ustr).structure_type(StructureType::Dynamic);
305}
306
307static void node_init(bNodeTree * /*tree*/, bNode *node)
308{
309 NodeGeometryViewer *data = MEM_new<NodeGeometryViewer>(__func__);
310 data->data_type_legacy = CD_PROP_FLOAT;
312 node->storage = data;
313}
314
315static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *ptr)
316{
317 bNode &node = *ptr->data_as<bNode>();
318 bNodeTree &ntree = *reinterpret_cast<bNodeTree *>(ptr->owner_id);
319
320 if (ui::Layout *panel = layout.panel(C, "viewer_items", false, IFACE_("Viewer Items"))) {
321 socket_items::ui::draw_items_list_with_operators<GeoViewerItemsAccessor>(
322 C, panel, ntree, node);
323 socket_items::ui::draw_active_item_props<GeoViewerItemsAccessor>(
324 ntree, node, [&](PointerRNA *item_ptr) {
325 panel->use_property_split_set(true);
326 panel->use_property_decorate_set(false);
327 panel->prop(item_ptr, "socket_type", UI_ITEM_NONE, std::nullopt, ICON_NONE);
328 panel->prop(item_ptr, "auto_remove", UI_ITEM_NONE, std::nullopt, ICON_NONE);
329 });
330 }
331}
332
334{
335 const bNodeSocket &other_socket = params.other_socket();
336 if (other_socket.in_out == SOCK_OUT) {
337 params.add_item(IFACE_("Value"), [](LinkSearchOpParams &params) {
338 bNode &node = params.add_node("GeometryNodeViewer"_ustr);
340 params.node_tree, node, params.socket.typeinfo->type, params.socket.name);
342 SpaceNode *snode = CTX_wm_space_node(&params.C);
343 Main *bmain = CTX_data_main(&params.C);
345 });
346 return;
347 }
348}
349
355{
356 const auto &storage = *static_cast<NodeGeometryViewer *>(node.storage);
357 const StringRef viewer_attribute_name = ".viewer";
358 std::optional<int> last_geometry_identifier;
359 for (const int i : IndexRange(storage.items_num)) {
360 const bNodeSocket &bsocket = node.input_socket(i);
361 const NodeGeometryViewerItem &item = storage.items[i];
362 const bke::bNodeSocketType &type = *bsocket.typeinfo;
363 const bke::SocketValueVariant &value = r_log.items.lookup_key_as(item.identifier).value;
364
365 if (type.type == SOCK_GEOMETRY && value.is_single()) {
366 last_geometry_identifier = item.identifier;
367 continue;
368 }
369 if (!last_geometry_identifier) {
370 continue;
371 }
373 continue;
374 }
375 /* Changing the `value` field doesn't change the hash or equality of the item. */
376 GMutablePointer geometry_ptr = const_cast<bke::SocketValueVariant &>(
377 r_log.items.lookup_key_as(*last_geometry_identifier).value)
378 .get();
379 GeometrySet &geometry = *geometry_ptr.get<GeometrySet>();
380 if (!(value.is_single() || value.is_field())) {
381 continue;
382 }
383 const GField field = value.copy_as<GField>();
384 const auto domain_or_auto = bke::AttrDomainSelection(storage.domain);
385 if (domain_or_auto == bke::AttrDomainSelection::Instance) {
386 if (geometry.has_instances()) {
387 bke::GeometryComponent &component =
388 geometry.get_component_for_write<bke::InstancesComponent>();
390 component, viewer_attribute_name, AttrDomain::Instance, field);
391 }
392 }
393 else {
395 for (const bke::GeometryComponent::Type type :
400 {
401 if (!geometry.has(type)) {
402 continue;
403 }
404 bke::GeometryComponent &component = geometry.get_component_for_write(type);
405 AttrDomain used_domain;
406 if (domain_or_auto == bke::AttrDomainSelection::Auto) {
407 if (const std::optional<AttrDomain> domain = bke::try_detect_field_domain(component,
408 field))
409 {
410 used_domain = *domain;
411 }
412 else {
413 used_domain = AttrDomain::Point;
414 }
415 }
416 else {
417 used_domain = bke::AttrDomain(domain_or_auto);
418 }
419 bke::try_capture_field_on_geometry(component, viewer_attribute_name, used_domain, field);
420 }
421 });
422 }
423 /* Avoid overriding the viewer attribute with other fields. */
424 last_geometry_identifier.reset();
425 }
426}
427
429 const Span<bke::SocketValueVariant *> input_values,
431{
432 const auto &storage = *static_cast<NodeGeometryViewer *>(node.storage);
433 for (const int i : IndexRange(storage.items_num)) {
434 void *src_value = input_values[i];
435 if (!src_value) {
436 continue;
437 }
438 const NodeGeometryViewerItem &item = storage.items[i];
439
440 bke::SocketValueVariant &value = *input_values[i];
442 r_log.items.add_new({item.identifier, item.name, std::move(value)});
443 }
445}
446
448{
449 SpaceNode *snode = CTX_wm_space_node(&params.C);
450 if (snode) {
451 if (std::optional<ed::space_node::ObjectAndModifier> object_and_modifier =
453 {
454 const NodesModifierData &nmd = *object_and_modifier->nmd;
455 nmd.node_group->ensure_topology_cache();
456 if (!(nmd.modifier.mode & eModifierMode_Realtime)) {
458 row.icon = ICON_STATUS_ERROR;
459 row.text = TIP_("Modifier disabled");
460 row.tooltip = TIP_("The viewer does not work because the modifier is disabled");
461 params.rows.append(std::move(row));
462 }
463 else if (!nmd.node_group->group_output_node()) {
465 row.icon = ICON_STATUS_ERROR;
466 row.text = TIP_("Missing output");
467 row.tooltip = TIP_(
468 "The viewer does not work because the node group used by the modifier has no output");
469 params.rows.append(std::move(row));
470 }
471 }
472 }
473 const auto data_type = eCustomDataType(node_storage(params.node).data_type_legacy);
474 if (ELEM(data_type, CD_PROP_QUATERNION, CD_PROP_FLOAT4X4)) {
476 row.icon = ICON_STATUS_INFO;
477 row.text = TIP_("No color overlay");
478 row.tooltip = TIP_(
479 "Rotation values can only be displayed with the text overlay in the 3D view");
480 params.rows.append(std::move(row));
481 }
482}
483
488
490{
492 MEM_delete(static_cast<NodeGeometryViewer *>(node->storage));
493}
494
495static void node_copy_storage(bNodeTree * /*dst_tree*/, bNode *dst_node, const bNode *src_node)
496{
497 const NodeGeometryViewer &src_storage = node_storage(*src_node);
498 dst_node->storage = MEM_new<NodeGeometryViewer>(__func__, dna::shallow_copy(src_storage));
499
501}
502
504{
505 NodeGeometryViewerItem *new_item = nullptr;
507 params.ntree, params.node, params.node, params.link, std::nullopt, &new_item);
508 if (new_item) {
510 }
511 return keep_link;
512}
513
514static void node_blend_write(const bNodeTree & /*tree*/, const bNode &node, BlendWriter &writer)
515{
517}
518
523
524static void node_register()
525{
526 static bke::bNodeType ntype;
527
528 geo_node_type_base(&ntype, "GeometryNodeViewer"_ustr, GEO_NODE_VIEWER);
529 ntype.ui_name = "Viewer";
530 ntype.ui_description = "Display the input data in the Spreadsheet Editor";
531 ntype.enum_name_legacy = "VIEWER";
533 bke::node_type_storage(ntype, "NodeGeometryViewer", node_free_storage, node_copy_storage);
534 ntype.declare = node_declare;
535 ntype.initfunc = node_init;
539 ntype.no_muting = true;
545}
547
548} // namespace nodes::node_geo_viewer_cc
549
550namespace nodes {
551
552StructRNA **GeoViewerItemsAccessor::item_srna = &RNA_NodeGeometryViewerItem;
553
555 const NodeGeometryViewerItem &item)
556{
557 writer->write_string(item.name);
558}
559
565
567 const Span<bke::SocketValueVariant *> input_values,
569{
571}
572
573} // namespace nodes
574} // namespace blender
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:479
#define NODE_STORAGE_FUNCS(StorageT)
Definition BKE_node.hh:1353
#define GEO_NODE_VIEWER
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define BLI_SCOPED_DEFER(function_to_defer)
#define TIP_(msgid)
#define CTX_IFACE_(context, msgid)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_COLOR
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define C
Definition RandGen.cpp:29
#define UI_ITEM_NONE
#define ELEM(...)
void destruct(void *ptr) const
ChannelStorageType r
ChannelStorageType g
ChannelStorageType b
ChannelStorageType a
const CPPType * type() const
const void * get() const
constexpr IndexRange()=default
UString()=default
void convert_to_uninitialized(const CPPType &from_type, const CPPType &to_type, const void *from_value, void *to_value) const
bool is_convertible(const CPPType &from_type, const CPPType &to_type) const
constexpr StringRef substr(int64_t start, int64_t size) const
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
NodeTreeLog * get_main_tree_log(const bke::bNodeTreeZone *zone) const
Definition eval_log.cc:1116
Map< int32_t, ViewerNodeLog *, 0 > viewer_node_logs
ValueLog * find_socket_value_log(const bNodeSocket &query_socket)
Definition eval_log.cc:734
static ContextualNodeTreeLogs get_contextual_tree_logs(const SpaceNode &snode)
Definition eval_log.cc:1048
CustomIDVectorSet< Item, ItemIdentifierGetter > items
#define storage(slot, qualifiers)
std::optional< AttrDomain > try_detect_field_domain(const GeometryComponent &component, const fn::GField &field)
bool try_capture_field_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const StringRef name, AttrDomain domain, const fn::Field< bool > &selection, const fn::GField &field)
const DataTypeConversions & get_implicit_type_conversions()
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
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))
Definition node.cc:6166
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
Definition DNA_defs.h:147
std::optional< ObjectAndModifier > get_geometry_nodes_modifier_for_node_editor(const SpaceNode &snode)
void activate_geometry_node(Main &bmain, SpaceNode &snode, bNode &node, std::optional< int > item_identifier=std::nullopt)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_copy_storage(bNodeTree *, bNode *dst_node, const bNode *src_node)
static void draw_color(ui::Layout &layout, const ColorGeometry4f &value)
static bool node_insert_link(bke::NodeInsertLinkParams &params)
static void draw_input_socket(CustomSocketDrawParams &params)
static void node_blend_write(const bNodeTree &, const bNode &node, BlendWriter &writer)
static bool draw_from_socket_log_value(CustomSocketDrawParams &params, eval_log::NodeTreeLog &tree_log)
static void geo_viewer_node_log_impl(const bNode &node, const Span< bke::SocketValueVariant * > input_values, eval_log::ViewerNodeLog &r_log)
static bool draw_gpointer(CustomSocketDrawParams &params, const GPointer value)
static void draw_float(ui::Layout &layout, const float value)
static void log_viewer_attribute(const bNode &node, eval_log::ViewerNodeLog &r_log)
static void node_blend_read(bNodeTree &, bNode &node, BlendDataReader &reader)
static bool draw_generic_value_log(CustomSocketDrawParams &params, const GPointer &value)
static void node_free_storage(bNode *node)
static void draw_empty_data_block(ui::Layout &layout)
static void node_init(bNodeTree *, bNode *node)
static void draw_string(ui::Layout &layout, const StringRef value)
static bool draw_from_viewer_log_value(CustomSocketDrawParams &params, eval_log::NodeTreeLog &tree_log)
static void draw_bool(ui::Layout &layout, const bool value)
static void draw_int(ui::Layout &layout, const int value)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout_ex(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static void draw_data_block(ui::Layout &layout, const ID *id)
static void draw_vector(ui::Layout &layout, const float3 &value)
static void node_extra_info(NodeExtraInfoParams &params)
static void node_gather_link_searches(GatherLinkSearchOpParams &params)
void blend_write(BlendWriter *writer, const bNode &node)
void blend_read_data(BlendDataReader *reader, bNode &node)
void copy_array(const bNode &src_node, bNode &dst_node)
Accessor::ItemT * add_item_with_socket_type_and_name(bNodeTree &ntree, bNode &node, const eNodeSocketDatatype socket_type, const char *name, std::optional< int > dimensions=std::nullopt)
bool try_add_item_via_any_extend_socket(bNodeTree &ntree, bNode &extend_node, bNode &storage_node, bNodeLink &link, const std::optional< StringRef > socket_identifier=std::nullopt, typename Accessor::ItemT **r_new_item=nullptr)
bool socket_type_supports_attributes(const eNodeSocketDatatype socket_type)
void geo_viewer_node_log(const bNode &node, const Span< bke::SocketValueVariant * > input_values, eval_log::ViewerNodeLog &r_log)
BMesh Iterators.
@ NODE_GEO_VIEWER_ITEM_FLAG_AUTO_REMOVE
const char * BKE_id_name(const ID &id)
BMesh const char void * data
int ED_outliner_icon_from_id(const ID &id)
SpaceNode * CTX_wm_space_node(const bContext *C)
T * DEG_get_original(T *id)
Main * CTX_data_main(const bContext *C)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
Definition readfile.cc:6653
signed char int8_t
Definition BKE_text.h:76
void write_string(const char *data)
T * data_as() const
Definition RNA_types.hh:139
struct bNodeTree * edittree
bke::bNodeSocketType * typeinfo
eNodeSocketInOut in_out
Defines a socket type.
Definition BKE_node.hh:163
const CPPType * base_cpp_type
Definition BKE_node.hh:210
eNodeSocketDatatype type
Definition BKE_node.hh:198
Defines a node type.
Definition BKE_node.hh:265
NodeBlendWriteFunction blend_write_storage_content
Definition BKE_node.hh:421
void(*) register_operators()
Definition BKE_node.hh:448
std::string ui_description
Definition BKE_node.hh:271
NodeBlendDataReadFunction blend_data_read_storage_content
Definition BKE_node.hh:422
NodeExtraInfoFunction get_extra_info
Definition BKE_node.hh:412
void(*) draw_buttons_ex(ui::Layout &, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:292
void(*) initfunc(bNodeTree *ntree, bNode *node)
Definition BKE_node.hh:320
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:409
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool(*) insert_link(NodeInsertLinkParams &params)
Definition BKE_node.hh:364
void draw_standard(ui::Layout &layout, std::optional< StringRefNull > label_override=std::nullopt)
static void blend_read_data_item(BlendDataReader *reader, ItemT &item)
static std::string socket_identifier_for_item(const NodeGeometryViewerItem &item)
static void blend_write_item(BlendWriter *writer, const ItemT &item)
Vector< NodeExtraInfoRow > & rows
void label(StringRef name, int icon)
PanelLayout panel(const bContext *C, StringRef idname, bool default_closed)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)