Blender V4.3
node_geo_input_material.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 "UI_interface.hh"
6#include "UI_resources.hh"
7
9
11
13{
14 b.add_output<decl::Material>("Material");
15}
16
17static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
18{
19 uiItemR(layout, ptr, "material", UI_ITEM_NONE, "", ICON_NONE);
20}
21
23{
24 Material *material = reinterpret_cast<Material *>(params.node().id);
25 params.set_output("Material", material);
26}
27
28static void node_register()
29{
30 static blender::bke::bNodeType ntype;
31
32 geo_node_type_base(&ntype, GEO_NODE_INPUT_MATERIAL, "Material", NODE_CLASS_INPUT);
34 ntype.declare = node_declare;
37}
39
40} // namespace blender::nodes::node_geo_input_material_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define UI_ITEM_NONE
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
local_group_size(16, 16) .push_constant(Type b
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_geo_exec(GeoNodeExecParams params)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:339
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:238
NodeDeclareFunction declare
Definition BKE_node.hh:347
PointerRNA * ptr
Definition wm_files.cc:4126