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/animation/drivers.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/animation/drivers.c')
-rw-r--r-- | source/blender/editors/animation/drivers.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index bc7005b82c4..59e52c0d489 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -581,47 +581,4 @@ void ANIM_OT_paste_driver_button (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } - -/* Copy to Clipboard Button Operator ------------------------ */ - -static int copy_clipboard_button_exec(bContext *C, wmOperator *op) -{ - PointerRNA ptr; - PropertyRNA *prop= NULL; - char *path; - short success= 0; - int index; - - /* try to create driver using property retrieved from UI */ - memset(&ptr, 0, sizeof(PointerRNA)); - uiAnimContextProperty(C, &ptr, &prop, &index); - - if (ptr.data && prop) { - path= RNA_path_from_ID_to_property(&ptr, prop); - - if (path) { - WM_clipboard_text_set(path, FALSE); - MEM_freeN(path); - } - } - - /* since we're just copying, we don't really need to do anything else...*/ - return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; -} - -void ANIM_OT_copy_clipboard_button(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Copy Data Path"; - ot->idname= "ANIM_OT_copy_clipboard_button"; - ot->description= "Copy the RNA data path for this property to the clipboard."; - - /* callbacks */ - ot->exec= copy_clipboard_button_exec; - //op->poll= ??? // TODO: need to have some valid property before this can be done - - /* flags */ - ot->flag= OPTYPE_REGISTER; -} - /* ************************************************** */ |