New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config mechanism for plug defaults #1038
Comments
This occures using NodeMenu.setPlugDefaultValues( node ) Fixes GafferHQ#1038.
I've got a commit with this working (referenced above), but I haven't made a pull request yet, because I don't like that the entire thing is in You can register a default like this: and it will be applied when creating the node via the menu. Scripts could also apply the defaults using |
I think "defaultValue" is a potentially confusing name, since we already have real default values, and what we're actually doing here is overriding them. Methods starting with "set" should always have a corresponding "get" method as well, so that name is a little confusing. How about we call the metadata entry "userDefault"? And how about we make a new NodeAlgo.py file and add a method called I think it's only a matter of time before we want this functionality in C++, but it's a bit of a pain to implement there, so I'm happy to keep it in Python for now. Now we have user defaults, I think we can reconsider the Dispatcher registry mechanism again. The objection to registering creators rather than instances was that it prevented startup files from collaborating, each changing only some settings. Now, each file can set some user defaults, but not others, and we get the collaboration we want. |
Nodes created via the NodeMenu apply default values to their plugs, using the "userDefault" key in the Metadata. Fixes GafferHQ#1038.
It should make sense to use the
Metadata
to specify the values, since that already implements a per-plug-per-node registry. TheNodeMenu
would apply them, and there'd be a simple method somewhere to allow the same to be done explicitly within a script.The text was updated successfully, but these errors were encountered: