Commit graph

162 commits

Author SHA1 Message Date
Matthieu Hog
5172f5190a added semantic logic to display multiple 3d objects
fixed pyhon case in boolean
2024-02-14 12:17:31 +01:00
Candice Bentéjac
e463f0dce2 [qml] Clean-up: Harmonize syntax across all files 2023-11-06 16:31:10 +01:00
Candice Bentéjac
0aba9a053f [ui] Don't load node's output in the 3DViewer if it has no 3D output 2023-10-26 17:15:51 +02: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
Candice Bentéjac
30cd13c7b3 [qml] Qt5.15: Disable the alternative palette to support disabled elements
Supporting the alternative palette (triggered with Ctrl+Shift+P) requires
a manual conversion from the QPalette to the QML palette, which does not
directly support disabled elements.

Keeping the previous palette management will support disabled elements,
but cause issues when switching to the alternative palette. Until both
can be fully supported, the alternative palette is disabled.
2023-07-04 12:10:28 +02:00
Candice Bentéjac
9e31981f03 [ui] Qt5.15: Update palette management
Manually convert the QPalette object to a QML Palette manually. The
conversion is not straight forward anymore, and not performing it
leads to an incomplete alternate (light) palette.

QML Palette in Qt 5.15 does not support yet disabled elements, the
support will only be enabled with Qt 6.
2023-07-04 12:04:16 +02:00
Candice Bentéjac
091346cbb8 [qml] Optimize QML files and fix syntax warnings
This commit addresses warnings that were raised by QtCreator's linter:
- IDs declared more than once
- variables declared more than once in the same scope
- type coercions
- variables declared as "var" when their type is known
- unclosed "case" in switch-case
2023-07-04 12:04:14 +02:00
Candice Bentéjac
8c494198e0 [qml] Qt5.15: Update syntax for slots
Slots now need to be written as function; the previous syntax is
deprecated.
2023-07-03 12:11:33 +02:00
Candice Bentéjac
62ba08447d [qml] Qt5.15: Upgrade all remaining modules
The upgrade concerns the following modules:
- QtCharts
- QtPositioning
- QtLocation
- QtGraphicalEffects
- QtQml
2023-07-03 12:11:32 +02:00
Candice Bentéjac
9b5dd40b02 [qml] Qt5.15: Upgrade all QtQuick modules 2023-07-03 12:11:29 +02:00
Candice Bentéjac
9570437b7f [ui] Fix "canSubmit" which relied on erroneous conditions
Remove the "canStartComputation" condition which was not used anywhere
else and was not up-to-date: since it needed more than one image and no
ongoing computations to be "True", attempting to submit several branches
of a graph would always cause it to be "False", which in turn led the
"canSubmit" condition to be "False" (causing the pop-up requesting to
save the file to appear), even though the submission should have been
possible.

The submission should be possible whenever submitters are available and
the project file has been saved.
2023-03-20 16:18:48 +01:00
Candice Bentéjac
16dfe960c6 [ui] Open a warning dialog when attempting to submit an unsaved project
A project needs to be saved in order to be submitted to the renderfarm.
Prior to this commit, attempting to submit an unsaved project would not
prompt any dialog in the UI despite the exception that was thrown on the
Python side.

A warning dialog is now opened to let the user know that the project
cannot be submitted until it is saved.
2023-03-09 18:24:38 +01:00
Candice Bentéjac
4b2857be9b [ui] Add a "Load Template" action in the "Advanced" menu
"Load Template" allows to load an .mg file as a regular project file,
without taking into account if it is a template.

If the project file is not a template, it will be opened exactly as if the
"Open File" menu had been used. If it is a template and it contains
"Publish" nodes, they will not be filtered out (whereas they will be if
the template is opened with "Open File" or through the "New" actions).
2023-03-06 11:12:05 +00: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
Candice Bentéjac
614f831457 [ui] Force nodes' status update before performing a submit/compute/delete
This ensures that each node's status is correct before being computed,
submitted, or before having its data deleted. This is especially useful
when the File Poller is in minimal node, and only monitors the nodes that
are currently submitted or running.

