Commit graph

4544 commits

Author SHA1 Message Date
Yann Lanthony
9f622a2691
Fix Meshroom UI CLI latest option
Fix invalid use of `_recentProjectFiles`  variable.
2025-02-17 22:02:54 +01:00
mhog
db62f2be96
Merge pull request #2674 from alicevision/dev/mayaExport
Add maya scene export
2025-02-17 16:09:47 +01:00
Fabien Servant
f9af052c16 Add maya scene export 2025-02-17 16:03:48 +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
Yann Lanthony
317bb65118
Merge pull request #2672 from alicevision/fix/externalMinFileWatcher
[ui] Graph: In minimal refresh, do not poll files for chunks run locally
2025-02-17 13:06:58 +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
Yann Lanthony
90acb93ea8 [core] Trigger node desc creation callback only for explicit node creation
The desc.Node.onCreated callback is a hook in the Node API for developers to
write custom behavior on a node first initialization.
By being called in the core.Node constructor, this was triggered in several situations
that don't match this idea and with unpredictable side effects (graph loading, node re-creation on undo...).

* Make `onNodeCreated` callback an explicit method on desc.Node.
* Remove the call to node descriptor's `onNodeCreated` callback outside core.Node constructor.
* Trigger this callback on explicit node creation (adding new node to graph, init a graph from a template).
2025-02-14 11:42:22 +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
Candice Bentéjac
5710bf3ed3
Merge pull request #2657 from alicevision/dev/valueChangedPropagation
Node: Propagate attribute change via `valueChanged` signal
2025-02-14 11:04:26 +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
Candice Bentéjac
91d2530401
Merge pull request #2612 from alicevision/dev/graphIO
Refactor Graph de/serialization
2025-02-12 11:49:19 +01:00
Fabien Servant
d9c5cb559e Export USD node 2025-02-10 08:53:47 +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
Fabien Servant
696ec16277 Change node names for experimental pipeline 2025-02-03 13:45:32 +01:00