Commit graph

130 commits

Author SHA1 Message Date
Fabien Castan
c6d0933d4f [core] Value need to be exposed without quotes to allow to compose simple expressions
For instance, on the Meshing node "outputMesh" param expression is:
value="{cache}/{nodeType}/{uid0}/mesh.{outputMeshFileTypeValue}",

So the extension here should not contains quotes.
2024-02-02 20:14:15 +01:00
demoulinv
a7fc167512 [core] String formatting of parameters with/without quotes to deal with spaces in strings
We have the problem of spaces in file paths, choices (like colorspace),
etc.
An empty list is not send to the command line.
An empty string is send to the command line as "".
Add new unit test to ensure it follows the expected rules.
2024-02-01 18:28:51 +01:00
Candice Bentéjac
f51bf18a25 [core] Only update the running chunk to STOPPED when stopping computations
Chunks of that node that are already in the `SUCCESS` state will not be
updated, and those that are `SUBMITTED` but not `RUNNING` will be reset
to `NONE`.
2023-11-24 17:10:53 +01:00
Candice Bentéjac
49c11a9b9a NodeEditor: Add the default name of the node next to the label
If a node has a user-set label (defined through the internal attributes
of the node), its default name (the one that is displayed if no label
has been set) will be displayed next to it.

This allows to find quickly the correspondence between the node's label
and its type / how it is referred to in the current graph's file.
2023-07-20 16:28:33 +02:00
Loïc Vital
b6e22398f5
Merge pull request #2038 from alicevision/fix/nodeTypeInUid
[core] Include the node's type in the UID computation
2023-06-16 15:58:57 +02:00
Candice Bentéjac
7cb13905a1 [core] Handle UidConflict compatibility issues in node factory
The `UidConflict` is not detected per se within the node factory as a
node's UID cannot be computed accurately from there, since its expressions
(which may impact the UID computation) have not been resolved yet.

Instead, the `UidConflict` is detected externally, and the information
is transferred to the node factory, which will create a corresponding
compatibility node with the regular process.

The created `UidConflict` compatibility node will be handled by the
Compatibility Manager like any other compatibility node.
2023-06-15 19:08:52 +02:00
Candice Bentéjac
85021dbd08 [core] Add a description for the UidConflict compatibility issue 2023-06-15 18:29:41 +02:00
Candice Bentéjac
55d30ee1e3 [core] Add the node's type in the UID computation
This prevents getting the same UID for two nodes which are of different
types but have an identical list of attributes.
2023-06-13 15:00:10 +02:00
Candice Bentéjac
0c22bbb097 [core] Add property to know if node's outputs can be loaded in 3D Viewer 2023-06-13 14:45:59 +02:00
Candice Bentéjac
58748021aa [core] Notify changes on the enabled property of output attributes 2023-06-12 12:42:43 +02:00
Candice Bentéjac
36609bfc3b [core] Add property to know if node's outputs can be loaded in 2D Viewer
Add a property that is set to True if at least one of the node's output
attributes has the "image" semantic and can thus be loaded in the 2D
Viewer.
2023-06-09 17:32:05 +02:00
Candice Bentéjac
2b232b0c85 Viewer2D: Update list of loaded node's outputs when they are en/dis-abled
When a node with viewable output attributes is loaded, the combo box  of
the 2D Viewer lists these attributes. As some of these attributes are
enabled or disabled, they need to be added or removed from that list,
without needing to load another node first, or to unload the node.

This commit connects the signal that is emitted when an output attribute
with a viewable output is enabled or disabled to the slot that reloads
the currently loaded node (and thus updates the list).
2023-06-09 14:22:59 +02:00
Fabien Castan
25c12bbc51
[core] Node: hasInternalAttribute does not support groups and lists
hasInternalAttribute() should not support more cases than internalAttribute()
2023-02-22 12:04:00 +01:00
Candice Bentéjac
311ab9cb40 [core] Add a property to ignore an attribute during the UID computation
By default, an attribute that belongs to the UID group 0 is taken into
the node's UID computation independently from its value, as long as it is
enabled.

When such an attribute is added to a node's list of attributes, it
automatically invalidates all computations made for this node prior to
its addition.

