Blender V4.3
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, GEO_NODE_IS_VIEWPORT, "Is Viewport", NODE_CLASS_INPUT);
31 ntype.declare = node_declare;
33}
35
36} // namespace blender::nodes::node_geo_is_viewport_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
eEvaluationMode
@ DAG_EVAL_VIEWPORT
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:339
NodeDeclareFunction declare
Definition BKE_node.hh:347