29using bke::bNodeTreeZone;
30using bke::bNodeTreeZones;
34 switch (zone.output_node->type) {
38 return &node_elem->
base;
44 node_elem->
iteration = storage.inspection_index;
45 return &node_elem->
base;
49 zone.output_node->storage);
53 node_elem->
index = storage.inspection_index;
54 return &node_elem->
base;
72 id_elem->
id = &ob->
id;
94 if (modifier ==
nullptr) {
109 const char *node_name = tree_path[i + 1]->node_name;
113 if (node ==
nullptr) {
117 tree->ensure_topology_cache();
130 node_elem->
node_id = node->identifier;
135 snode.
edittree->ensure_topology_cache();
148 viewer_node_elem->
node_id = node.identifier;
160 if (iter_node->type == GEO_NODE_VIEWER) {
170 bool found_view3d_with_enabled_viewer =
false;
171 View3D *any_view3d_without_viewer =
nullptr;
186 found_view3d_with_enabled_viewer =
true;
189 any_view3d_without_viewer = &v3d;
195 if (!found_view3d_with_enabled_viewer && any_view3d_without_viewer !=
nullptr) {
224 return reinterpret_cast<Object *
>(id);
235 if (elems_vec.
size() < 3) {
245 if (root_id ==
nullptr) {
252 remaining_elems = remaining_elems.
drop_front(1);
262 remaining_elems = remaining_elems.
drop_front(1);
265 if (!
ELEM(elem->type,
297 if (modifier ==
nullptr) {
300 if (modifier->node_group ==
nullptr) {
303 const bNodeTree *ngroup = modifier->node_group;
306 ngroup->ensure_topology_cache();
308 switch (path_elem->type) {
313 typed_elem.sim_output_node_id);
314 if (next_zone ==
nullptr) {
326 typed_elem.repeat_output_node_id);
327 if (next_zone ==
nullptr) {
337 const auto &typed_elem =
340 typed_elem.zone_output_node_id);
341 if (next_zone ==
nullptr) {
352 const bNode *group_node = ngroup->node_by_id(typed_elem.node_id);
353 if (group_node ==
nullptr) {
357 if (parent_zone != zone) {
360 if (group_node->
id ==
nullptr) {
363 ngroup =
reinterpret_cast<const bNodeTree *
>(group_node->
id);
374 if (viewer_node ==
nullptr) {
378 if (tree_zones ==
nullptr) {
410 screens.
append(area->full);
412 for (
const bScreen *screen : screens) {
431 snode.
edittree->ensure_topology_cache();
432 const bNode *viewer_node = snode.
edittree->node_by_id(viewer_node_id);
433 if (viewer_node ==
nullptr) {
448 std::swap(viewer_path, tmp_viewer_path);
467 const std::optional<ViewerPathForGeometryNodesViewer> parsed_viewer_path =
469 if (!parsed_viewer_path.has_value()) {
473 snode.
edittree->ensure_topology_cache();
474 bNode *possible_viewer = snode.
edittree->node_by_id(parsed_viewer_path->viewer_node_id);
475 if (possible_viewer ==
nullptr) {
483 return possible_viewer;
521 elem.zone_output_node_id, elem.index);
Main * CTX_data_main(const bContext *C)
#define GEO_NODE_FOREACH_GEOMETRY_ELEMENT_OUTPUT
#define GEO_NODE_SIMULATION_OUTPUT
#define GEO_NODE_REPEAT_OUTPUT
void BKE_viewer_path_copy(ViewerPath *dst, const ViewerPath *src)
ViewerNodeViewerPathElem * BKE_viewer_path_elem_new_viewer_node()
@ VIEWER_PATH_EQUAL_FLAG_IGNORE_ITERATION
void BKE_viewer_path_clear(ViewerPath *viewer_path)
void BKE_viewer_path_init(ViewerPath *viewer_path)
SimulationZoneViewerPathElem * BKE_viewer_path_elem_new_simulation_zone()
ForeachGeometryElementZoneViewerPathElem * BKE_viewer_path_elem_new_foreach_geometry_element_zone()
GroupNodeViewerPathElem * BKE_viewer_path_elem_new_group_node()
IDViewerPathElem * BKE_viewer_path_elem_new_id()
ModifierViewerPathElem * BKE_viewer_path_elem_new_modifier()
RepeatZoneViewerPathElem * BKE_viewer_path_elem_new_repeat_zone()
bool BKE_viewer_path_equal(const ViewerPath *a, const ViewerPath *b, ViewerPathEqualFlag flag=ViewerPathEqualFlag(0))
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
#define BLI_assert_unreachable()
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_SCOPED_DEFER(function_to_defer)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define SET_FLAG_FROM_TEST(value, test, flag)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE
@ SPREADSHEET_FLAG_PINNED
@ VIEWER_PATH_ELEM_TYPE_GROUP_NODE
@ VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE
@ VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE
@ VIEWER_PATH_ELEM_TYPE_VIEWER_NODE
@ VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE
@ VIEWER_PATH_ELEM_TYPE_MODIFIER
@ VIEWER_PATH_ELEM_TYPE_ID
void push(Args &&...args)
constexpr IndexRange drop_back(int64_t n) const
constexpr Span drop_front(int64_t n) const
constexpr Span drop_back(int64_t n) const
constexpr const T & last(const int64_t n=0) const
void append(const T &value)
IndexRange index_range() const
bNodeTreeZone * parent_zone
Vector< const bNodeTreeZone * > get_zone_stack_for_node(const int32_t node_id) const
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
Vector< std::unique_ptr< bNodeTreeZone > > zones
static const char * modifier_name[LS_MODIFIER_NUM]
bNode * node_find_node_by_name(bNodeTree *ntree, const char *name)
bool add_compute_context_for_viewer_path_elem(const ViewerPathElem &elem, ComputeContextBuilder &compute_context_builder)
Object * parse_object_only(const ViewerPath &viewer_path)
static ViewerPathElem * viewer_path_elem_for_zone(const bNodeTreeZone &zone)
UpdateActiveGeometryNodesViewerResult update_active_geometry_nodes_viewer(const bContext &C, ViewerPath &viewer_path)
std::optional< ViewerPathForGeometryNodesViewer > parse_geometry_nodes_viewer(const ViewerPath &viewer_path)
void activate_geometry_node(Main &bmain, SpaceNode &snode, bNode &node)
static void viewer_path_for_geometry_node(const SpaceNode &snode, const bNode &node, ViewerPath &r_dst)
UpdateActiveGeometryNodesViewerResult
bool exists_geometry_nodes_viewer(const ViewerPathForGeometryNodesViewer &parsed_viewer_path)
bNode * find_geometry_nodes_viewer(const ViewerPath &viewer_path, SpaceNode &snode)
struct bNodeTree * node_group
int repeat_output_node_id
int32_t sim_output_node_id
struct bNodeTree * edittree
struct bNodeTree * nodetree
uint8_t object_eval_state
blender::Vector< const ViewerPathElem * > node_path
blender::StringRefNull modifier_name
void WM_main_add_notifier(uint type, void *reference)