Commit graph

196 commits

Author SHA1 Message Date
Aurore LAFAURIE
d98d7f259e [ui] setSfm only depends on nodes with category "sfm" and CameraInit should be set only if it is different from the currrent one 2024-07-23 12:09:12 +02:00
Aurore LAFAURIE
60b067210b [ui] Fix Camera Init Group Index should stay the same at adding or removing CameraInit events 2024-07-22 17:23:34 +02:00
Candice Bentéjac
cfb44d8b54 [ui] Add currentViewPath property
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.
2024-06-27 17:28:25 +02:00
Candice Bentéjac
2bcf9d432c [core] Graph: Remove selectedViewpoint property
The information that this property conveys will be accessible at an upper
level and is thus redundant here.
2024-06-27 15:04:53 +02:00
Candice Bentéjac
2973672b20 [ui] Update the graph's viewpoint whenever the selected viewpoint changes 2024-06-20 15:47:04 +02:00
Fabien Castan
3451c3e9cd [ui] add log when loading new project file 2024-06-16 21:32:37 +02:00
Fabien Castan
09318ff055 [ui] Add missing ApplyCalibration in sfmData group 2024-06-15 19:35:02 +02:00
Fabien Castan
4e83b0dc7d [ui] resetActiveNodePerCategory only in graph updates
quit early in onCameraInitChanged to avoid useless reset of active nodes
2024-06-15 19:34:39 +02:00
Fabien Castan
df70f99256 [ui] remove useless duplicated graph updates 2024-06-15 19:32:42 +02:00
Fabien Castan
020dbecc68 [core] attribute: new initValue, independant from the resetToDefaultValue
Avoid to evaluate the default value if we don't need to.
2024-06-15 18:05:24 +02:00
Fabien Castan
d2c3ac6e26 [ui] minor: on project load failure add the fullpath to the project file in the log 2024-06-15 17:43:20 +02:00
Fabien Castan
1958b5f8c0 [ui] change the management of ActiveNodes 2024-06-15 17:41:05 +02:00
Fabien Castan
36cf19eeda [ui] Remove sfmTransfer from the sfm category for now 2024-06-15 17:15:08 +02:00
Fabien Castan
79af1d6fa7 [ui] try/except when accessing node parameters
Parameters may not exists on old project files
2024-06-15 17:14:09 +02:00
Aurore LAFAURIE
09525a364e [ui] Auto Update CameraInit when displaying node 2024-06-15 00:13:43 +02:00
Aurore LAFAURIE
dc4891cc43 [core] Prevent from getting last SfM node if graph has dirty topology 2024-06-13 17:56:59 +02:00
Aurore LAFAURIE
926db43625 [nodes/ui] Fix ExportAnimatedCamera outputs for ScenePreview use 2024-06-04 11:34:03 +02:00
Fabien Castan
45fd86e51b
Merge pull request #2396 from alicevision/fix/getLatestSfMNode
[ui/core] Fix get latest SfM node for previz
2024-06-01 11:37:21 +02:00
Fabien Castan
7e0a841ef5
Merge pull request #2398 from alicevision/dev/imageOverlayUsingExportAnimatedCamera
[ui] Use ExportAnimatedCamera output for image overlay in Viewer3D
2024-05-31 19:47:59 +02:00
Aurore LAFAURIE
e63c2df2a8 Compare last saved date before saving to prevent overwrite 2024-05-27 16:43:00 +02:00
Aurore LAFAURIE
f6332efa7e [ui] uvCenterOffset set according to principal point corrected or not + undistorted image path resolve according to output value of node 2024-05-23 12:30:00 +02:00
Aurore LAFAURIE
663b6b66d4 [ui/core] Order last node of type according to node's depth and name 2024-05-17 10:27:32 +02:00
Aurore LAFAURIE
ad7745a7c5 [ui] Undistorted images depend now also on ExportAnimatedCamera if exists 2024-05-02 14:53:49 +02:00
Aurore LAFAURIE
4e8c0c2cf8 [ui/core] Fix get latest SfM node for previz 2024-04-30 15:42:08 +02:00
Aurore LAFAURIE
5afb9cb2c8 [ui] Sync Viewer3D according to updateSelectedViewpoint 2024-04-10 19:39:36 +02:00
Candice Bentéjac
04a7191b15 [ui] Simplify error dialog titles and capitalize first letters 2024-04-05 18:06:23 +02:00
Aurore LAFAURIE
9f96f68a95 [ui] Cosmetic modifications
Cosmetic modifications such as missing spaces.
2024-03-28 11:28:31 +01:00
Aurore LAFAURIE
b74cada8ef [ui] save after drag&drop: meshroom scenes detected as separated type of file
In FilesByType, new attribute meshroomScene allowing to detected
separately the meshroom scenes from the other types of file.
2024-03-28 11:28:30 +01:00
Aurore LAFAURIE
58e9bafa45 [ui] save after drag&drop: split of handling types and processing files
First get type of files, then either ensure the save or process files.
2024-03-28 11:28:30 +01:00
Aurore LAFAURIE
67fbf1b00f [ui] drag&drop: common behavior for graph editor and image gallery
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
2024-03-28 11:28:29 +01:00
Fabien Servant
a0dc87c19b Bug threadpool 2023-12-29 12:28:33 +01:00
Candice Bentéjac
a606a8f83c [ui] Only update active CameraInit and its index when they are changed
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.
2023-10-03 18:11:55 +02:00
Candice Bentéjac
7fc52f2028 [ui] Check for the existence of the poses key before accessing it
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.
2023-09-15 17:12:39 +02:00
Loïc Vital
4c58d4b93f [ui] new concept of pickedViewId to scroll in 2D viewer without constantly updating selectedViewId 2023-07-12 09:13:51 +02:00
Loïc Vital
8a3daed543 [ui] sequence player: draw cached frames indicator 2023-07-12 09:13:50 +02:00
Candice Bentéjac
cef8cf6fd8
Merge pull request #1924 from alicevision/mug/refactoQtAV
[ui] Reflect changes made in QtAliceVision refactorize PR
2023-05-26 14:57:36 +02:00
Loïc Vital
2bf1a5f809 [ui] Viewer2D: notion of feature/match provider nodes for features viewer 2023-05-10 17:17:58 +02:00
Candice Bentéjac
76329b88e0 [ui] Update input to the KeyframeSelection node when a video is dropped 2023-04-12 15:01:14 +02:00
Loïc Vital
8d68f17410 [ui] MFeatures: use viewId from active cameraInit only (not all cameraInits) 2023-03-22 15:43:54 +01:00
Candice Bentéjac
59be396244 [ui] Prevent editing the intrinsics of temporary CameraInit nodes
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.
2023-03-15 10:00:19 +01:00
Candice Bentéjac
4001c4fc3e [ui] Update active CameraInit's index when loading a LdrToHdrMerge node
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.
2023-03-13 15:57:23 +01:00
Loïc Vital
31b04092a0 [ui] update QML properties after changes in qtAV 2023-03-08 17:18:03 +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
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
1576bfd43d [ui] Check that viewpoints still exist before accessing their metadata
The metadata value of the viewpoint is meant to be a string, but if the
viewpoint attribute has already been removed and does not exist anymore,
then the metadata value becomes a PySide property.

