|
Blender V5.0
|
Classes | |
| struct | ViewerPathForGeometryNodesViewer |
| class | bNodeTreeZone |
| class | bNodeTreeZones |
Enumerations | |
| enum class | UpdateActiveGeometryNodesViewerResult { StillActive , Updated , NotActive } |
Functions | |
| void | activate_geometry_node (Main &bmain, SpaceNode &snode, bNode &node, std::optional< int > item_identifier=std::nullopt) |
| 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) |
| const ComputeContext * | compute_context_for_viewer_path_elem (const ViewerPathElem &elem, bke::ComputeContextCache &compute_context_cache, const ComputeContext *parent_compute_context) |
| ViewerPathElem * | viewer_path_elem_for_compute_context (const ComputeContext &compute_context) |
| static void | viewer_path_for_geometry_node (const SpaceNode &snode, const bNode &node, ViewerPath &r_dst) |
|
strong |
| Enumerator | |
|---|---|
| StillActive | |
| Updated | |
| NotActive | |
Definition at line 72 of file ED_viewer_path.hh.
| void blender::ed::viewer_path::activate_geometry_node | ( | Main & | bmain, |
| SpaceNode & | snode, | ||
| bNode & | node, | ||
| std::optional< int > | item_identifier = std::nullopt ) |
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 135 of file ed_viewer_path.cc.
References bScreen::areabase, BKE_viewer_path_clear(), BKE_viewer_path_copy(), BKE_workspace_active_get(), BKE_workspace_active_screen_get(), BLI_SCOPED_DEFER, SpreadsheetTableIDGeometry::bundle_path, SpreadsheetTableIDGeometry::bundle_path_num, SpreadsheetTableIDGeometry::closure_input_output, DEG_id_tag_update(), SpaceNode::edittree, ListBase::first, SpaceSpreadsheet::flag, View3D::flag2, GEO_NODE_VIEWER, SpaceSpreadsheet::geometry_id, GS, SpaceNode::id, ID_OB, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, MEM_SAFE_FREE, ID::name, NC_VIEWER_PATH, NODE_DO_OUTPUT, SpreadsheetTableIDGeometry::object_eval_state, SET_FLAG_FROM_TEST, SPACE_SPREADSHEET, SPACE_VIEW3D, SpaceLink::spacetype, SPREADSHEET_CLOSURE_NONE, SPREADSHEET_FLAG_PINNED, SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE, V3D_SHOW_VIEWER, SpreadsheetTableIDGeometry::viewer_item_identifier, WorkSpace::viewer_path, viewer_path_for_geometry_node(), Main::wm, and WM_main_add_notifier().
Referenced by ED_node_set_active(), blender::ed::space_node::viewer_linking::finalize_viewer_link(), blender::ed::space_node::node_activate_viewer_exec(), 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 514 of file ed_viewer_path.cc.
References blender::bke::ComputeContextCache::for_evaluate_closure(), blender::bke::ComputeContextCache::for_foreach_geometry_element_zone(), blender::bke::ComputeContextCache::for_group_node(), blender::bke::ComputeContextCache::for_modifier(), blender::bke::ComputeContextCache::for_repeat_zone(), blender::bke::ComputeContextCache::for_simulation_zone(), blender::ComputeContext::hash(), ViewerPathElem::type, VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, 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::GeoNodesLog::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 275 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_uid, Object::modifiers, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::node_path, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::object, blender::bke::bNodeTreeZone::parent_zone, ViewerPathElem::type, blender::ed::viewer_path::ViewerPathForGeometryNodesViewer::viewer_node_id, VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE, VIEWER_PATH_ELEM_TYPE_GROUP_NODE, VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, and blender::bke::bNodeTreeZones::zones.
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 486 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::draw_nodetree(), blender::ed::space_node::node_deactivate_viewer_exec(), and blender::ed::space_node::node_toggle_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 219 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, ID::name, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), ViewerPathElem::type, VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, 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::GeoNodesLog::find_viewer_node_log_for_path(), blender::ed::space_node::node_mouse_select(), 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 200 of file ed_viewer_path.cc.
References BLI_listbase_count(), GS, ID_OB, ID::name, 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 406 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, C, CTX_data_main(), DEG_id_tag_update(), SpaceNode::edittree, ELEM, ListBase::first, bNode::flag, ScrArea::full, SpaceNode::id, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, NODE_DO_OUTPUT, NotActive, NTREE_GEOMETRY, SCREENFULL, SCREENMAXIMIZED, SPACE_NODE, SpaceLink::spacetype, bScreen::state, StillActive, bNodeTree::type, ViewerPathElem::type, Updated, VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, VIEWER_PATH_EQUAL_FLAG_CONSIDER_UI_NAME, VIEWER_PATH_EQUAL_FLAG_IGNORE_ITERATION, viewer_path_for_geometry_node(), and Main::wm.
Referenced by validate_viewer_paths().
|
nodiscard |
The inverse of compute_context_for_viewer_path_elem. It helps to create a viewer path (which can be stored in .blend files) from a compute context.
Definition at line 38 of file ed_viewer_path.cc.
References EvaluateClosureNodeViewerPathElem::base, ForeachGeometryElementZoneViewerPathElem::base, GroupNodeViewerPathElem::base, ModifierViewerPathElem::base, RepeatZoneViewerPathElem::base, SimulationZoneViewerPathElem::base, BKE_id_name(), BKE_viewer_path_elem_new_evaluate_closure(), BKE_viewer_path_elem_new_foreach_geometry_element_zone(), BKE_viewer_path_elem_new_group_node(), BKE_viewer_path_elem_new_modifier(), BKE_viewer_path_elem_new_repeat_zone(), BKE_viewer_path_elem_new_simulation_zone(), BLI_assert, BLI_strdup(), DEG_is_original(), EvaluateClosureNodeViewerPathElem::evaluate_node_id, ForeachGeometryElementZoneViewerPathElem::index, RepeatZoneViewerPathElem::iteration, ModifierViewerPathElem::modifier_uid, GroupNodeViewerPathElem::node_id, RepeatZoneViewerPathElem::repeat_output_node_id, SimulationZoneViewerPathElem::sim_output_node_id, EvaluateClosureNodeViewerPathElem::source_node_tree, EvaluateClosureNodeViewerPathElem::source_output_node_id, ViewerPathElem::ui_name, and ForeachGeometryElementZoneViewerPathElem::zone_output_node_id.
Referenced by viewer_path_for_geometry_node().
|
static |
Definition at line 98 of file ed_viewer_path.cc.
References ViewerNodeViewerPathElem::base, BKE_viewer_path_clear(), BKE_viewer_path_elem_new_id(), BKE_viewer_path_elem_new_viewer_node(), BKE_viewer_path_init(), BLI_addhead(), BLI_addtail(), BLI_assert, BLI_insertlinkafter(), BLI_strdup(), blender::ed::space_node::compute_context_for_edittree_socket(), SpaceNode::edittree, GS, IDViewerPathElem::id, Object::id, SpaceNode::id, ID_OB, bNode::identifier, ID::name, ViewerNodeViewerPathElem::node_id, blender::bke::node_label(), ViewerPath::path, ViewerPathElem::ui_name, and viewer_path_elem_for_compute_context().
Referenced by activate_geometry_node(), find_geometry_nodes_viewer(), and update_active_geometry_nodes_viewer().