Implement Nuke's lib.read#476
Merged
Merged
Conversation
Avoid using `nuke.Text_Knob` since it could be a layout divider if the init value is an empty string.
houndci-bot
reviewed
Nov 28, 2019
Collaborator
Author
tokejepsen
approved these changes
Nov 30, 2019
Collaborator
|
Looks good! Nice work @davidlatwe |
Collaborator
Author
|
This will be merged tomorrow if no other objections 🚀 |
Merged
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.

Motivation
The Avalon data read-write methods implemented in Nuke was driven by prefixing knob name so to differ which knob is node's default and which is user-defined.
But the prefix may change, and the logic was not the same as other hosts, so if there's a way to differ user-defined and default knobs without prefixing knob name, I think we should opt that in.
Changes
For unifying host implementation and pattern, adding
lib.readto retrieve user-defined knobs from any given node, just like in other hosts. For layout type knob, likenuke.Tab_Knob, divider knob (nuke.Text_Knobwith empty string value), and unnamed knob will be ignored.Backward compatible for knobs which prefixed with
"avalon:"or"ak:". (Resolved this comment)Added
flagsoptional arg onlib.Knobbyfor setting knob flag. Current read-only string data imprinting was implemented by usingnuke.Text_Knob. Butnuke.Text_Knobcould be a layout divider if the initial value is an empty string, which could be confused with other read-only string data while reading. This change reduced the confusion by enabling knob flag setting while imprinting (e.g.nuke.String_Knob+nuke.READ_ONLY) .