This commits adds a new attribute property, "uidIgnoreValue". This property
determines whether the attribute must be taken into consideration during
the node's UID computation: if the value of the attribute is the same as
"uidIgnoreValue", then it should be ignored; otherwise, it should be taken
into account. By default, "uidIgnoreValue" is set to "None", meaning that
any attribute that may be considered during the UID computation will be
taken into account.

In the context of the internal attributes, "uidIgnoreValue" is set to empty
string, so the "invalidation" attribute will not automatically
invalidate 100% of the nodes from existing graphs until its value is set
to a non-empty string.
2023-02-17 15:34:39 +01:00
Candice Bentéjac
4b7a548687 Notify changes in internal attributes' properties
The "label", "color" and "comment" properties are not constant anymore,
their changes in value are notified with the internalAttributesChanged()
signal, like the "invalidation" property.

This implies that the connection on "internalAttributesChanged" on the
QML side is not needed anymore.
2023-02-15 08:36:16 +00:00
Candice Bentéjac
492e4d5dd0 [core] Add property for the invalidation message from internal attributes 2023-02-15 08:36:15 +00:00
Candice Bentéjac
7688b94ce5 [core] Raise compatibility issue if nodes miss invalidating internal attributes 2023-02-15 08:36:14 +00:00
Candice Bentéjac
3689c12e9c [core] Check existence of group or list attributes correctly
"hasAttribute" was previously never called before attempting to
access an attribute. With the addition of internal attributes, we
want to check the attribute's/internal attribute's before accessing
it to avoid KeyError exceptions. "hasAttribute" (and the newly added
"hasInternalAttribute") would not parse the attribute's name before
checking for its existence, meaning that errors could be generated for
list or group attributes as their checked name could contain other
elements (e.g. "featuresFolder[0]" for a ListAttribute named
"featuresFolder").
2023-02-15 08:36:13 +00:00
Candice Bentéjac
1015ea448a [ui] Add an icon and tooltip on a node's header if it has a comment
If the "Comments" internal attribute is filled, add a corresponding
icon in the node's header, as well as a tooltip that contains the
comment.
2023-02-15 08:36:13 +00:00
Candice Bentéjac
b645db99f7 [core] Include internal attributes in the UIDs computation 2023-02-15 08:36:12 +00:00
Candice Bentéjac
930af07966 [core] Correctly load internalAttributes in compatibility mode 2023-02-15 08:36:11 +00:00
Candice Bentéjac
21d01acc9a Add "color" as an internal attribute
Setting this attribute allows the user to change the color
of a node, either by directly providing an SVG color name or an
hexadecimal color code, or by picking a color with the selector.
2023-02-15 08:36:11 +00:00
Candice Bentéjac
330382ab0c Add "label" as an internal attribute
Setting the "label" internal attribute allows to give a custom
label to replace the node's default label.
2023-02-15 08:36:10 +00:00
Candice Bentéjac
9bc9e2c129 Add "Notes" tab with "comment"/"invalid comment" attributes
Add two internal attributes, "Comment" and "Invalid comment", in
a specific "Notes" tab, which will contain any further internal
attribute. Internal attributes exist for all nodes.
2023-02-15 08:36:10 +00:00
Candice Bentéjac
9a956df4d4 [core] Check all chunks' execution mode to determine if a node is external
Prior to this commit, a node was considered external if its first chunk's
execution mode was EXTERN. In some cases, a node can be submitted
externally but have its first chunk's execution mode as LOCAL.

This can occur if computations are started locally then stopped and
resumed externally. If any chunk completed its computations locally,
then its execution mode will remain LOCAL, even if the node is submitted
externally later on.

