Blender V5.3
node_geo_input_collection.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6#include "UI_resources.hh"
7
9
11
13{
14 b.add_output<decl::Collection>("Collection"_ustr)
15 .custom_draw([](CustomSocketDrawParams &params) {
17 params.layout.prop(
18 &params.node_ptr, "collection", ui::ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
19 });
20}
21
23{
24 Collection *collection = reinterpret_cast<Collection *>(params.node().id);
25 params.set_output("Collection"_ustr, collection);
26}
27
28static void node_register()
29{
30 static bke::bNodeType ntype;
31
32 geo_node_type_base(&ntype, "GeometryNodeInputCollection"_ustr, GEO_NODE_INPUT_COLLECTION);
33 ntype.ui_name = "Collection";
34 ntype.ui_description = "Output a single collection";
35 ntype.enum_name_legacy = "INPUT_COLLECTION";
37 ntype.declare = node_declare;
40}
42
43} // namespace blender::nodes::node_geo_input_collection_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:478
#define GEO_NODE_INPUT_COLLECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:385
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393
void alignment_set(LayoutAlign alignment)
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)