Blender V5.0
node_geo_is_viewport.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
6
8
10
12{
13 b.add_output<decl::Bool>("Is Viewport");
14}
15
17{
18 const Depsgraph *depsgraph = params.depsgraph();
20 const bool is_viewport = mode == DAG_EVAL_VIEWPORT;
21
22 params.set_output("Is Viewport", is_viewport);
23}
24
25static void node_register()
26{
27 static blender::bke::bNodeType ntype;
28
29 geo_node_type_base(&ntype, "GeometryNodeIsViewport", GEO_NODE_IS_VIEWPORT);
30 ntype.ui_name = "Is Viewport";
31 ntype.ui_description =
32 "Retrieve whether the nodes are being evaluated for the viewport rather than the final "
33 "render";
34 ntype.enum_name_legacy = "IS_VIEWPORT";
37 ntype.declare = node_declare;
39}
41
42} // namespace blender::nodes::node_geo_is_viewport_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:447
#define GEO_NODE_IS_VIEWPORT
eEvaluationMode
@ DAG_EVAL_VIEWPORT
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
BPy_StructRNA * depsgraph
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
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