If a graph is being opened in two different instances of Meshroom, and
computations are started on it in one of the instances, the other one will
not be aware of it (as the signals indicating computations have started
will have been emitted in the first instance, so no chunk will be added
to the monitoring in the second one). By forcing the update of the statuses
before actually starting computations or deleting data, we ensure that
there will not be any computational conflicts (same nodes submitted twice
in farm, for example) and that the users can know at all times what they
are doing without manually triggering a refresh.

This is not critical for the "Delete Data" part, as the action can already
be triggered even with there is no data to delete, but is still useful
to keep the displayed nodes as up-to-date with their actual status as
possible.
2023-03-02 19:13:00 +01:00
Candice Bentéjac
31579f3bc0 [ui] Do not disable the manual refresh button when computations are ongoing
Only disable it if it has been clicked by the user and the refresh is not
completed yet.
2023-02-28 17:07:59 +01:00
Candice Bentéjac
5156053361 [ui] Display file watcher's current status in the MaterialButton tooltip 2023-02-28 17:07:59 +01:00
Candice Bentéjac
589ead0d64 [ui] Use a third icon for the file watcher's "enabled" status
Each file watcher's status now has its own icon:
- Enabled: "published_with_changes"
- Disabled: "sync_disabled"
- Minimal: "sync"
2023-02-28 17:07:58 +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
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
2987bf0617 [ui] Perform "Clear Images" action on the Python side instead of QML
The "Clear Images" action was performed solely on the QML side, updating
the graph with every intrinsics removal, which considerably slowed down
the whole process.

The QML action now calls a slot on the Python side, which can disable
the graph updates at every modification, thus greatly improving the speed
of the process.

As a point of comparison, clearing 511 PNG images took approximately 38s
on the QML side, against 8s on the Python side. Clearing 1000 PNG images
took 2min39 on the QML side, against 32s on the Python side.
2023-02-15 08:34:41 +00:00
Candice Bentéjac
d745c07f14 [ui] Change "Import Images" base folder behaviour if no location is saved
Prior to saving the images' locations across sessions, if no image had
been yet imported but a project file with images had been opened, the
default base folder for the session became the project images' location.
The location of dropped images back then was never saved.

Now that the locations from the "Import Images" are saved across session,
the possibilities of having no location saved have drastically decreased.
The three cases where it can happen are the following:
- the user has never opened Meshroom before (or the user has been using
Meshroom without ever using "Import Images")
- the user has cleared their Meshroom settings
- the 3 saved locations have become invalid

For these three cases, the default base folder is either set to the
location of the first dropped image or to the opened project's images.
That location is NOT saved for later sessions. Using the "Import Images"
action is necessary for the location to be saved.
2023-01-16 16:06:00 +01:00
Candice Bentéjac
1b5e33c9ef [ui] Save the last folders of imported images across sessions
Save up to 3 folder locations from which images have been imported.
These folder locations will be saved across Meshroom sessions, in
a similar fashion as the "Recent Files" entries.
If no folder location has been saved (or if all saved folder locations
are invalid), we fall back to the default behaviour: if a project with
images has been opened before the "Import Images" action is called, then
the base folder will be the folder containing the opened project's
images.
2023-01-16 15:10:28 +01:00
Candice Bentéjac
5638cf3a75 [ui] "Import Images" dialog: Use opened project's images folder as the base folder
If a project has already been opened before the "Import Images" dialog
is opened for the first time, and if the opened project has imported
images, use the location of these images' folder as the base folder for
the "Import Images" dialog.

If the opened project has no imported images, the base folder will remain
identical to the other dialogs' until images are imported.
2023-01-16 15:10:27 +01:00
Candice Bentéjac
2dc0a678a1 [ui] Save folder location of the last imported images
This commit changes the folder in which the "Import Images" dialog
opens: it used to be opened in the folder in which the last .mg file
had been opened, and it now opens in the folder from which the last
images were imported.

