Commit graph

1897 commits

Author SHA1 Message Date
Candice Bentéjac
2c06ea4870 [GraphEditor] Use attribute's evaluated value for "Open File"
Otherwise, input attributes with variables (either environment ones
or local ones) cannot be opened through "Open File", even though "Open
Containing Folder" works fine.
2025-03-05 13:36:34 +00:00
Yann Lanthony
634197583c [ui] AttributeEditor: Generic TextField param editor improvements
* Use disabled text color when attribute is readonly.
* Improved UX: text cursor on mouse hovering.
* Simplify context menu handling.
2025-02-26 15:24:21 +01:00
Yann Lanthony
5a66087eac
Merge pull request #2680 from alicevision/fix/jsParamInjection
[qml] Fix QML warnings when dropping project files into the Graph Editor
2025-02-25 17:39:18 +01:00
Yann Lanthony
fb3c1b5718
Merge pull request #2678 from alicevision/fix/emptyPipelineMenu
[GraphEditor] Only display "Pipelines" menu when templates are available
2025-02-25 17:38:47 +01:00
Yann Lanthony
cdb25e28df [ui] Application: fix save-as dialog not working properly (Qt6.7+)
Since Qt 6.7, type annotations are enforced at runtime.
Typing the `sourceSaveDialog` as Dialog (or Platform.FileDialog) breaks the value received by the function and its behavior.
2025-02-21 18:18:15 +01:00
Candice Bentéjac
bfb9ee3272 [GraphEditor] Convert file to string before testing its extension
This fixes the "Property 'endsWith' of object file xxx is not a function"
warning.
2025-02-20 11:06:07 +01:00
Candice Bentéjac
e214868d81 [ui] Fix injections into signal handlers with JS functions 2025-02-20 11:06:06 +01:00
Candice Bentéjac
1fbf42a3f4 [GraphEditor] Only display "Pipelines" menu when templates are available
In the node menu (displayed when pressing "Tab" or right-clicking in the
Graph Editor), the "Pipelines" menu entry used to be displayed even if
there was no available template (the entry would open to display an
empty list).

