Introduce a new `saveValuesOverride` parameter on desc.ChoiceParam to define
whether to serialize the list of possible values if they have been overridden at runtime.
Connecting the valueChanged signal to a lambda causes performance
issues with a large number of attributes when using the Pyside backend.
Connecting that signal to an intermediate Slot part of the Attribute class
improves performance dramatically.
Note: This has no comparable impact on the standalone backend.
With valueChanged signal being connected outside of the
Attribute's constructor, the emitSignals logic is not required to prevent
early valueChanged propagation.
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.
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.
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.
The attributes' descriptions already have a `type` property which is
set with `self.__class__.__name__`. Instead of performing the same call
directly within the attributes, the `type` property of the description
is used.
In case a description would not have a standard type (i.e. anything that
may differ from the class name), this information will be propagated at
the attribute level instead of being lost.
If attribute is disabled but has output connections, it becomes grey.
If the connection is removed while being disabled, it hides itself.
Both is working in GraphEditor on the nodes and in the AttributeEditor.
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.
For instance, on the Meshing node "outputMesh" param expression is:
value="{cache}/{nodeType}/{uid0}/mesh.{outputMeshFileTypeValue}",
So the extension here should not contains quotes.
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.
...for node attributes and 3D inspector
- add search bar for node attributes
- add search bar for 3D inspector
- improve attributes filtering by adding more flexibility
and fixing some issues
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.
- "pyCompatibility.basestring" are replaced by standard Python3 "str"
- "Sequence" and "Iterable" from "collections" are now directly imported
with "collections.abc"
If an attribute is a link, when checking whether its value is
the default value, only the resolved value should be compared
with the default one. Otherwise, the attribute's "isDefault"
property will always evaluate to True, even when a non-default
link has been provided.
This issue was especially evident with input File attributes,
for which the default value is generally '' (empty string); if a
link was set as a value (thus non-empty), its unresolved value
would still be '', thus setting the "isDefault" property to True.
Adding new properties and updating the call to previous ones.
Properties are now :
* label : getLabel
* fullLabel : getFullLabel
* fullLabelToNode : getFullLabelToNode
* fullLabelToGraph : getFullLabelToGraph
Same for the name.