The location of the last imported images is saved, and used specifically
when opening the "Import Images" dialog, as opposed to all the other
dialogs which open in the folder of the last opened .mg file.
2023-01-10 12:48:44 +01:00
Candice Bentéjac
eb4ec8318c [ui] Reorganize the "File" menu
- Remove the "New" menu; the "Ctrl+N" shortcut remains valid to create
new default pipelines
- Move the "Save As Template" and "Import Project" actions into an
"Advanced" menu; their behaviour and shortcuts remain unchanged
- Add menu separators between the "Open" and "Save" functionalities,
the "Save" and "Import Images" functionalities, the "Import Images"
and "Advanced" functionalities, and the "Advanced" and "Quit"
functionalities.
2022-12-22 21:12:11 +01:00
Candice Bentéjac
02383c68b3 [ui] Check that objects accessed by QML properties are not null before accessing them
Some QML properties access exposed Python objects that may or may not
be null upon their access. When these objects are accessed while null,
QML issues "TypeError" warnings. These warnings have no functional
impact as QML correctly handles trying to access null objects, but can
spam the logs.

This commit aims at fixing all these warnings by checking that the
Python objects are not null before being accessed.
2022-12-06 11:04:50 +01:00
Loïc Vital
b829a2d9f4 [ui] tab to focus search bar + click on empty area to loose focus 2022-11-18 10:03:03 +01:00
Loïc Vital
ef62d70180 [ui] minor renamings for coherence 2022-10-31 13:51:47 +01:00
Loïc Vital
49d0ad9a4f [ui] fix crash when importing images with non-ascii characters in path 2022-10-28 14:54:29 +02:00
Loïc Vital
400c68a40a [ui] do nothing when double clicking attribute 2022-10-19 09:50:16 +01:00
Loïc Vital
6b7d4d66a8 [ui] prevent loading image output attributes in 3D viewer 2022-10-19 09:50:15 +01:00
Loïc Vital
9de858efe4 [ui] minor code cleanup 2022-10-19 09:50:13 +01:00
Loïc Vital
f90942bd2d [ui] only load in 2D viewer nodes that output images 2022-10-19 09:50:12 +01:00
Loïc Vital
592dc1121e [ui] check node is computed or running before loading in viewer2D 2022-10-19 09:50:10 +01:00
Loïc Vital
a574c0fc9b use semantic field in file attributes to specify images and store displayed node in 2D viewer to adapt UI 2022-10-19 09:50:08 +01:00
Loïc Vital
fc5ab540f5 added outputImageTypes in node desc to update the viewer2D imageType combo box when double clicking a node 2022-10-19 09:50:07 +01:00
Fabien Castan
243c278bcc
Merge pull request #1778 from alicevision/dev/lv/useLastPathForOpenSave
Use most recent project as base folder for file dialogs
2022-09-28 23:06:54 +02:00
Candice Bentéjac
58784fb6ff [ui] Restrain the "copy/paste nodes" shortcuts to the GraphEditor
If a Ctrl+C or Ctrl+V shortcut is performed outside the GraphEditor,
the performed action should not be a copy or a paste of the nodes, but
the own copy/paste of the current element (e.g. if a Ctrl+C is made on
on the NodeEditor, then the copied element should be the one selected
in the NodeEditor, not the currently selected node).
2022-09-26 09:56:28 +02:00
Loïc Vital
d0fcb67d1c [ui] rename Import Scene to Import Project for coherent naming 2022-09-23 11:22:36 +02:00
Loïc Vital
f4352e5254 [ui] file dialogs: use most recent project dir instead of system default 2022-09-23 09:39:22 +02:00
Loïc Vital
a5c18606bc use most recent project as base folder when using Open action 2022-09-22 16:42:46 +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
ac4cb11c3d [ui] Reload the list of templates after "Save As Template" 2022-09-06 09:43: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
ede24713d0 Add "Copy" and "Paste" actions in the "Edit" menu
Also add a "Copy Node(s)" option in the nodes' right click menu.
2022-08-25 11:32:37 +02:00
Candice Bentéjac
578c1f01c0 [ui] Generate the "New Pipeline" menu based on the found project files
The "New Pipeline" menu is automatically filled with the list
of the project files that were found dynamically. Pipelines can thus
be initialized with templates without restarting Meshroom app.
2022-07-13 18:20:34 +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