This commit adds a check to ensure that the "Pipelines" menu is only
added to the node menu if there is at least one template that is
available. Otherwise, it is not displayed.
2025-02-19 15:14:27 +01:00
Candice Bentéjac
96a9757f5c [ui] app: Register components to QML before instantiating the engine 2025-02-18 18:15:19 +01:00
Yann Lanthony
9f622a2691
Fix Meshroom UI CLI latest option
Fix invalid use of `_recentProjectFiles`  variable.
2025-02-17 22:02:54 +01:00
Yann Lanthony
4b1226e8ea
Merge pull request #2673 from alicevision/fix/chunksWarnings
[qml] Fix QML warnings related to chunks
2025-02-17 13:07:25 +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
Candice Bentéjac
3e6aabc795 [qml] Handle cases where a chunk is undefined 2025-02-14 17:29:04 +01:00
Candice Bentéjac
b7716ef1bd [GraphEditor] Remove "common.js" and use Utils.Colors instead 2025-02-14 17:19:11 +01:00
Candice Bentéjac
6ee3b01177
Merge pull request #2656 from alicevision/dev/choiceParamUI
UI: Redesign ChoiceParam UI component
2025-02-14 11:40:15 +01:00
mhog
ff921d622a
Merge pull request #2664 from alicevision/dev/changeDefaultSfm
Create new pipeline for testing modular sfm
2025-02-14 09:04:15 +01:00
Yann Lanthony
ccc77c3153 [ui] FilterComboBox: rework filtering behavior
Reverse relationship between combobox and filter field.
- Make textfield filter the main active focus item
that forwards its key event to the combobox.
- Make sure highlighted item is always valid.
- Block combobox validation when the filter is invalid.
2025-02-13 18:42:58 +01:00
Yann Lanthony
583088035b [ui] FilterComboBox: fix issue clicking on last menu item
Disable the horizontal scrollbar in the popup menu that was
interfering with mouse click selection on the last item.
Also, remove the unneeded Layout policy on the root ColumLayout
of this popup's contentItem.
2025-02-13 11:40:09 +01:00
Yann Lanthony
212384bd1c [ui] GraphEditor: redesign non exclusive ChoiceParam control
* Move the control to its own file.
* Add support for displaying custom values (elements outside the predefined possible values).
2025-02-13 11:40:09 +01:00
Yann Lanthony
ba272eddc7 [ui] GraphEditor: Move ChoiceParam control to its own file
Start modularization of attribute controls for better readability
and maintenance.
Make Choice control independent from the MeshroomUI API.
2025-02-13 11:40:09 +01:00
Yann Lanthony
cfc2979653 [ui] Redesign exclusive ChoiceParam UI component
Simplify the FilterComboBox to rely on the default behavior
provided by the ComboBox control.
Improve the filtering system and the ability to set a custom value.
Turn to a more declarative approach with regard to handling
value update and its mapping to the combobox's current index.
2025-02-13 11:40:09 +01:00
Yann Lanthony
bb20786802 [commands] UpgradeNode.undo: only set expected uid when "downgrading" UidConflict
Only set the expectedUid when undoing the upgrade of a uid conflicting node.
Otherwise, let the other type of conflicts take precedence.
2025-02-06 16:46:04 +01:00
Yann Lanthony
45ef4b592d [core] Graph: add replaceNode method
Factorize the logic of replacing a node with another one and re-creating
output edges into `Graph.replaceNode`  and `Graph._restoreOutEdges`.
2025-02-06 16:46:04 +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
4aec741a89 [core] Graph: add importGraphContent API
Extract the logic of importing the content of a graph within a graph instance from
the graph loading logic.
Add `Graph.importGraphContent` and `Graph.importGraphContentFromFile`
methods.
Use the deserialization API to load the content in another temporary graph instance,
to handle the renaming of nodes using the Graph API, rather than manipulating
entries in a raw dictionnary.
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
c883c53397 [core] Refactor nodeFactory function
Rewrite `nodeFactory` to reduce cognitive complexity,
while preserving the current behavior.
2025-02-06 16:46:04 +01:00
Yann Lanthony
025e0e3322 [core] Move nodeFactory to its own module 2025-02-06 16:46:04 +01:00
Fabien Servant
ad61a0141e add SfM Nodes to meshroom types list 2025-02-03 13:16:18 +01:00
Yann Lanthony
cf189fd57b
Merge pull request #2637 from alicevision/dev/optimRecentProjects
[ui] Refactor the access to the list of recent project files
2025-01-30 17:34:34 +01:00
Yann Lanthony
e51bb93bf0
Merge pull request #2650 from alicevision/fix/CrashingEdge
[ui][fix] Edge: Fixing an issue with mouse event on Custom EdgeMouseArea causing Crash
2025-01-27 12:22:42 +01:00
waaake
870dcf4edb [ui] Edge: Updated curveScale to use standard property binding for EdgeMouseArea 2025-01-27 16:48:00 +05:30
Fabien Castan
2eb30fec15
Merge pull request #2652 from alicevision/dev/NodeLayout
Enable Fitting of selected Nodes in the Graph Editor when Fit is invoked
2025-01-27 08:40:59 +01:00
waaake
49ceb6e78c [ui] Edge: Removed Qt.binding on curveScale 2025-01-23 10:42:28 +05:30
waaake
3a0d167bce [ui][fix] Edge: Updated Overridden geometryChanged -> geometryChange
With Qt6 the geometryChanged method was updated to be called as geometryChange and with that update QQuickItem was not getting internal updateShape to get invoked upon updates
2025-01-23 10:41:52 +05:30
Candice Bentéjac
7c9a869d99 [ImageGallery] Use palette's colors for the text of the intrinsics display 2025-01-22 20:14:20 +01:00
Candice Bentéjac
f1a83628a6 [ImageGallery] Do not fill intrinsics model until it has been instantiated
In some cases, like when opening the most recent file from the command
line, switching the color palette or hot reloading, the intrinsics
might be parsed and ready to populate the intrinsics' `TableModel` while
the model itself is being instantiated.

