Commit graph

199 commits

Author SHA1 Message Date
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
Vivek Verma
f2b033a7bb Added Pre and Post process functions on the Base Node
Added Pre and Post process functions on the Node Description which can be utilised by the client nodes
2024-09-17 09:31:17 +02:00
Candice Bentéjac
b981ef651c [core] invalidate= becomes optional and is set to True by default
This will allow to simplify node descriptions as most of the attributes
are generally invalidating. Only non-invalidating attributes will need
to state explicitly `invalidate=False`.

For output attributes, which must not be invalidating, `invalidate` will
be automatically set to `False` at the attribute-level if it is set to
`True` in the description.
2024-09-12 10:54:17 +02:00
Candice Bentéjac
41e885d9ff Linting: Clean-up files 2024-09-12 10:50:13 +02:00
Candice Bentéjac
9973298746 [core] Simplify invalidation status for all the attributes
The UID system based on a UID index is removed and replaced by a single
UID per node.

Attributes will be included in the UID computation if the `invalidate`
is set to `True` in their description. This replaces the `uid=[]` /
`uid=[0]` element of the description.
2024-09-12 10:41:53 +02:00
Candice Bentéjac
daa6e48f2c [core] Catch exception for calls to optional descriptor method on node creation
If a node's description contains invalid operations in its `onNodeCreated`
method, exceptions are thrown without being caught and cause Meshroom
to crash.

These calls are now safely tried and any encountered exception is handled.
2024-08-19 18:29:23 +02:00
Fabien Castan
a3bd0fe326 [core] node dynamic output: more precise warnings 2024-07-18 23:52:50 +02:00
Candice Bentéjac
5b07f9a393 [core] Exclude edges from InputNode nodes in dfsToProcess
If the edges of a node to submit include an `InputNode` (which cannot
be computed), then that node should be excluded from the list of edges
to process as if that node had already been computed.

This allows to submit any type of graph involving `InputNode` to the farm.
2024-07-02 12:18:35 +02:00
Fabien Castan
2d950758e3 [core] Propagate only if the node is already in a graph 2024-06-28 20:31:04 +02:00
Fabien Castan
3cc67fddfb [core] Propagate the onAttributeChanged notification to connected attributes 2024-06-28 19:56:47 +02:00
Fabien Castan
a82fe3927b [core] BaseNode: add property isInputNode 2024-06-28 19:54:48 +02:00
Aurore LAFAURIE
7af0997a73 [core] Add support for imageList as output in SequencePlayer 2024-06-20 11:54:30 +02:00
Aurore LAFAURIE
3eb90322a8 [core] Add detection of sequence semantic output 2024-06-20 11:54:29 +02:00
Fabien Castan
01874e52d3 [core] fix: uid keys are integers
During the serialization to JSON, dict keys are converted to string. We
need to convert them back to int.
2024-06-16 21:20:18 +02:00
Fabien Castan
cc6f75f2d4 [core] update UID computation to take into account the particular case of dynamic output attributes
For dynamic output attributes, the UID does not depend on the attribute
value.
In particular, when loading a project file, the UIDs are updated first,
and the node status and the dynamic output values are not yet loaded, so
we should not read the attribute value.
2024-06-16 19:05:03 +02:00
Fabien Castan
0e5be25d97 [core] remove duplicate call to updateOutputAttr
The update is done at the same place as the status update.
This is a duplicate that is not needed.
2024-06-16 18:58:00 +02:00
Fabien Castan
972d5751e1 [core] in case of CompatibilityNode the dynamic output attributes does not exist as they are not saved in the project
So we always check if they exist before accessing them.
2024-06-16 18:56:38 +02:00
Fabien Castan
77571dca38 [core] init nodes uids from project file 2024-06-16 18:54:37 +02:00
Fabien Castan
d5e356c0aa [core] New dynamic output attributes 2024-06-15 19:47:29 +02:00
Fabien Castan
bb1dde0569 [core] only format arguments if the default value is not None 2024-06-15 18:05:25 +02:00
Fabien Castan
2621fece29 [core] node: set internal attributes from the constructor 2024-06-15 18:05:24 +02:00
Fabien Castan
c972e402e7 [core] node: do not ask the node to upgrade internalAttributes
internalAttributes are managed on the Meshroom side, not at the node
level. So there is no reason to call the upgrade of internalAttributes
on the node description.
2024-06-15 18:05:24 +02:00
Fabien Castan
1dd1fdf0c5 [core] node: more explicit log 2024-06-15 18:05:24 +02:00
Fabien Castan
379e674967 [core] node: set the attribute value from the constructor 2024-06-15 18:05:24 +02:00
Fabien Castan
80238ab2da [core] change level of verbosity for Compatibility nodes
Compatibility nodes are properly displayed in the UI, no need to
continue to have a high level of verbosity for that.
2024-06-15 17:12:21 +02:00