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".
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.
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.
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
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.
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.
"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).
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.
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.
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.
"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.
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.
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.
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.
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.
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.
- 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.
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.
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).
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.
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.
## 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