[core] Simplify node descriptions #2538
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
Following #2523 which simplify the arguments to include an attribute in a node's UID computation, this PR simplifies the description of nodes with the following changes:
For
ChoiceParam
attributes, which may be exclusive (only one value among a list of several ones can be selected) or not (several values can be selected at once), theexclusive
argument is set toTrue
by default.ChoiceParam
attribute will be exclusive, and its display in the Node Editor will follow accordingly.exclusive=False
(which already was the case prior to this PR).ChoiceParam
attributes are exclusive, this simplifies writing a node's description. All the existing nodes with exclusiveChoiceParam
attributes have been updated to stop including theexclusive=True
line in their description.For
IntParam
andFloatParam
, the range that previously needed to be specified for the attribute's description to be valid is now set toNone
by default.range=(start, end, step)
, the range is checked to ensure it is valid (for example, no floating number can be specified in the range if the attribute is anIntParam
) and in case it is not, the description of the node will be rejected (as it currently is).range=None
), no check is performed on that argument and the attribute's description will be deemed valid. Instead of displaying a slider in the Node Editor that is parameterized with the provided range, a text field with no slider will be displayed. Invalid values (such as strings, or floating numbers forIntParam
attributes) are however still not allowed, and the user will not be able to input them, as is expected.range
argument of one of itsIntParam
orFloatParam
attributes.