Blender  V3.3
node_geo_input_material.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "UI_interface.h"
4 #include "UI_resources.h"
5 
6 #include "node_geometry_util.hh"
7 
9 
11 {
12  b.add_output<decl::Material>(N_("Material"));
13 }
14 
15 static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
16 {
17  uiItemR(layout, ptr, "material", 0, "", ICON_NONE);
18 }
19 
21 {
22  Material *material = (Material *)params.node().id;
23  params.set_output("Material", material);
24 }
25 
26 } // namespace blender::nodes::node_geo_input_material_cc
27 
29 {
31 
32  static bNodeType ntype;
33 
38  nodeRegisterType(&ntype);
39 }
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
#define GEO_NODE_INPUT_MATERIAL
Definition: BKE_node.h:1403
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
Material material
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
static void node_geo_exec(GeoNodeExecParams params)
static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_input_material()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
NodeGeometryExecFunction geometry_node_execute
Definition: BKE_node.h:316
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480