diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-01 23:44:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-01 23:44:40 +0300 |
commit | 112385660aeefbd503b128c91a3c7fc09d1e6d5a (patch) | |
tree | 3db61ae0103dab6ba41bdfbf015ccb8b05bba0d6 /source/blender/windowmanager/intern/wm_keymap.c | |
parent | ddabed9c9625f7109b703ed88c88247bfb14aaba (diff) |
RNA
* Object has some more properties wrapped, mostly game related.
* Scene frame changes now send a notifier.
* Added functions to create/free operator properties for calling
operators. This also simplifies some duplicated code that did
this. Ideally though this kind of thing should use the properties
pointer provided by buttons and keymap items. Example code:
PointerRNA ptr;
WM_operator_properties_create(&ptr, "SOME_OT_name");
RNA_int_set(&ptr, "value", 42);
WM_operator_name_call(C, "SOME_OT_name", WM_OP_EXEC_DEFAULT, &ptr);
WM_operator_properties_free(&ptr);
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index eac51559269..3a05a319e8a 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -84,15 +84,9 @@ static void keymap_event_set(wmKeymapItem *kmi, short type, short val, int modif static void keymap_properties_set(wmKeymapItem *kmi) { - wmOperatorType *ot; - if(!kmi->ptr) { - ot= WM_operatortype_find(kmi->idname); - - if(ot) { - kmi->ptr= MEM_callocN(sizeof(PointerRNA), "wmKeymapItemPtr"); - RNA_pointer_create(NULL, NULL, ot->srna, &kmi->properties, kmi->ptr); - } + kmi->ptr= MEM_callocN(sizeof(PointerRNA), "wmKeymapItemPtr"); + WM_operator_properties_create(kmi->ptr, kmi->idname); } } |