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.
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.
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.
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. '[]')
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.
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.
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.
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.
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
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
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).
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).
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.