Commit graph

223 commits

Author SHA1 Message Date
Candice Bentéjac
98d90dae81 [core] plugins: Rename getNodePlugin... to getRegisteredNodePlugin...
This prevents ambiguities between `NodePlugin` objects that have been
registered (and are thus instantiable) and those that belong to `Plugin`
objects but have not been registered.
2025-06-05 14:40:11 +02:00
Candice Bentéjac
88bee35443 [core] Replace nodesDesc with the NodePluginManager instance 2025-06-05 14:40:08 +02:00
Vincent Demoulin
77cb06f322 [Core]: ExecMode is not a dynamic value 2025-06-04 22:54:30 +02:00
Fabien Servant
c95c94bd55 Fix elapsed time when there is only one chunk 2025-06-02 09:45:18 +02:00
nicolas-lambert-tc
cfd2b1e00a [ui] Attribute: Attribute actually displayed in the 3dViewer are flagged with a visibility icon (eye) 2025-05-14 17:52:42 +02:00
Fabien Castan
41738f7f40 Modernize to python-3.9+ with pyupgrade (--py39-plus) 2025-04-30 19:18:54 +02:00
Fabien Castan
1d4ba577a9 Apply flynt to use f-strings 2025-04-30 19:13:53 +02:00
Candice Bentéjac
8300626ef5 [core] Node: Clean-up code 2025-04-28 18:24:08 +02:00
Candice Bentéjac
081d38f78d Stop using bare except statements 2025-04-28 17:28:10 +02:00
Fabien Castan
ff9a0370ac Fix node states after loading
The states of nodes were not valid the first time they were loaded, but
became valid after any topological update (such as creating or removing
a node or edge).
The reason was that the loading of the graph was done before setting the
project path (and thus the cacheDir). So the status files of the nodes
were not available during the graph creation and were not updated at the
end of the load.
Now we set the filepath/cache first, so everything is right from the
start.
2025-04-14 22:45:47 +02:00
Fabien Castan
8be8ea5703 Fix display of Compatibility nodes
"isComputable" is renamed as "isComputableType": this function is only
about the Meshroom Node type and not about the computability in the
current context.