A node is now considered external if at least one of its chunks'
execution mode is external.
2023-01-05 17:13:20 +01:00
Candice Bentéjac
45d3f202fc Display the "Computed Externally" icon whenever the node runs externally
A node running externally used to mean it was running on a submitter.
This definition has been extended and a node is now considered to be
external if it is running on a submitter or running in another instance
of Meshroom. The "Computed Externally" is updated to reflect that
change.
2023-01-05 16:44:55 +01:00
Candice Bentéjac
8bef398bed Remove workarounds and backports for Python 2 support
In particular:
- In common/, remove the backport of weakref.WeakMethod
- In docs/ and ui/, use the standard FileNotFoundError class
- Use built-in open() instead of io.open(), and stop importing io
- In core/stats.py, use the standard implementation of xml.etree instead
of the C one
2022-12-05 17:16:21 +01:00
Candice Bentéjac
635f85e7fd Remove all references to pyCompatibility
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
2022-12-05 17:16:21 +01:00
Candice Bentéjac
89b89d09c0 [core] Treat a chunk as external if it is computed locally in another session 2022-12-05 15:42:57 +01:00
Candice Bentéjac
b08f83552e [ui] Clear locally submitted nodes before loading a new graph
When loading a new graph while the opened one was locally computing nodes,
computations were automatically stopped to be able to load the new graph.
However, the computing chunks' status were not being updated before
the graphs were switched up. This meant that opening that previously
computing graph again would lead to a display in which nodes appeared to
be computing although there was no ongoing computations.
2022-11-28 10:06:57 +01:00
Loïc Vital
b91d0b372e [ui] only load nodes in Viewer2D when at least one chunk is finished 2022-10-19 09:50:18 +01:00
Loïc Vital
a574c0fc9b use semantic field in file attributes to specify images and store displayed node in 2D viewer to adapt UI 2022-10-19 09:50:08 +01:00
Loïc Vital
fc5ab540f5 added outputImageTypes in node desc to update the viewer2D imageType combo box when double clicking a node 2022-10-19 09:50:07 +01:00
Fabien Castan
ee20136f82
Merge pull request #1764 from alicevision/dev/displayComputeTime
[ui] Display computation time for "running" or "finished" nodes
2022-09-10 00:27:34 +02:00
Candice Bentéjac
5542516ba4 [ui] Display computation time for "running" or "finished" nodes 2022-09-09 16:36:43 +02:00
Candice Bentéjac
c44b2a8c00 Add "minimal" mode for template files
Add a specific option to save a graph as a template ("Save As
Template") in "minimal" mode.

This mode only saves, for each node in the graph, the input and
output attributes whose values differ from the default ones. Any
attribute that is not serialized in the saved template file is
assumed to have its default value.
If a conflict is detected on a node when opening the template
file, it is logged but solved automatically.

The goal of this minimal mode is to prevent template files from
needing an update every single time a modification (may it be
minor or major) is done on a node description. Templates can
thus follow node changes and still be usable.
2022-09-06 09:43:19 +02:00
Fabien Castan
290e0278e9 [core] fix: filter attributes after the node upgrade
Values from removed attributes may be used in the node's upgrade code.
2021-09-03 22:12:25 +02:00
Thomas Zorroché
45bed69672 [nodes] change default mesh format to obj 2021-09-03 21:13:20 +02:00
Thomas Zorroche
dc1ca91a31 [core] node: warning on lambda evaluation 2021-09-03 21:13:18 +02:00
Fabien Castan
5ab6ed8e52 [core] Improve project files upgrade
- upgrade groups with changes in params
- new upgradeAttributeValues per node
2021-08-13 16:07:14 +02:00
Fabien Castan
18be350e6f
Merge pull request #1227 from ChemicalXandco/box_select
[ui] add support for selecting multiple nodes at once
2021-05-03 23:42:11 +02:00
Fabien Castan
6972d37639 [core] avoid access to invalid node desc for CompatibilityNode 2021-02-12 18:15:46 +01:00
Fabien Castan
79e4a59e8c [core] fix clearSubmittedChunks 2021-01-28 19:56:25 +01:00
Fabien Castan
5e7b044d13 [core] fix StatusData inheritance 2021-01-28 19:44:44 +01:00
Fabien Servant
1993114178 [core] more robust check of "status" file 2021-01-25 17:38:33 +01:00
Fabien Castan
078120696a [ui] GraphEditor: fix some readOnly regarding CompatibilityNodes 2021-01-22 14:30:33 +01:00
Fabien Castan
831443c29d [ui] NodeEditor: refactor ChunksList and add global stats 2021-01-22 11:38:53 +01:00
ChemicalXandco
c253e7d363 [ui] add support for selecting multiple nodes at once 2021-01-15 18:16:45 +00:00
Fabien Castan
d3d17ec6dd [core] node: fix missing function argument to getInputNodes 2020-12-28 17:31:48 +01:00
Fabien Castan
d291fcc39d [core] graph: use new dependenciesOnly option on graph operations
Input attribute to input attribute connection is not a real dependency between the nodes.
2020-12-14 19:02:49 +01:00