Commit graph

157 commits

Author SHA1 Message Date
Fabien Castan
346d78df30 Adapt unittests to deal with graph saving 2025-04-13 19:02:26 +02:00
Fabien Castan
ca75e758be [core] improve checks for sessionUid and execMode 2025-04-13 13:09:24 +02:00
Fabien Castan
008d6c75ee Automatically save the project when computing or submitting to renderfarm
If the project is not saved at all, it will suggest to save it manually
or to define a project in a temporary folder using date/time for the
project name.
2025-04-13 13:09:24 +02:00
Fabien Castan
2f08448310 Rely on the nodeDesc MrNodeType 2025-03-26 11:36:39 +00:00
Fabien Castan
eb9df4c900 Explicit meshroom node type in status file
Avoid an ambiguous LOCAL_ISOLATED, as a process can be extern and using
an isolated execution environement.
2025-03-25 12:28:22 +01:00
Fabien Castan
727a4d129b New notion of local isolated computation for python nodes using meshroom_compute
Reoganization
- BaseNode: is the base class for all nodes
- Node: is now dedicated to python nodes, with the implentation directly
in the process function
- CommandLineNode: dedicated to generate and run external command lines
2025-03-24 17:59:19 +01:00
Fabien Castan
0c961a5b68 [ui] call loadOutputAttr only once (and not per chunk) 2025-03-24 00:12:05 +01:00
Fabien Castan
8e5f8a55d1 Add some python typing 2025-03-24 00:07:56 +01:00
Fabien Castan
8c6fca2a28 [ui] graph: loadOutputAttr is enough 2025-03-24 00:07:55 +01:00
Fabien Castan
78fddabe45 [ui] graph: status check simplification 2025-03-24 00:07:55 +01:00
Candice Bentéjac
bae85d65e3 [ui] Graph: In minimal refresh, do not poll files for chunks run locally
When the minimal refresh mode is on, only chunks that are running,
submitted or in error while their execution mode is external should be
polled.

Chunks that have the same status but with a local execution mode will be
correctly updated as their status changes will be notified.

The behaviour for the automatic refresh mode remains the same: all the
chunks are polled, independently from their status and their execution
mode.
2025-02-17 11:34:01 +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