|
Blender V4.3
|
Classes | |
| struct | ViewerPathForGeometryNodesViewer |
Enumerations | |
| enum class | UpdateActiveGeometryNodesViewerResult { StillActive , Updated , NotActive } |
Functions | |
| void | activate_geometry_node (Main &bmain, SpaceNode &snode, bNode &node) |
| Object * | parse_object_only (const ViewerPath &viewer_path) |
| std::optional< ViewerPathForGeometryNodesViewer > | parse_geometry_nodes_viewer (const ViewerPath &viewer_path) |
| bNode * | find_geometry_nodes_viewer (const ViewerPath &viewer_path, SpaceNode &snode) |
| bool | exists_geometry_nodes_viewer (const ViewerPathForGeometryNodesViewer &parsed_viewer_path) |
| UpdateActiveGeometryNodesViewerResult | update_active_geometry_nodes_viewer (const bContext &C, ViewerPath &viewer_path) |
| bool | add_compute_context_for_viewer_path_elem (const ViewerPathElem &elem, ComputeContextBuilder &compute_context_builder) |
| static ViewerPathElem * | viewer_path_elem_for_zone (const bNodeTreeZone &zone) |
| static void | viewer_path_for_geometry_node (const SpaceNode &snode, const bNode &node, ViewerPath &r_dst) |
|
strong |
| Enumerator | |
|---|---|
| StillActive | |
| Updated | |
| NotActive | |
Definition at line 66 of file ED_viewer_path.hh.
| void blender::ed::viewer_path::activate_geometry_node | ( | Main & | bmain, |
| SpaceNode & | snode, | ||
| bNode & | node ) |
Activates the given node in the context provided by the editor. This indirectly updates all non-pinned viewer paths in other editors (spreadsheet and 3d view).
Definition at line 153 of file ed_viewer_path.cc.
References BKE_viewer_path_clear(), BKE_viewer_path_copy(), BKE_workspace_active_get(), BKE_workspace_active_screen_get(), BLI_SCOPED_DEFER, DEG_id_tag_update(), SpaceNode::edittree, ListBase::first, SpaceSpreadsheet::flag, View3D::flag2, GS, SpaceNode::id, ID_OB, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, ID::name, NC_VIEWER_PATH, NODE_DO_OUTPUT, SpaceSpreadsheet::object_eval_state, SET_FLAG_FROM_TEST, SPACE_SPREADSHEET, SPACE_VIEW3D, SpaceLink::spacetype, SPREADSHEET_FLAG_PINNED, SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE, V3D_SHOW_VIEWER, WorkSpace::viewer_path, viewer_path_for_geometry_node(), wmWindowManager::windows, Main::wm, and WM_main_add_notifier().
Referenced by ED_node_set_active(), blender::ed::space_node::viewer_linking::finalize_viewer_link(), blender::nodes::node_geo_viewer_cc::node_gather_link_searches(), and blender::ed::space_node::node_mouse_select().
|
nodiscard |
Some viewer path elements correspond to compute-contexts. This function converts from the viewer path element to the corresponding compute context if possible.
Definition at line 488 of file ed_viewer_path.cc.
References blender::ComputeContextBuilder::push(), ViewerPathElem::type, VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE, VIEWER_PATH_ELEM_TYPE_GROUP_NODE, VIEWER_PATH_ELEM_TYPE_ID, VIEWER_PATH_ELEM_TYPE_MODIFIER, VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, and VIEWER_PATH_ELEM_TYPE_VIEWER_NODE.
Referenced by blender::find_side_effect_nodes_for_viewer_path(), and blender::nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path().
| bool blender::ed::viewer_path::exists_geometry_nodes_viewer | ( | const ViewerPathForGeometryNodesViewer & | parsed_viewer_path | ) |
Checks if the node referenced by the viewer path and its entire context still exists. The node does not have to be visible for this to return true.
Definition at line 284 of file ed_viewer_path.cc.
References BLI_assert_unreachable, eModifierType_Nodes, blender::bke::bNodeTreeZones::get_zone_by_node(), bNode::id, bNode::identifier, LISTBASE_FOREACH, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::modifier_name, Object::modifiers, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::node_path, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::object, blender::bke::bNodeTreeZone::parent_zone, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::viewer_node_id, VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE, VIEWER_PATH_ELEM_TYPE_GROUP_NODE, VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, and VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE.
Referenced by blender::ed::spreadsheet::spreadsheet_update_context().
| bNode * blender::ed::viewer_path::find_geometry_nodes_viewer | ( | const ViewerPath & | viewer_path, |
| SpaceNode & | snode ) |
Finds the node referenced by the ViewerPath within the provided editor. If no node is referenced, null is returned. When two different editors show the same node group but in a different context, it's possible that the same node is active in one editor but not the other.
Definition at line 460 of file ed_viewer_path.cc.
References BKE_viewer_path_clear(), BKE_viewer_path_equal(), BLI_SCOPED_DEFER, SpaceNode::edittree, GS, SpaceNode::id, ID_OB, ID::name, parse_geometry_nodes_viewer(), and viewer_path_for_geometry_node().
Referenced by blender::ed::space_node::node_deactivate_viewer_exec().
| std::optional< ViewerPathForGeometryNodesViewer > blender::ed::viewer_path::parse_geometry_nodes_viewer | ( | const ViewerPath & | viewer_path | ) |
Parses a ViewerPath into a #ViewerPathForGeometryNodesViewer or returns none if that does not work.
Definition at line 227 of file ed_viewer_path.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Span< T >::drop_back(), blender::Span< T >::drop_front(), ELEM, GS, ID_OB, blender::Span< T >::last(), LISTBASE_FOREACH, modifier_name, ID::name, ViewerPath::path, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), ViewerPathElem::type, VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE, VIEWER_PATH_ELEM_TYPE_GROUP_NODE, VIEWER_PATH_ELEM_TYPE_ID, VIEWER_PATH_ELEM_TYPE_MODIFIER, VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, and VIEWER_PATH_ELEM_TYPE_VIEWER_NODE.
Referenced by find_geometry_nodes_viewer(), blender::find_side_effect_nodes_for_viewer_path(), blender::nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path(), and blender::ed::spreadsheet::spreadsheet_update_context().
| Object * blender::ed::viewer_path::parse_object_only | ( | const ViewerPath & | viewer_path | ) |
Returns the object referenced by the viewer path. This only returns something if the viewer path only contains the object and nothing more.
Definition at line 208 of file ed_viewer_path.cc.
References BLI_listbase_count(), ListBase::first, GS, ID_OB, ViewerPath::path, ViewerPathElem::type, and VIEWER_PATH_ELEM_TYPE_ID.
Referenced by blender::ed::spreadsheet::spreadsheet_update_context().
| UpdateActiveGeometryNodesViewerResult blender::ed::viewer_path::update_active_geometry_nodes_viewer | ( | const bContext & | C, |
| ViewerPath & | viewer_path ) |
Checks if the node referenced by the viewer and its entire context is still active, i.e. some editor is showing it. If not, the viewer path might be updated in minor ways (like changing the repeat zone iteration).
Definition at line 387 of file ed_viewer_path.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), bScreen::areabase, BKE_viewer_path_clear(), BKE_viewer_path_equal(), BKE_workspace_active_screen_get(), BLI_listbase_is_empty(), BLI_SCOPED_DEFER, CTX_data_main(), DEG_id_tag_update(), SpaceNode::edittree, ELEM, ListBase::first, bNode::flag, SpaceNode::id, ID_RECALC_GEOMETRY, ListBase::last, LISTBASE_FOREACH, NODE_DO_OUTPUT, NotActive, NTREE_GEOMETRY, ViewerPath::path, SCREENFULL, SCREENMAXIMIZED, SPACE_NODE, SpaceLink::spacetype, bScreen::state, StillActive, bNodeTree::type, ViewerPathElem::type, Updated, VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, VIEWER_PATH_EQUAL_FLAG_IGNORE_ITERATION, viewer_path_for_geometry_node(), wmWindowManager::windows, and Main::wm.
|
static |
Definition at line 32 of file ed_viewer_path.cc.
References ForeachGeometryElementZoneViewerPathElem::base, RepeatZoneViewerPathElem::base, SimulationZoneViewerPathElem::base, BKE_viewer_path_elem_new_foreach_geometry_element_zone(), BKE_viewer_path_elem_new_repeat_zone(), BKE_viewer_path_elem_new_simulation_zone(), BLI_assert_unreachable, GEO_NODE_FOREACH_GEOMETRY_ELEMENT_OUTPUT, GEO_NODE_REPEAT_OUTPUT, GEO_NODE_SIMULATION_OUTPUT, ForeachGeometryElementZoneViewerPathElem::index, RepeatZoneViewerPathElem::iteration, RepeatZoneViewerPathElem::repeat_output_node_id, SimulationZoneViewerPathElem::sim_output_node_id, and ForeachGeometryElementZoneViewerPathElem::zone_output_node_id.
Referenced by viewer_path_for_geometry_node().
|
static |
Definition at line 61 of file ed_viewer_path.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), GroupNodeViewerPathElem::base, ViewerNodeViewerPathElem::base, BKE_viewer_path_elem_new_group_node(), BKE_viewer_path_elem_new_id(), BKE_viewer_path_elem_new_modifier(), BKE_viewer_path_elem_new_viewer_node(), BKE_viewer_path_init(), BLI_addtail(), BLI_assert, BLI_strdup(), blender::IndexRange::drop_back(), SpaceNode::edittree, eModifierFlag_Active, eModifierType_Nodes, SpaceNode::flag, blender::bke::bNodeTreeZones::get_zone_stack_for_node(), GS, IDViewerPathElem::id, Object::id, SpaceNode::id, ID_OB, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), LISTBASE_FOREACH, ModifierViewerPathElem::modifier_name, Object::modifiers, ID::name, blender::bke::node_find_node_by_name(), NodesModifierData::node_group, GroupNodeViewerPathElem::node_id, ViewerNodeViewerPathElem::node_id, SpaceNode::nodetree, ViewerPath::path, SNODE_PIN, tree, SpaceNode::treepath, ViewerPathElem::ui_name, viewer_path_elem_for_zone(), and blender::bke::bNodeTreeZones::zones.
Referenced by activate_geometry_node(), find_geometry_nodes_viewer(), and update_active_geometry_nodes_viewer().