maxon.NodesGraphModelInterface

Description

A maxon.NodesGraphModelRef is an implementation of maxon.GraphModelInterface which wraps a maxon.NodeSystem.
There may be more than one model working on the same maxon.NodeSystem reference, this is handled by a shared maxon.NodeSystemManagerRef.
Each maxon.NodesGraphModelRef is a certain CreateView “view” on the NodeSystem with individual filter settings and root paths.
The manager (maxon.NodeSystemManagerInterface) coordinates the accesses of the views.

maxon.NodesGraphModelClass is the base implementation of this interface.
It has to be used as base class for custom implementations.

Inheritance diagram

Inheritance

Parent Class:

Child Class:

Methods Signature

CreateView(filter, rootPath)

Creates a new view for the node system of this view.

GetBase(node)

Return the original base node.

MoveToGroup(groupRoot, groupId, selection)

Groups the selection of nodes of this graph into a new group node.

Ungroup(group)

Dissolves the given group into its children.

Methods Definition

NodesGraphModelInterface.CreateView(filter, rootPath)
Creates a new view for the node system of this view.
The returned view will be managed by the same maxon.NodeSystemManagerRef as this view.
Parameters
  • filter (maxon.NodeSystemManagerInterface.FILTER) –

    The filter to use for the view.
    If this view is read-only, the FILTER.READ_ONLY flag will be set implicitly.

  • rootPath (maxon.NodePath) –

    The absolute path to the root node of the new view.
    Use this if the new view shall not represent the whole graph, but only a node and its inner parts.
    Note that this is an absolute path, so the path of the current view is always ignored.

Returns

A new maxon.NodesGraphModelRef view for the same node system.

Return type

maxon.NodesGraphModelRef

NodesGraphModelInterface.GetBase(node)

Return the original base node.

Parameters

node (maxon.GraphNode) – The node to retrieve the NodeSystem from.

Returns

The base NodeSystem of the node.

Return type

maxon.NodeSystem

NodesGraphModelInterface.MoveToGroup(groupRoot, groupId, selection)
Groups the selection of nodes of this graph into a new group node.
groupRoot is used to set up the new group node.
You can leave this empty, then a new node system will be created as an instance of a group asset which fits to the selection (group assets already used by the selection are considered).
But you can also provide a valid node system.

All selected nodes are moved to the group using their original identifiers, including inner connections.
Afterwards the group is :MutableRoot.EndModification() “finalized” and an instance of the group is added to this graph using the given groupId.
Connections which leave the group are kept by adding ports to the group node as needed, and connecting them correspondingly.
If the used group node already has ports, these will be used where identifiers mach.
Parameters
Returns

A GraphNode referencing the added child.

Return type

maxon.GraphNode

NodesGraphModelInterface.Ungroup(group)
Dissolves the given group into its children.
This moves all children of group including their inner connections to the parent of group.
External connections (from the group to other nodes) are moved to the inner nodes as well.
Parameters

group (maxon.GraphNode) – The group node to dissolve.

Returns

The mapping from original identifiers within the group to the new identifiers used at parent level.

Return type

list[tuple[maxon.InternedId, maxon.InternedId]]