Even if we are in compatibility mode, we may has access to the nodeDesc
and its information about the node type.
2025-04-14 19:03:12 +02:00
Fabien Castan
2ad55352ee [core] declaring "global" var access is useless 2025-04-14 11:24:13 +02:00
Fabien Castan
cd219fd70e [core] more typing 2025-04-13 19:02:26 +02:00
Fabien Castan
38e82b926f [core] Add support for "3d" semantic 2025-04-13 13:09:25 +02:00
Fabien Castan
e65dc09710 [core] Simplify checks for displayable outputs 2025-04-13 13:09:24 +02:00
Fabien Castan
ca75e758be [core] improve checks for sessionUid and execMode 2025-04-13 13:09:24 +02:00
Fabien Castan
299d8f29df [core] NodeChunk: global notification for all status changes and no more separate notification for execMode 2025-04-13 13:09:24 +02:00
Fabien Castan
44ec6f0be7 [core] NodeChunk: Do not raise an error when we stop a chunk that is not running
When we stop the process of a node with multiple chunks, the Node
function will call the stop function of each chunk.
So, the chunck status could be SUBMITTED, RUNNING or ERROR.
2025-04-13 13:09:24 +02:00
Fabien Castan
ea3f87b041 [core] improve the update of the node status 2025-04-13 13:09:23 +02:00
Fabien Castan
8be90ce362 [core] node: simplify with a new method isMainNode()
And add the check about duplicates for canBeStopped/canBeCanceled.
2025-03-28 12:21:16 +01:00
Fabien Castan
4e7de577c2 [core] Init node name with non-empty unique ID 2025-03-28 12:18:00 +01:00
Fabien Castan
e54127fbf0 [core] statusNodeName change over time due to duplicates 2025-03-28 12:17:21 +01:00
Fabien Castan
75ab823c18 [core] node: udpate isExtern check 2025-03-28 12:16:40 +01:00
Fabien Castan
0c32060264 [core] node: add some typing 2025-03-28 12:15:39 +01:00
Fabien Castan
2f08448310 Rely on the nodeDesc MrNodeType 2025-03-26 11:36:39 +00:00
Fabien Castan
eb9df4c900 Explicit meshroom node type in status file
Avoid an ambiguous LOCAL_ISOLATED, as a process can be extern and using
an isolated execution environement.
2025-03-25 12:28:22 +01:00
Fabien Castan
727a4d129b New notion of local isolated computation for python nodes using meshroom_compute
Reoganization
- BaseNode: is the base class for all nodes
- Node: is now dedicated to python nodes, with the implentation directly
in the process function
- CommandLineNode: dedicated to generate and run external command lines
2025-03-24 17:59:19 +01:00
Fabien Castan
1ad526d627 [core] Use exist_ok on makedirs 2025-03-24 00:12:05 +01:00
Fabien Castan
3f69724788 Add some typing and str format 2025-03-24 00:07:58 +01:00
Fabien Castan
f665b94ca8 [core] NodeChunk: Init the subprocess variable 2025-03-24 00:07:57 +01:00
Fabien Castan
8e5f8a55d1 Add some python typing 2025-03-24 00:07:56 +01:00
Fabien Castan
830372b326 [core] saveOutputAttr directly after the processChunk 2025-03-24 00:07:56 +01:00
Candice Bentéjac
df7e6f8845 [core] Node: Status should be NONE when there is no chunk
Prior to this commit, nodes with a varying number of chunks were initialized with an empty list of chunks (as expected), but with a global status that was set to `SUCCESS` instead of `NONE`. This caused issue on the graphical side as `SUCCESS` is interpreted as the status for nodes that have been successfully computed.
2025-03-12 10:40:46 +00:00
Candice Bentéjac
8afc9adad3 [core] Node: Resolve nodeCacheFolder without cache for outputs 2025-03-05 13:36:33 +00:00
Candice Bentéjac
6cbb97d9a8 [core] Add default relative paths to the command line variables
Add 2 default entries to the command line variables:
- `nodeCacheFolder`, which contains the location of the cache folder
- `nodeSourceCodeFolder`, which contains the location of the file
describing the node
2025-03-05 13:26:53 +00:00
Candice Bentéjac
40fd46d476 [core] Node: Add a sourceCodeFolder property
This property stores the location of the source code for a given node
and is not exposed to the QML side.
2025-03-05 13:26:53 +00: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
5710bf3ed3
Merge pull request #2657 from alicevision/dev/valueChangedPropagation
Node: Propagate attribute change via `valueChanged` signal
2025-02-14 11:04:26 +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
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
025e0e3322 [core] Move nodeFactory to its own module 2025-02-06 16:46:04 +01:00
Yann Lanthony
1aea45efa3 [core] Node: Propagate attribute change via valueChanged signal
Propagate attribute value changes downstream using `valueChanged` signal
emission, instead of calling `_onAttributeChanged` directly.
This does not change the current core behavior, but it triggers the
property notification signal when in UI mode.
This makes changes happening upstream properly reflected in downstream nodes.
2025-01-21 18:55:59 +01:00
Fabien Castan
66e3dd409d
Merge pull request #2599 from alicevision/dev/qt6.6
Qt6.6.3 / PySide6.6.3.1 upgrade
2024-11-22 12:39:09 +00:00
Yann Lanthony
61d35904ba [core] Discard attribute callbacks during graph loading 2024-11-14 19:11:08 +01:00
Candice Bentéjac
fb5a882074 [qt6][core] Don't store SignalInstance in dict for node computations
When converting the `StatusData` to a dictionary, only data attributes
should be stored in said dictionary. With Qt6, the `objectNameChanged`
signal, of type `SignalInstance`, is added to the dictionary. It needs
to be removed manually as it is not JSON-serializable. Otherwise,
the nodes cannot be computed anymore.
2024-11-07 18:13:19 +01:00
Yann Lanthony
ae9ae9b11f [core] Fix connection between uncomputed output and attribute with callback 2024-10-26 23:40:21 +02:00
Yann Lanthony
0231fdc1df [core] Discard nested attribute for valueChange callback lookup 2024-10-26 23:36:26 +02:00
Yann Lanthony
7fdb5cc734 [core] Handle attribute valueChanged callback at the Node level
Move the attributeChanged callback logic within Node, as this
is a Node level mecanism (callbacks being declared on the node desc).

This commit also moves the attribute valueChanged signal outside of
the Attribute's constructor.
This seems to be the root cause to undesired side-effects breaking Qt's evaluation
system, data model access and consequently Meshroom's UI.
2024-10-26 23:35:15 +02:00
Candice Bentéjac
ff8c063597 [core] Node: Do not automatically upgrade unknown nodes in templates 2024-10-04 18:56:34 +02:00
Fabien Castan
9d301fed01
minor wording change 2024-09-18 15:52:37 +02:00