Blender V5.0
node_geo_input_object.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::Object>("Object").custom_draw([](CustomSocketDrawParams &params) {
15 params.layout.alignment_set(ui::LayoutAlign::Expand);
16 params.layout.prop(&params.node_ptr, "object", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
17 });
18}
19
21{
22 Object *object = reinterpret_cast<Object *>(params.node().id);
23 params.set_output("Object", object);
24}
25
26static void node_register()
27{
28 static blender::bke::bNodeType ntype;
29
30 geo_node_type_base(&ntype, "GeometryNodeInputObject", GEO_NODE_INPUT_OBJECT);
31 ntype.ui_name = "Object";
32 ntype.ui_description = "Output a single object";
33 ntype.enum_name_legacy = "INPUT_OBJECT";
35 ntype.declare = node_declare;
38}
40
41} // namespace blender::nodes::node_geo_input_object_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:447
#define GEO_NODE_INPUT_OBJECT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:238
std::string ui_description
Definition BKE_node.hh:244
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:354
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362