Commit graph

151 commits

Author SHA1 Message Date
waaake
cca0bb1a77 [ui] Graph: Remove unused moveNodesBy function
With Selection approach on children of backdrop, selected nodes can directly be moved without having the need for a specific function
2025-02-13 07:44:11 +01:00
waaake
5fb7636f41 [ui] Graph: Using Grouped UI Graph Modification to disable animation for qml elements
Used graph's disabledAnimation flag to halt the animations when a backdrop node is resized during an undo.
2025-02-13 07:40:32 +01:00
waaake
8050a6e8e8 [ui] GraphEditor: Added flag for holding the animation state for the UI Graph
The disableAnimation flag would be used in the UI to control when an Animation is to occur
2025-02-13 07:40:32 +01:00
waaake
302753e9f9 [ui] GraphEditor: Grouped the visual resize of a Node and reposition
When dragging a backdrop node from the left side the node has to be moved and resized at the same time and the same needs to be done when an undo is performed, in order to do that with a single undo, a grouping is necessary for the two operations
2025-02-13 07:40:31 +01:00
waaake
fce662b7f0 [ui] Graph: Added Functionality to modify node position and dimensions 2025-02-13 07:20:07 +01:00
Yann Lanthony
d54ba012a0 [ui] Refactor node pasting using graph partial serialization
Re-implement node pasting by relying on the graph partial serializer,
to serialize only the subset of selected nodes.
On pasting, use standard graph deserialization and import the content
of the serialized graph in the active graph instance.

Simplify the positioning of pasted nodes to only consider mouse position
or center of the graph, which works well for the major variety of use-cases.
Compute the offset to apply to imported nodes by using the de-serialized
graph content's bounding box.
2025-02-06 16:46:04 +01:00
Yann Lanthony
a665200c38 [core] Introducing new graphIO module
Move Graph.IO internal class to its own module, and rename it to `GraphIO`.
This avoid nested classes within the core Graph class, and starts decoupling
the management of graph's IO from the logic of the graph itself.
2025-02-06 16:46:04 +01:00
Yann Lanthony
7eab289d30 [core] Graph: initial refactoring of graph loading API and logic
* API
Instead of having a single `load` function that exposes in its API
some elements only applicable to initializing a graph from a templates,
split it into 2 distinct functions: `load` and `initFromTemplate`.
Apply those changes to users of the API (UI, CLI), and simplify Graph
wrapper classes to better align with those concepts.

* Deserialization
Reduce the cognitive complexity of the deserizalization process
by splitting it into more atomic functions, while maintaining the
current behavior.
2025-02-06 16:46:04 +01:00
Yann Lanthony
944ff15002 [ui] Additive mode for select following Nodes
Implement additive selection behavior when selecting downstream
nodes from a node, using Alt+Shift+Click.
2024-12-09 11:16:33 +01:00
Yann Lanthony
a3268f456c [ui] Graph: cleanup unused function 2024-12-06 10:14:50 +01:00
Yann Lanthony
67bd43e040 [ui] Graph: remove selectedNodes model
Expose `getSelectedNode` that relies on the QItemSelectionModel
for imperative code in QML that still requires to access the
selected node instances.
2024-12-06 10:14:50 +01:00
Yann Lanthony
cdfa6186b1 [ui] Graph: Add clearSelectedNodesData method
Convenient function to directly work on the current node selection.
2024-12-06 10:14:50 +01:00
Yann Lanthony
686927a92d [ui] Graph: add removeSelectedNodes method
Add and use an explicit method to remove the currently selected nodes
in a graph.
2024-12-06 10:14:43 +01:00
Yann Lanthony
05eabb2b13 [ui] Graph: Node selection refactor (1)
Switch selection management backend to a QItemSelectionModel,
while keeping the current 'selectedNodes' API for now.
Use DelegateSectionBox for node selection in the graph, and
rewrite the handling of node selection / displacement.
2024-12-06 10:13:51 +01:00
waaake
233bbb76c8 [ui] Graph: Updating the way how color gets set on the selected nodes
Coloring the nodes now uses setAttribute command instead of relying on refrences to Nodes within the graph.
2024-11-28 09:28:36 +05:30
waaake
d77b7a398a [ui] Coloring a Node: Added ColorSelector to the Graph Editor
The color selector in the Graph Editor provides a quick way to color nodes with predefined palette of colors.

