Commit graph

112 commits

Author SHA1 Message Date
Candice Bentéjac
ad94effb98 [core] Values of ChoiceParam should be a list, Error message added for initialisation 2024-07-17 12:39:14 +02:00
Fabien Castan
d5e356c0aa [core] New dynamic output attributes 2024-06-15 19:47:29 +02:00
Fabien Castan
020dbecc68 [core] attribute: new initValue, independant from the resetToDefaultValue
Avoid to evaluate the default value if we don't need to.
2024-06-15 18:05:24 +02:00
Fabien Castan
0c3426250a [core] Add value type for each Attribute desc type 2024-06-15 18:05:23 +02:00
Fabien Castan
b76a3a3d25 [core] desc.Attribute: lambda are expressions 2024-05-29 23:01:41 +02:00
Fabien Castan
f1d0211758 [core] desc.Attribute: new isExpression property 2024-05-27 22:03:43 +02:00
Fabien Castan
5a60d92a09 [core] desc.ChoiceParam: more strict type checking and conversion 2024-05-27 22:03:43 +02:00
Fabien Castan
520c25349f [core] GroupAttr: no error for empty value and more explicit error message 2024-05-27 22:03:42 +02:00
Aurore LAFAURIE
82dc3fb294 [core] Implementation of InputNode that doesn't need computation 2024-05-27 22:03:42 +02:00
Aurore LAFAURIE
bb8b544550 [core] PushButton Description Conflict handled for function descripted 2024-04-25 17:01:54 +02:00
Aurore LAFAURIE
eb1a0faf97 [core] PushButton attribute implemented
Add PushButtonParam class and implement onAttributeClicked method
2024-04-24 15:29:08 +02:00
Aurore LAFAURIE
f098ede8cb [core] Add visible property to desc.py
Visible property permit to tell directly from the description of the node that we don't want to see the attribute from the node in the GraphEditor
2024-04-12 15:42:45 +02:00
Aurore LAFAURIE
eda320374b [core] Bypass validation on values for ChoiceParams 2024-04-08 12:05:05 +02:00
Aurore LAFAURIE
4d466d0630 [core] Check of value type of ChoiceParam according to first value in list
Check of value type of ChoiceParam according to first value in list.

We want to support something else than string.
2024-03-28 18:25:08 +01:00
Aurore LAFAURIE
498fd6cbd2 [core] Add new type of ChoiceParam that changes dynamically according to other values
Add new type of ChoiceParam that changes dynamically according to other
values.

When value of an attribute is changed onAttributeChanged is called,
allowing to have unique reaction within node files.

Also add of callDesc function to be able to have other functions such as
onNodeCreated at creation of node.
2024-03-28 12:06:40 +01:00
Candice Bentéjac
e6bf7e6e2d [core] Add validValue and errorMessage support for ChoiceParams
ChoiceParams can now also have their `validValue` and `errorMessage`
parameters.

The `validValueChanged` is also emitted whenever a parameter's value
changes. This ensures that the `validValue` parameter is always re-
evaluated when the attribute is updated, even if `validValue` itself does
not change.
2023-08-22 11:22:11 +02:00
Candice Bentéjac
63bd6d61cd [core] Add new desc parameters to flag attributes with erroneous values
This commit adds two new description parameters:

- `validValue`, which is true if the value of the attribute is not
erroneous (i.e. valid for the type of the attribute but invalid in the
context of that specific attribute) and false otherwise. This holds a
different significance than the "validateValue" method, which only checks
if the parameter's value is expected with respect to the attribute's type.
For example, we could want an IntParam that flags any value that is not
even: an odd integer value would successfully go through the
"validateValue" method, but would then be flagged as an invalid value
at the attribute's level.

- `errorMessage`, an attribute-specific string that contains a message
explaining why the attribute's `validValue` parameter might be set to
false.

By default, all the attributes' values are valid, and they have no error
message.
2023-08-21 16:30:11 +02:00
Candice Bentéjac
1993fc49c8
Merge pull request #2094 from alicevision/dev/bracketsForGroupAttribute
[core] Add brackets option for GroupAttribute
2023-07-04 17:31:52 +02:00
Grégoire De Lillo
5a62157cdd [core] desc/attribute: Add brackets option for GroupAttribute
Add brackets option for GroupAttribute command line value.
Brackets is a two chars string. The GroupAttribute command line value is encapsulated between the two chars. (e.g. '[]')
2023-06-30 17:33:09 +02:00
Grégoire De Lillo
b8be831310 [core] desc: Execute command-line in node folder 2023-06-30 17:26:36 +02: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
6381371e7d Display the invalidation and comment messages in the internal attributes' tooltip
The tooltip now displays both the invalidation message, followed by the
comments. The invalidation message is displayed first in bold font,
followed by an empty line and the comments in regular font.

