Commit graph

101 commits

Author SHA1 Message Date
Candice Bentéjac
c2570ca0fb [ui] GraphEditor: Import pipeline on the mouse's position with the node menu
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.
2022-12-02 18:13:17 +01:00
Candice Bentéjac
021770a424 [ui] Center pasted nodes in GraphEditor when it does not contain the mouse
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.
2022-10-03 11:13:52 +02:00
Loïc Vital
d0fcb67d1c [ui] rename Import Scene to Import Project for coherent naming 2022-09-23 11:22:36 +02:00
Fabien Castan
27faf9f77c
Merge pull request #1758 from alicevision/dev/copyPasteNode
Support copying/pasting a node in the Graph Editor
2022-09-08 17:42:12 +02:00
Candice Bentéjac
61e0482a21 Add an offset to the position of pasted nodes if a node is hovered
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.
2022-09-08 15:21:57 +02:00
Candice Bentéjac
9f1b866e78 Paste the selected nodes relatively to the mouse's position
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.
2022-09-06 15:40:59 +02:00
Candice Bentéjac
d06acf6722 Reconnect copied/pasted nodes together but not to the graph
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.
2022-09-06 11:13:29 +02:00
Candice Bentéjac
c44b2a8c00 Add "minimal" mode for template files
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.
2022-09-06 09:43:19 +02:00
Candice Bentéjac
a33f79e4d7 Import a scene from an .mg file into the current graph
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.
2022-08-31 10:50:35 +02:00
Candice Bentéjac
e11452efdb Extend copy/paste support to selections containing multiple nodes 2022-08-25 11:08:57 +02:00
Candice Bentéjac
5b65866e49 [ui] Paste a node on the mouse's position
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.
2022-08-19 12:02:09 +02:00
Candice Bentéjac
ddda62a652 Add node to graph with Ctrl+V if valid node content is in the clipboard
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.
2022-08-19 12:00:16 +02:00
Candice Bentéjac
751bad96c6 Copy selected node's content to the clipboard when Ctrl+C is pressed
When Ctrl+C is pressed while a node selected, its content is formatted
to JSON and copied to the system's clipboard.
2022-08-19 11:31:31 +02:00
Candice Bentéjac
819d9e3e70 Prevent duplication/removal a node more than once in the same action 2022-07-28 14:13:38 +02:00
Candice Bentéjac
c4c8b5c8d5 [ui] Vertically align duplicated nodes correctly
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.
2022-07-28 14:13:38 +02:00
luz paz
f4dcf6557f Fix various typos in the source code
## 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
2022-01-22 07:39:05 -05:00
Nils Landrodie
db299d49ee [python] Remove trailing whitespaces 2021-09-14 18:07:30 +02:00
Landrodie
9b753cc358 [Python Graph] Expose modification group methods 2021-09-14 18:07:26 +02:00
Landrodie
79955ddae6 [core] Change attribute name and label properties
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.
2021-08-23 17:52:40 +02:00
Fabien Castan
90f184d65e [ui] fix: ensure that the computing status is always correct
Avoid to get a "stop" button when there is nothing currently computing.
2021-05-26 00:12:50 +02:00
Fabien Castan
18be350e6f
Merge pull request #1227 from ChemicalXandco/box_select
[ui] add support for selecting multiple nodes at once
2021-05-03 23:42:11 +02:00
ChemicalXandco
fdfabf0066 [ui] GraphEditor: use entire node selection when handling '_ from here' operations 2021-04-18 14:33:17 +01:00
ChemicalXandco
e8a5491178 [ui] GraphEditor: select duplicated nodes and select following nodes on alt + left click 2021-04-14 23:14:51 +01:00
ChemicalXandco
3ea721a2ed [ui] GraphEditor: allow replacing edges 2021-04-09 16:28:15 +01:00
ChemicalXandco
55b16bc6d3 [tests] update node duplication test 2021-02-03 22:29:31 +00:00
ChemicalXandco
acf1bf2116 [ui] grapheditor: explicitly pass selected nodes argument 2021-01-26 21:13:16 +00:00
ChemicalXandco
c253e7d363 [ui] add support for selecting multiple nodes at once 2021-01-15 18:16:45 +00:00
Fabien Castan
a17bc3d5f4 [ui] graph: minor code change for readability 2021-01-04 13:49:14 +01:00
Fabien Castan
bdb0cadc39 [ui] graph: fix missing argument 2020-12-30 18:41:01 +01:00
Fabien Castan
d291fcc39d [core] graph: use new dependenciesOnly option on graph operations
Input attribute to input attribute connection is not a real dependency between the nodes.
2020-12-14 19:02:49 +01:00
Julien-Haudegond
b567d8ff5c [core] Graph: change default reverse direction in dfsOnDiscover() 2020-09-04 12:42:05 +02:00
Julien-Haudegond
208749d897 [core] Graph: change signature of dfsOnDiscover() 2020-09-04 12:22:20 +02:00
Julien-Haudegond
f8bd40ad38 [core] Graph: rename nodesFromNode() to dfsOnDiscover() 2020-09-04 11:49:45 +02:00
Julien-Haudegond
3f3a6c0e83 [core/bin] Submitting: remove a duplicate function and move another one 2020-09-03 18:23:55 +02:00
Julien-Haudegond
5f444e6810 [ui] Commands: handle undo stack while computing and submitting
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.
2020-09-02 11:30:12 +02:00
Julien-Haudegond
e0389ad957 [ui] move UndoStack and TaskManager instantiations into app.py 2020-08-31 17:43:17 +02:00
Julien-Haudegond
58790e3bce [core] TaskManager: restart/block thread when stop computing
- 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.
2020-08-31 13:13:59 +02:00
Julien-Haudegond
f502625c0b [core] TaskManager: change removeNode() and add containsNodeName() 2020-08-31 11:38:50 +02:00
Julien-Haudegond
eaad870fc4 [ui] Graph: remove useless _execute method 2020-08-27 12:24:33 +02:00
Julien-Haudegond
79e1c69d5d Merge remote-tracking branch 'origin/develop' into dev/nodesAndTaskManager 2020-08-24 15:19:31 +02:00
Julien-Haudegond
ba1994deb9 [core/ui] replace and remove depending/required nodes methods 2020-08-24 11:59:03 +02:00
Julien-Haudegond
f41565f26b [ui] Graph: stop and cancel node computation 2020-08-20 16:20:55 +02:00
Julien-Haudegond
b9e68b7c3e [ui] Graph: change setGraph and clear 2020-08-17 11:45:17 +02:00
Fabien Castan
bab908d2eb Merge branch 'develop' into dev/nodesAndTaskManager 2020-07-30 10:56:19 +02:00
Fabien Castan
a15bb93def [ui] auto layout when no position on nodes 2020-07-17 20:48:02 +02:00
Fabien Castan
0e434908a5 [ui] improve open recent files
* fix path conversion on windows
* remove invalid paths from the list on error
* explicit error message for "No Such File"
2020-03-17 14:07:00 +01:00
Yann Lanthony
b883bd193b [core] taskManager: code cleanup 2020-01-24 18:46:32 +01:00
Yann Lanthony
991aca989b Merge develop into dev/nodesAndTaskManager 2020-01-24 14:54:08 +01:00
Yann Lanthony
79d35ac5e3 [ui] Node: display Attribute labels instead of technical names 2020-01-24 12:00:35 +01:00
Fabien Castan
a0d6d23191 [ui] add option to save the new project file from the command line 2020-01-15 20:12:53 +01:00