[core] Simplify node descriptions#2538
Merged
Merged
Conversation
This simplifies the node descriptions. For multi-choice ChoiceParams, `exlusive=False` still needs to be specified.
`range` is set to `None` by default, making it optional. If it is specified, correct values are expected (e.g. only floats for `FloatParam`) and a slider will be displayed in the Node Editor. However, if it is not specified, no slider will be displayed and the value will be set at the discretion of the user. Having `range=None` will not trigger any "invalid" error in the description. It is thus not mandatory anymore to specify the valid range of values for the integer and floating attributes in node descriptions.
6 tasks
fabiencastan
approved these changes
Sep 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
ChoiceParamattributes, 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), theexclusiveargument is set toTrueby default.ChoiceParamattribute will be exclusive, and its display in the Node Editor will follow accordingly.exclusive=False(which already was the case prior to this PR).ChoiceParamattributes are exclusive, this simplifies writing a node's description. All the existing nodes with exclusiveChoiceParamattributes have been updated to stop including theexclusive=Trueline in their description.For
IntParamandFloatParam, the range that previously needed to be specified for the attribute's description to be valid is now set toNoneby 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 forIntParamattributes) are however still not allowed, and the user will not be able to input them, as is expected.rangeargument of one of itsIntParamorFloatParamattributes.