Added Command to allow the Coloring to be undone and redone using QUndoStack
2024-11-25 09:22:14 +05:30
Candice Bentéjac
579371fd7c [qt6] Replace all PySide2/shiboken2 imports by PySide6/shiboken6 2024-11-07 18:08:54 +01:00
Aurore LAFAURIE
1ec8c9c7ad [ui] Fix Collapse error
It comes from the update of the edges so we need to update the array of allSrc correctly.
2024-09-02 17:08:04 +02:00
Aurore LAFAURIE
0d346ab2da [ui] Value of current edge iteration and TaskManager protected 2024-09-02 17:08:04 +02:00
Aurore LAFAURIE
0d397b4baf [ui] Reset ListAttribute connected as for loop remove also edges in one element of undo stack 2024-09-02 17:08:03 +02:00
Fabien Castan
f84654b2ae [ui] Graph.canExpandForLoop: fix corner case 2024-09-02 17:08:03 +02:00
Fabien Castan
2456350dc5 [ui] Graph: fix expand/collapse 2024-09-02 17:08:03 +02:00
Aurore LAFAURIE
1f995c23d6 [ui] While expanding for loop, first reconnect to first element of list and then expand 2024-09-02 17:08:01 +02:00
Aurore LAFAURIE
019e137386 [ui/core] First version of For Loop implementation
If you connect a list to an attribute, you can iterate over the list as a for loop
2024-09-02 17:08:01 +02:00
Aurore LAFAURIE
78fb0114e4 [ui] Create empty graph and handle new Camera Init or KeyFrameSelection 2024-08-26 16:21:27 +02:00
Fabien Castan
438b84a8bc [ui] update the dynamic output attributes when the status of a chunk has changed 2024-07-18 23:54:08 +02:00
Aurore LAFAURIE
887844541c Compute or Submit selected nodes 2024-07-17 16:08:00 +02:00
Candice Bentéjac
48e4c68e61 [ui] Graph: Connect all chunks when setting a graph for the first time
This was initially done after a call to `graph.update()`, but as the
calls to the entire update have been reduced to avoid processing stuff
we do not need to process, the chunks are never connected when opening
a project, meaning the progress bar remains invisible until an explicit
call to `graph.update()` is done.
2024-07-01 11:53:00 +01:00
Fabien Castan
d5e356c0aa [core] New dynamic output attributes 2024-06-15 19:47:29 +02:00
Fabien Castan
df70f99256 [ui] remove useless duplicated graph updates 2024-06-15 19:32:42 +02:00
Aurore LAFAURIE
155a9e3bd9 [ui] Update of accessor for intrinsics in removeImage 2024-05-14 11:53:00 +02:00
Aurore LAFAURIE
c50d3cc9e7 [ui] Add removeImage function in Python to check for intrinsic still used 2024-05-13 09:48:24 +02:00
Fabien Servant
a0dc87c19b Bug threadpool 2023-12-29 12:28:33 +01:00
Candice Bentéjac
66ffe017a4 [ui] Rename "Clear Images" actions into "Remove All Images"
Update the names of the commands that remove images in the "File"
menu to match with those in the Image Gallery menu.

"Clear Images" becomes "Remove All Images" and "Clear All Images" becomes
"Remove Images From All CameraInit Nodes".
2023-10-11 18:07:18 +02:00
Fabien Castan
63bb3fcf2a
Merge pull request #1812 from alicevision/dev/fileWatcherStatus
Add new file watcher behaviours
2023-03-05 14:08:05 +01:00
Fabien Castan
ce2085faad
Merge pull request #1744 from alicevision/dev/internalAttributes
Add internal attributes in "Notes" tab
2023-03-05 13:46:47 +01:00
Fabien Castan
ea323edb83
Merge pull request #1897 from alicevision/dev/improveClearImages
[ui] Improve "Clear Images" action's behaviour and performance
2023-03-03 20:12:25 +01:00
Candice Bentéjac
5bc269bfda [ui] Distinguish monitorable and monitored chunks
When all the chunks were always monitored, no distinction was needed
between chunks that could be monitored and chunks that were monitored.

