Preferences
-
Been figuring out how to save and load preferences for some tools and thought I'd share my testing script.
https://gist.github.com/okay-type/ce122159565cbeab320b069010fb011b
It's working, but it might not be the best way to manage a larger number of values. And I couldn't figure out what exactly 'registerExtensionDefaults' did. (edit: I think I figured out 'registerExtensionDefaults')
-
Oh, that's going to be useful. Updated my gist so I don't forget how it works. Thanks.
-
hello @okaytype,
nice example, thanks for sharing!
the individual attribute names are a good use case for
@property
:@property def savedEditTextKey(self): return self.prefKey + '.savedEditText'
then later on you can just
getExtensionDefault(self.savedEditTextKey)