When trying to access that property, an exception is raised. This commit
avoids raising exceptions in that case by checking that the viewpoint
attribute still exists (the metadata value is a string instance) before
accessing the metadata value.

This fixes the "Failed to parse Viewpoint metadata: 'the JSON object must
be str, bytes or bytearray, not Property'" warning raised by the exception
which occurred every single time there was a switch between cameraInit
groups that had been cleared.
2023-02-15 18:01:40 +01:00
Fabien Castan
1fc2b228af
Merge pull request #1896 from alicevision/fix/dragDropImages
[ui] Drag&Drop: Use a pool of threads for asynchronous intrinsics computations
2023-02-14 21:23:27 +01:00
Candice Bentéjac
246843a769 [ui] Reconstruction: Use a ThreadPool for asynchronous computations
When importing images, the intrinsics were (re)built asynchronously in
a thread that was not attached to anything. The update of the intrinsics,
performed in the main thread following a signal emitted in the detached
thread, would block when there were already some existing intrinsics
because the garbage collector would destroy the thread in which the
new intrinsics had been computed while the update was ongoing.

This commit adds a ThreadPool to the Reconstruction object, and uses it
to perform the intrinsics computations asynchronously. The update of the
intrinsics thus does not remain blocked and images can be imported safely,
either though the "Import Images" menu or through drag & drop.

The "Update Intrinsics" button, which appears when the dialog to edit the
sensor database is on display, also uses the ThreadPool to recompute the
intrinsics when requested.

The "runAsync" method, which spawned a thread without attaching it to
anything, is removed. The "importImagesAsync" method, whose only goal
was to call "runAsync" on "importImagesSync", is also removed. Instead,
the pool of threads is directly used to call "importImagesSync"
asynchronously.
2023-02-14 17:26:36 +01:00
Candice Bentéjac
b5fab79e09 [ui] Import images asynchronously with the "Import Images" menu action
Loading images with the "Import Images" menu action is a blocking
operation that might freeze the app if there are many images to import.

This commit performs the import asynchronously (similarly to what is done
when images are dropped in the Image Gallery): Meshroom remains unusable
while the images are imported and the intrinsics built (which is a wanted
behaviour), but it does not freeze at all.
2023-02-14 17:23:29 +01:00
mugulmd
a52aeabedb [ui] 3D viewer: correct field of view using orientation tag 2023-02-06 08:37:30 -08:00
mugulmd
205ff22b74 [ui] apply orientation tag to 3d scene to match 2d viewer 2023-02-06 06:09:37 -08:00