Blender V4.5
node_geo_image.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 "DNA_image_types.h"
6
8
9#include "UI_interface.hh"
10
12
14{
15 b.add_output<decl::Image>("Image").custom_draw([](CustomSocketDrawParams &params) {
17 uiTemplateID(&params.layout,
18 &params.C,
19 &params.node_ptr,
20 "image",
21 "IMAGE_OT_new",
22 "IMAGE_OT_open",
23 nullptr);
24 });
25}
26
28{
29 params.set_output("Image", reinterpret_cast<Image *>(params.node().id));
30}
31
32static void node_register()
33{
34 static blender::bke::bNodeType ntype;
35
36 geo_node_type_base(&ntype, "GeometryNodeInputImage", GEO_NODE_IMAGE);
37 ntype.ui_name = "Image";
38 ntype.ui_description = "Input an image data-block";
39 ntype.enum_name_legacy = "IMAGE";
42 ntype.declare = node_declare;
45}
47
48} // namespace blender::nodes::node_geo_image_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:433
#define GEO_NODE_IMAGE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, std::optional< blender::StringRef > text=std::nullopt)
@ UI_LAYOUT_ALIGN_EXPAND
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2748
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
Definition node.cc:5585
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:226
std::string ui_description
Definition BKE_node.hh:232
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:347
const char * enum_name_legacy
Definition BKE_node.hh:235
NodeDeclareFunction declare
Definition BKE_node.hh:355