The tooltip now appears if at least one of the invalidation or comment
messages exists.

The invalidation and comment messages are formatted with HTML tags prior
to their display. The descriptions of both attributes is also updated
to indicate which one is displayed in bold or regular font.
2023-02-15 08:36:16 +00:00
Candice Bentéjac
3bc9445615 [core] Internal attributes: move "invalidation" before "comment" 2023-02-15 08:36:15 +00:00
Candice Bentéjac
835e396d8d [core] Remove reference to pyCompatibility
pyCompatibility has been removed at the same time as Python 2 support.
2023-02-15 08:36:15 +00:00
Fabien Castan
cc3c19ba15 [core] internal attributes: update descriptions and declare "invalidation" as an advanced attribute 2023-02-15 08:36:12 +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
Fabien Servant @ TCS
06d7d96fa2
rename variable for python compliance 2022-12-08 09:33:06 +01:00
fabien servant
7e4c5db9d2 [node] move cgroup parameters to class attributes 2022-12-07 18:05:12 +01:00
fabien servant
93b98afedc [node] move cgroup properties reading in the constructor 2022-12-07 17:53:48 +01:00
mh0g
41e8643834 removed pyCompatibility 2022-12-06 16:21:21 +01:00
fabien servant
ae0ca71c1c [nodes] replace CommandLineNode with AVCommandLineNode for alicevision nodes 2022-12-06 15:07:01 +01:00
Fabien Servant
788bd7738b [core] add cgroups checks 2022-12-06 15:07:01 +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
Loïc Vital
630c6e06ec [core] non-exclusive choice param: handle string value by splitting around commas 2022-11-03 11:14:53 +01:00
Candice Bentéjac
1275975c6a [core] Check that ranges of a node's attributes are valid before loading it
For IntParam and FloatParam, which may have ranges, check before loading
the node that the non-null ranges are of the same type as the attribute.
If at least a range is not correct (e.g. "(0, 10, 0.1)" for a FloatParam,
for which "(0.0, 10.0, 0.1)" is expected), then the node is rejected (in
the same manner as when a default value is deemed invalid).
2022-09-28 10:47:00 +02:00
Candice Bentéjac
545f3a7218 [core] Check that the description of a node is correct before loading it
At Meshroom's launch, check that every node we attempt to load has a
valid description, i.e. that every parameter has a default value that
matches its parameter's type.

If there is at least one parameter with an incorrect default value,
the node is not loaded and a corresponding message will be displayed.

This prevents the user from loading erroneous nodes that may lead to
unexpected behaviours (such as a change of a node's UID between the
moment when it is written and the moment it is loaded).
2022-09-28 10:39:18 +02:00
Candice Bentéjac
659c8a05ed Add abstract InitNode
InitNode is an abstract class which is meant to be inherited
by all the initialization nodes (such as CameraInit), included
those that might be created by the user.

InitNode contains methods that can be reimplemented by the
children classes if necessary.

This abstract class allows to keep on using scripts such as
meshroom_batch without having to modify them specifically or
being limited to using a CameraInit node.
2022-08-05 10:42:59 +02:00
Candice Bentéjac
708eb85c9c Evaluate variables in nodes' string parameters 2022-07-12 09:31:37 +02:00
Fabien Castan
a62c951bf5 [core] more generic str to bool conversion 2022-04-11 16:56:38 +02:00
Grégoire De Lillo
0aa173c982 Merge branch 'develop' of https://github.com/alicevision/meshroom into dev_depthMapOptim
Conflicts:
	meshroom/core/desc.py
	meshroom/nodes/aliceVision/CameraInit.py
	meshroom/nodes/aliceVision/ImageMasking.py
2021-09-29 19:34:10 +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
dc3f4dd2be [nodes] add semantic to customize attibute UI 2021-07-19 12:03:00 +02:00
Fabien Castan
b000c6f311 [core] no cmd line range arguments if we have only a single chunk 2021-05-25 18:22:08 +02:00
Fabien Castan
8214f0a0e8 Merge remote-tracking branch 'origin/develop' into dev_depthMapOptim 2021-02-15 23:18:53 +01:00
ChemicalXandco
3d33134ca9 [ui] add support for node categories 2021-02-14 16:12:39 +00:00
Fabien Castan
f92a835b2f Merge remote-tracking branch 'origin/develop' into dev_depthMapOptim 2021-01-13 12:45:31 +01:00
Julien-Haudegond
887b33490e [core] avoid direct includes to PySide2 2020-08-13 14:24:44 +02:00