AttributeEditor: Flag attributes with invalid values #2141
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces two new parameters in the description of Int, Float and String attributes:
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 thecontext of that specific attribute) and false otherwise. This holds a different significance than the "validateValue()" method, which only checks if the attribute's value is correct with respect to its 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'svalidValue
parameter might be set to false.With these new parameters, attributes that have an invalid value will be flagged directly in the Attribute Editor as follows:
Finally, this PR sets
validValue
anderrorMessage
in the HDR fusion nodes (LdrToHdrSampling
,LdrToHdrCalibration
andLdrToHdrMerge
) for theuserNbBrackets
attribute so that any user-set bracket value that is not a multiple of the number of input images is flagged down.For example, if the user manually sets
userNbBrackets
to 3 when there are 28 input images, the attribute will immediately appear as invalid:Features list
validValue
anderrorMessage
parameters to the description of Int, Float and String attributes;userNbBrackets
attribute in the HDR Fusion nodes when its value is not a multiple of the number of input images.