Blender V5.3
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"_ustr).custom_draw([](CustomSocketDrawParams &params) {
18 template_id(&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"_ustr, reinterpret_cast<Image *>(params.node().id));
31}
32
33static void node_register()
34{
35 static bke::bNodeType ntype;
36
37 geo_node_type_base(&ntype, "GeometryNodeInputImage"_ustr, 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:478
#define GEO_NODE_IMAGE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
static constexpr int _240
Definition BKE_node.hh:250
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:385
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393
void alignment_set(LayoutAlign alignment)