Add a property that contains the path of the image that is currently
displayed in the viewer. If no image is displayed, the property is set
with an empty string.
The path information is set directly from the Viewer2D when an image is
loaded to be displayed.
In Image Gallery :
- drop 1 .mg open the scene
- drop images either create new camera or augment the reconstruction
In Graph Editor :
- drop 1 .mg open the scene
- drop images create new camera at position of mouse
Prior to this commit, when a `CameraInit` node was added to or removed
from the list of `CameraInit` nodes, the active `CameraInit` was always
reset to the first one in the list, independently from its previous
value.
This commit changes that behaviour by only modifying the active
`CameraInit` if no `CameraInit` node has been assigned yet, or if the
active `CameraInit` does not exist anymore (meaning it has been removed).
This requires to emit the `cameraInitChanged` signal every single time
the list of existing `CameraInit` nodes is modified even if the active one
is not changed, and to connect it to the ImageGallery in order to ensure
the index from the combo box always corresponds to the currently active
`CameraInit` node. Indeed, when the list of CameraInits is updated, the
model for the combo box is reset, and it needs to be re-updated with the
correct non-default value.
When parsing the input JSON file, there might be some instances where
the `poses` key, unlike the `views` and `intrinsics` keys, does not exist.
If that is the case, an unhandled exception is raised while connections
are being made, which then causes issues for the lifetime of the Meshroom
instance.
This commit checks that the key exists before trying to access it, which
prevents raising unhandled exceptions while the active project is being
set up.
As the temporary CameraInit nodes are not really part of the graph, their
attributes cannot be edited. By default, the intrinsics can be edited for
any CameraInit node from the intrinsics table.
For temporary CameraInit nodes, we want the intrinsics to be displayed in
read-only mode to ensure that the user cannot attempt to edit them, which
would cause errors.
Upon its creation, the temporary CameraInit node is locked (as if it were
computed), and the intrinsics table's component are updated to be displayed
as read-only if the CameraInit node is locked.
If a LdrToHdrMerge node does not belong to the active group but is set as
active (by loading it with a double-click), if it is connected to another
CameraInit node, and if the "Visualize HDR images" has been enabled, then
the active group should be updated to that other CameraInit node.
By updating the active CameraInit's index, not only will the Image Gallery
display the newly selected LdrToHdrMerge thumbnails (already working prior
to this commit), but the Viewer2D will also be updated to reflect the
Gallery's selected thumbnail correctly. Information provided by the Gallery
will also reflect its content, as the active group will correspond to the
shown images, which was not the case before.
"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).