Commit graph

4470 commits

Author SHA1 Message Date
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
Candice Bentéjac
91d2530401
Merge pull request #2612 from alicevision/dev/graphIO
Refactor Graph de/serialization
2025-02-12 11:49:19 +01:00
Yann Lanthony
0594f593f2 [core][graphIO] PartialSerializer: fix List/GroupAttribute link serialization
Ensure attribute input connection is serialized, even for List/GroupAttributes.
Note: while connecting GroupAttributes is not yet supported, this will benefit
this type of attribute once it is.
2025-02-06 18:19:19 +01:00
Yann Lanthony
724e7fb387 [core] Graph: add missing GraphModification
In `initFromTemplate`, ensure that Publish nodes removal are grouped
under the same graph modification to trigger updates only once.
2025-02-06 16:46:05 +01:00
Yann Lanthony
25094ac877 [core] Handle missing link nodes when deserializing edges
Avoid uncaught errors when deserializing edges in case linked
nodes are missing.
Handle missing nodes the same way missing attributes are dealt with.
2025-02-06 16:46:05 +01:00
Yann Lanthony
87fbcee06d [core][graphIO] Improve node type version handling
* Deserialization: Replace the logic that defaulted the node type version to "0.0" when unspecified,
and assume that unspecified version on a node is targetting current node type version.
* Serialization: Only serialize node type versions for which a version info is available.

* Test suites:
  * Add helper context manager to manually override the version of a given node type.
  * Add new unit tests to cover version conflicts handling is various scenarios.
2025-02-06 16:46:05 +01:00
Yann Lanthony
d9e59e330a [core] nodeFactory: fix auto-upgrade on certain compatibilty nodes
Add missing node upgrade statement to perform auto-upgrade on
CompatibilityNode when `internalFolder` is not set.
2025-02-06 16:46:05 +01:00
Yann Lanthony
e430368f15 [core] Graph: improve internal function naming 2025-02-06 16:46:05 +01:00
Yann Lanthony
0035dc56ae [core] Minor docstrings cleanup 2025-02-06 16:46:05 +01:00
Yann Lanthony
4e29b83226 [test] Extra partial serialization tests 2025-02-06 16:46:05 +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
9794f43ed1 [core] Graph: improved uid conflicts evaluation on deserialization
At the end of the deserialization process, solve node uid conflicts iteratively by node depths,
and only replace the conflicting nodes with a CompatibilityNode.

Add new test suite for testing uid conflict handling.
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
1cf0fc95ba [core][graphIO] Add "template" as an explicit key 2025-02-06 16:46:04 +01:00
Yann Lanthony
b07dd64c11 [core] Graph: cleanup unused methods 2025-02-06 16:46:04 +01:00
Yann Lanthony
bfc642e2dc [core] Add Graph.copy method
Add a new method to create a copy of a graph instance, relying on
chaining serialization and deserialization operations.
Add test suite to validate its behavior, and the underlying serialization processes.
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
f8f03b0bd5 [core] Graph: improve uid conflicts check on deserialization
Only perform uid check when we have both a serialized and a computed
UID.
If the node has not been serialized with a UID, it means that it does not
expect to match a specific value on deserialization.
2025-02-06 16:46:04 +01:00
Yann Lanthony
6b75dcb356 [core][graphIO] Introduce PartialGraphSerializer
Add a new serializer class to manage partial graph serialization logic,
ensuring to remove link expressions on attributes refering to nodes
that are not in the subset of nodes to serialize.
2025-02-06 16:46:04 +01:00
Yann Lanthony
01d67eb33d [graphIO] Introduce graph serializer classes
Move the serialization logic to dedicated serializer classes.
Implement both `GraphSerializer` and `TemplateGraphSerializer`
to cover for the existing serialization use-cases.
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
3064cb9b35 [core] CompatibilityNode: do not use link expressions as default values for unknown File attributes
When creating a compatibility description for an unknown attribute, do not
consider a link expression as the default value for a File attribute.
This is breaking how the link expression solving system works, as it's resetting
the attribute to its default value after applying the link.
If that expression is kept as the default value, it can be re-evaluated several
times incorrectly.
Added a test case that was failing before that change to illustrate the issue.
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
75db9dc16c [tests] Add extra compatibility tests
Add a new test suite for graph template loading.
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 @ TCS
ebf2270d48
Merge pull request #2665 from alicevision/fix/attrValueChangedConnection
Fix: Improve large project file loading performance
2025-02-06 15:55:35 +01:00
mhog
43ecfa7e6f
Merge pull request #2617 from alicevision/dev/mayaScript
Export Maya .mel Script
2025-02-06 11:47:02 +01:00
Fabien Servant @ TCS
8a8cb8be88
Merge pull request #2645 from alicevision/dev/extractMetadataWithExifTool
Extract more metadata using exifTool
2025-02-05 14:20:10 +01:00
Fabien Servant
534b95e771 Add log 2025-02-05 14:17:56 +01:00
Yann Lanthony
37a813e08a [core] Propagate Attribute.valueChanged to the owning Node through a Slot
Connecting the valueChanged signal to a lambda causes performance
issues with a large number of attributes when using the Pyside backend.
Connecting that signal to an intermediate Slot part of the Attribute class
improves performance dramatically.
Note: This has no comparable impact on the standalone backend.
2025-02-05 11:54:49 +01:00
Vivek
910736b3d7
Merge pull request #2659 from alicevision/ci/codecov-tests
[ci] Codecov: enable support for test run reports
2025-02-03 10:41:41 +05:30
Fabien Castan
91885afe11
Merge pull request #2658 from alicevision/dev/maskProcessing
Mask processing node
2025-01-31 20:38:31 +01:00
Vincent Demoulin
baa2e220ed [Node] ExtractMetadata: Add option to update sfmData 2025-01-31 15:56:13 +01:00
Vincent Demoulin
3e854e7b38 [Node] ExtractMetadata: Replace os.system with subprocess.Popen 2025-01-31 11:29:29 +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
Vincent Demoulin
f1d68b660c [node] extractMetadata: Add explicit error messages 2025-01-30 17:18:58 +01:00
Fabien Servant
fad39ee1f6 Mask processing node 2025-01-30 09:09:18 +01:00
Yann Lanthony
0f1cde127b [ci] Codecov: enable support for test run reports 2025-01-28 16:27:47 +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
Fabien Castan
2bd98c34fe
Merge pull request #2654 from alicevision/dev/sfmMultiMerge
Enable merge of multiple sfmDatas
2025-01-27 08:36:10 +01:00
Yann Lanthony
bd2b8926e7
Merge pull request #2655 from alicevision/fix/crashIntrinsics
[ImageGallery] Intrinsics table: Always fully instantiate the model before populating it
2025-01-24 10:37:25 +01:00
Fabien Servant
b6913084ee Enable merge of multiple sfmDatas 2025-01-23 16:09:35 +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