Now that the minimal refresh mode exists, the distinction is needed.
In particular, when only some chunks are being monitored, it is necessary
to know precisely which ones are to be able to match correctly the status
files with the polled times.
2023-03-01 16:13:58 +01:00
Candice Bentéjac
7c43446452 [ui] Graph: remove unused Python imports 2023-02-28 17:07:57 +01:00
Candice Bentéjac
c3108bc16f [ui] Add a minimal auto-refresh mode for the file watcher
The default auto-refresh mode of the file watcher checks, every 5 seconds,
every single chunk's status, which may be overkill. Instead of simply
disabling the file watcher, this commit adds a third option that checks,
every 5 seconds, the status of submitted and running chunks. If no chunk
is currently submitted or running, then the file watcher's thread keeps
on running but does nothing.

Additionally, the file watcher is automatically disabled by default if
Meshroom is started without a submitter.
2023-02-28 17:07:57 +01:00
Candice Bentéjac
84715b5105 [ui] Add a button to disable/enable the file watcher
By default, the file watcher polls every single node's file every 5
seconds, independently from their status. This commit adds a button
in the GraphEditor to disable or enable the file watcher at will.
2023-02-28 17:07:56 +01:00
Candice Bentéjac
99b82e601f Ignore "Publish" nodes when loading a template unless specified otherwise
This commit adds an option to the "load" method, "publishOutputs", that
determines whether "Publish" nodes in a template project file should be
ignored during the graph's creation.

If "publishOutputs=True", then the "Publish" nodes from the template will
be added to the graph. "Publish" nodes in a project file that is not
a template will not be affected by this and will always be added to the
graph, as any other node.

This allows to have templates that are compatible with meshroom_batch,
which requires a "Publish" node when the --output option is specified,
while not having unneeded nodes in the UI or unneeded operations:
when --output is specified in meshroom_batch, "publishOutputs=True",
otherwise it will be set to False so that the "Publish" nodes are not
executed needlessly.
2023-02-27 18:34:51 +01:00
Candice Bentéjac
43f439be88 [ui] Add a "Clear All Images" action and update "Clear Images"'s behaviour
"Clear Images" used to clear the intrinsics and viewpoints for all the
existing CameraInit nodes in the graph. There was no-user friendly way
to clear the images of a specific CameraInit node.

This commit modifies the behaviour of "Clear Images" so that it only
deletes the intrinsics and viewpoints of the current CameraInit. A new menu
action, "Clear All Images", is added in the "Advanced" sub-menu, and
deletes all the intrinsics and viewpoints for all the CameraInit nodes.

The way images are cleared is also modified: instead of removing the
intrinsics and viewpoints attributes, they are reset. To be undone
properly, a corresponding "ClearImagesCommand" has been added. This offers
a great performance increase (clearing 1000 images now takes 1s).

Tooltips have been added to make the distinction clearer for users.
2023-02-22 13:24:32 +01:00
Candice Bentéjac
7688b94ce5 [core] Raise compatibility issue if nodes miss invalidating internal attributes 2023-02-15 08:36:14 +00:00
Fabien Castan
ffca9c68e3
Merge pull request #1824 from alicevision/dev/submitterJobTitles
[submitters] Add an option to update the job title on submitters
2022-12-05 16:22:33 +01:00
Fabien Castan
8ce2ac6fe8
Merge pull request #1832 from alicevision/fix/graphLocalComputations
[ui] Correctly determine if a graph is being computed locally and update nodes' statuses accordingly
2022-12-05 16:20:58 +01:00
Candice Bentéjac
eac43c84c3 [submitters] Add an option to update the job title on submitters 2022-12-05 15:23:10 +01:00
Candice Bentéjac
6a36da61cf [ui] GraphEditor: select pipelines imported through the node menu
Add all the nodes from a pipeline imported through the node menu to the
node selection.
This involves changing the return value of ImportProjectCommand from a
boolean to a list of imported nodes.
2022-12-02 18:19:56 +01:00
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
b08f83552e [ui] Clear locally submitted nodes before loading a new graph
When loading a new graph while the opened one was locally computing nodes,
computations were automatically stopped to be able to load the new graph.
However, the computing chunks' status were not being updated before
the graphs were switched up. This meant that opening that previously
computing graph again would lead to a display in which nodes appeared to
be computing although there was no ongoing computations.
2022-11-28 10:06:57 +01:00