Closed davidlatwe closed 4 years ago
Just patched my motivation in above comment :point_up:
And, in the following GIF you may see the difference between divider and text knob, the string knob and read-only string knob.
Note that the string knob with nuke.READ_ONLY
applied, user still able to select and copy string, but not with text knob.
Looks good! Nice work @davidlatwe
This will be merged tomorrow if no other objections :rocket:
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.read
to retrieve user-defined knobs from any given node, just like in other hosts. For layout type knob, likenuke.Tab_Knob
, divider knob (nuke.Text_Knob
with empty string value), and unnamed knob will be ignored.Backward compatible for knobs which prefixed with
"avalon:"
or"ak:"
. (Resolved this comment)Added
flags
optional arg onlib.Knobby
for setting knob flag. Current read-only string data imprinting was implemented by usingnuke.Text_Knob
. Butnuke.Text_Knob
could 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
) .