Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc
| Show All 16 Lines | |||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_is_viewport_declare(NodeDeclarationBuilder &b) | static void geo_node_is_viewport_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_output<decl::Bool>("Is Viewport"); | b.add_output<decl::Bool>(N_("Is Viewport")); | ||||
| } | } | ||||
| static void geo_node_is_viewport_exec(GeoNodeExecParams params) | static void geo_node_is_viewport_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| const Depsgraph *depsgraph = params.depsgraph(); | const Depsgraph *depsgraph = params.depsgraph(); | ||||
| const eEvaluationMode mode = DEG_get_mode(depsgraph); | const eEvaluationMode mode = DEG_get_mode(depsgraph); | ||||
| const bool is_viewport = mode == DAG_EVAL_VIEWPORT; | const bool is_viewport = mode == DAG_EVAL_VIEWPORT; | ||||
| Show All 14 Lines | |||||