To prevent crashes, we forbid operations on the `TableModel` until it has
been fully instantiated.
2025-01-22 20:09:23 +01:00
Candice Bentéjac
935f5d07db [ImageGallery] Remove version number from Qt.labs.qmlmodels import 2025-01-22 20:03:48 +01:00
Candice Bentéjac
59afac317d [ui] app: Rewrite thumbnail retrieval and handle more exceptions 2025-01-22 15:52:22 +01:00
Candice Bentéjac
18a0bdf8f3 [ui] app: Rename _getRecentProjectFiles function
It is renamed to `_getRecentProjectFilesFromSettings`.
2025-01-22 14:50:28 +01:00
Candice Bentéjac
de7777f8b0 [ui] app: Don't read QSettings again when updating thumbnails for projects
There is no need to read the QSettings again as the content of
`self._recentProjectFiles` reflects their content accurately and they
do not store any thumbnail-related information.

QSettings will now only be read once, upon Meshroom's start.
2025-01-22 14:50:27 +01:00
Candice Bentéjac
041c643be6 [ui] app: Add a dedicated function to retrieve thumbnails
Instead of doing it directly within the `_getRecentProjectFiles` method,
add a function that attempts to retrieve a thumbnail corresponding to
an input project file path.
2025-01-22 14:50:26 +01:00
Candice Bentéjac
edfe872227 [ui] Homepage: Only request thumbnails update if Homepage is active view 2025-01-22 14:50:26 +01:00
Candice Bentéjac
73de823eb4 [ui] app: Add a slot to refresh the thumbnails of recent project files
When the list of recent project files is updated, there is no attempt
to retrieve its thumbnail as the update is said to be "minimal".

This minimal update is justified by the lack of use for the thumbnails
in the Application part of Meshroom. Thumbnails are only useful when
displaying the Homepage, hence their retrieval during Meshroom's
initialization. There is only a need to update them once we want to
display the Homepage again.

The Homepage thus requests an update of the thumbnails before setting
its model. If there have been some updates to the list of recent project
files, the reading of the QSettings is performed again and thumbnails
are retrieved whenever it is possible. Otherwise, nothing happens to
prevent useless readings.
2025-01-22 14:50:25 +01:00
Candice Bentéjac
2ab3ca24c8 [ui] app: Refactor the recentProjectFiles property
The property itself only accesses a list instead of reading the QSettings
every single time it is called.

It is set once during the application's launch with a full reading, and
is then updated without performing extra reading operations every time
a file is added to or removed from the list.
2025-01-22 14:50:25 +01:00
waaake
a5e6d61730 [ui] GraphEditor: Added Fit to Selected Nodes in the Graph
Pressing F or invoking GraphEditor.fit() now considers the selected nodes and fits/focusses on the overall selection if present, else fits/focusses all of available nodes
2025-01-21 09:45:46 +05:30
Candice Bentéjac
8640ac7e4d [ui] app: Remove unused QtCore import 2025-01-20 15:52:46 +01:00
Candice Bentéjac
6071a914bc
Merge pull request #2646 from alicevision/dev/AutoLayoutMenu
[ui] Moved Auto-Layout Depth Settings under Graph Editor Menu
2025-01-17 14:42:54 +00:00
waaake
bf857bc6e4 [ui] GraphEditor: Setting the drag.smoothed property of the MouseArea to false when the selection is started
Setting the drag.smoothed to false ensures that the target will be moved straight to the current mouse position
2025-01-15 16:20:38 +05:30