If a pipeline is imported with the node menu instead of the "Import
Project" action from the File menu, the top-left "corner" of the graph
should be placed on the mouse's position.
The position of pipelines imported with the "Import Project" menu
remains unchanged: they are automatically placed below the lowest
node in the current graph.
When using the Edit > Paste menu, or when pressing Ctrl+V while the Graph
Editor has the focus but the mouse is not contained in it, there is no
current mouse position in the GraphEditor so the position that is provided
to the "pasteNodes" function is the last known mouse position, which is
oftentimes on the border of the GraphEditor.
This commit automatically sets the mouse's position to the center of
the GraphEditor, and "builds" the zone containing the pasted nodes around
it.
If a node is being hovered when the user performs the paste, an
offset is added to the mouse's position, both in the horizontal and
vertical directions. This aims at avoiding a complete overlap with
the nodes on top of which the clipboard content is pasted.
The mouse's position is the top-left corner of a zone in which all
the selected nodes will be pasted. The bottom-right corner of that
zone is (x, y), with x the maximum of the selected nodes' position
along the x-axis and y the maximum of the selected nodes' position
along the y-axis.
The nodes relative position to one another - if positions are provided -
is preserved.
If no node in the selection has a specified position, the nodes will
be pasted from left to right alphabetically, with the top-left corner
of the first node at the mouse's position.
If several nodes are described in the clipboard and are supposed to
be connected with each other, reconnect them together, but do not
attempt to reconnect them to the graph they were copied from, even if
it is the current graph.
Add a specific option to save a graph as a template ("Save As
Template") in "minimal" mode.
This mode only saves, for each node in the graph, the input and
output attributes whose values differ from the default ones. Any
attribute that is not serialized in the saved template file is
assumed to have its default value.
If a conflict is detected on a node when opening the template
file, it is logged but solved automatically.
The goal of this minimal mode is to prevent template files from
needing an update every single time a modification (may it be
minor or major) is done on a node description. Templates can
thus follow node changes and still be usable.
Add an "Import Scene" (Ctrl+Shift+I) option in the File menu
that allows to select an existing .mg file and import it in the
current graph.
The imported scene will automatically be placed below the lowest
existing node along the Y axis.
When creating a node with a "paste" operation, place the node
on the mouse's position in the graph instead of default position (0,0).
If the mouse is placed on an existing node, the pasted node will be
placed on the mouse's position plus an offset so that the pasted node
does not directly overlap with the existing node.
Attempt to paste the clipboard's content in the graph when Ctrl+V is
pressed. If the clipboard contains a valid node description, add the
corresponding node to the graph.
Otherwise, do nothing.
When a node is duplicated more than once in a single "duplicate"
operation, it happens that several of the duplicated nodes
overlap. This patch takes into account all the newly duplicated
(and already moved) nodes before moving them into their final
position.
## Description
Fix various typos in the source code. This includes user facing code, documentation, and source comments. This PR has not been tested.
Closes#1605
Adding new properties and updating the call to previous ones.
Properties are now :
* label : getLabel
* fullLabel : getFullLabel
* fullLabelToNode : getFullLabelToNode
* fullLabelToGraph : getFullLabelToGraph
Same for the name.
Computing: lock the undo stack at the current index to avoid going back too far and potentially alter computing process.
Submitting: clear the undo stack.
- If global stop: block restarting thread.
- If local stop: restart thread with the remaining nodes to compute.
This implementation permits to avoid app freezing when a local stop occurs.