RNA/UI - Reset Settings to Default Values

Added a new operator for properties which resets RNA-based settings to their 'default' values, as defined in RNA. This currently only works for floats, ints, enums, and booleans (strings and pointers still need to be implemented). 

The current extensions to the RNA API that I've made here seem a bit excessive, and can be toned down if necessary. In short, I've just added accessor functions for the default-values of the property definitions.

For this to be really useful, many properties in RNA will need to get defaults defined, since the current defaults for quite a few properties tested were less than ideal.
This commit is contained in:
2009-12-17 10:47:55 +00:00
parent 6c006b2ebb
commit e3a1d044d6
8 changed files with 380 additions and 51 deletions

View File

@@ -688,6 +688,9 @@ void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func,
void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname);
void uiItemMenuEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname);
/* UI Operators */
void ui_buttons_operatortypes(void);
/* Helpers for Operators */
void uiAnimContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index);
void uiFileBrowseContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop);