diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-12-17 13:47:55 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-12-17 13:47:55 +0300 |
commit | e3a1d044d68000a2e81b662c0cf15bbe17698aa4 (patch) | |
tree | b9f12ad7ca22073cc00f3420114d2d53f7300a55 /source/blender/editors/interface/interface_handlers.c | |
parent | 6c006b2ebbaa2d56f7dba0a036910138d864305e (diff) |
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.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a43506778d8..9604704dde8 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3499,9 +3499,14 @@ static int ui_but_menu(bContext *C, uiBut *but) //Copy Property Value //Paste Property Value - //uiItemO(layout, "Reset to Default Value", 0, "WM_OT_property_value_reset_button"); + if(length) { + uiItemBooleanO(layout, "Reset All to Default Values", 0, "UI_OT_reset_default_button", "all", 1); + uiItemBooleanO(layout, "Reset Single to Default Value", 0, "UI_OT_reset_default_button", "all", 0); + } + else + uiItemO(layout, "Reset to Default Value", 0, "UI_OT_reset_default_button"); - uiItemO(layout, "Copy Data Path", 0, "ANIM_OT_copy_clipboard_button"); + uiItemO(layout, "Copy Data Path", 0, "UI_OT_copy_clipboard_button"); uiItemS(layout); } |