Blender V5.0
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"
11
13
15{
16 b.add_output<decl::Image>("Image").custom_draw([](CustomSocketDrawParams &params) {
17 params.layout.alignment_set(ui::LayoutAlign::Expand);
18 uiTemplateID(&params.layout,
19 &params.C,
20 &params.node_ptr,
21 "image",
22 "IMAGE_OT_new",
23 "IMAGE_OT_open",
24 nullptr);
25 });
26}
27
29{
30 params.set_output("Image", reinterpret_cast<Image *>(params.node().id));
31}
32
33static void node_register()
34{
35 static blender::bke::bNodeType ntype;
36
37 geo_node_type_base(&ntype, "GeometryNodeInputImage", GEO_NODE_IMAGE);
38 ntype.ui_name = "Image";
39 ntype.ui_description = "Input an image data-block";
40 ntype.enum_name_legacy = "IMAGE";
43 ntype.declare = node_declare;
46}
48
49} // namespace blender::nodes::node_geo_image_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:447
#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)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
Definition node.cc:5396
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