diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-12-21 11:53:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-12-21 11:53:36 +0300 |
commit | 4a86a07f8a8344ce7bd0dce02d8902e33d652a1a (patch) | |
tree | e56973a3da689b78c661af594bc705cd301cfbef /source/blender/windowmanager | |
parent | 449e7777f75fa030894e89bd7d6a5daa9b9502b3 (diff) |
wip operator py-api
"operator.ED_VIEW3D_OT_viewhome(center=1)" calls the operator, converting keyword args to properties.
Need a way to run scripts in the UI for useful testing.
Still need to deal with operator exceptions and verifying args against operator options.
Added temporary WM_operatortype_first() to allow python to return a list if available operators, can replace this with something better later (operator iterator?)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 19ddd43f7ec..b1209af9afe 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -114,6 +114,7 @@ void WM_error(struct bContext *C, char *str); /* operator api */ wmOperatorType *WM_operatortype_find(const char *idname); +wmOperatorType *WM_operatortype_first(void); void WM_operatortype_append (void (*opfunc)(wmOperatorType*)); int WM_operator_call (struct bContext *C, const char *opstring, int context, struct IDProperty *properties); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d69b0901bc6..11f6f8fa93a 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -77,6 +77,11 @@ wmOperatorType *WM_operatortype_find(const char *idname) return NULL; } +wmOperatorType *WM_operatortype_first(void) +{ + return global_ops.first; +} + /* all ops in 1 list (for time being... needs evaluation later) */ void WM_operatortype_append(void (*opfunc)(wmOperatorType*)) { |