Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-07-30 05:52:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-30 05:52:00 +0400
commit39ea55fff1e0ce362bb5e9bc958b6d651293e30d (patch)
treec94e2c02e60428d7d4115538ece8a749016501ae /source/blender/editors/interface
parent24a269a07c150d449363b455d4de89a88151d651 (diff)
Operator Copy/Paste
you can copy operator strings from buttons or the reporting interface and run them in the console. - Ctrl+C over an operator button copies its python string to the clipboard. - Paste in the console (1 line only for now). - operators run from python no longer require all arguments.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_handlers.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index da2899dd3b2..30cfafb24f8 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -961,6 +961,20 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
}
+ /* operator button (any type) */
+ else if (but->optype) {
+ if(mode=='c') {
+ PointerRNA *opptr;
+ char *str;
+ opptr= uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
+
+ str= WM_operator_pystring(but->optype, opptr, 0);
+
+ WM_clipboard_text_set(str, 0);
+
+ MEM_freeN(str);
+ }
+ }
}
/* ************* in-button text selection/editing ************* */