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/editors/interface/interface.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/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 51cc89505b9..b72cdb17ec4 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1371,11 +1371,10 @@ static void ui_free_link(uiLink *link) static void ui_free_but(const bContext *C, uiBut *but) { - if(but->opproperties) { - IDP_FreeProperty(but->opproperties); - MEM_freeN(but->opproperties); + if(but->opptr) { + WM_operator_properties_free(but->opptr); + MEM_freeN(but->opptr); } - if(but->opptr) MEM_freeN(but->opptr); if(but->active) ui_button_active_cancel(C, but); if(but->str && but->str != but->strdata) MEM_freeN(but->str); ui_free_link(but->link); @@ -2610,15 +2609,9 @@ int uiButGetRetVal(uiBut *but) PointerRNA *uiButGetOperatorPtrRNA(uiBut *but) { - wmOperatorType *ot; - if(but->opname && !but->opptr) { - ot= WM_operatortype_find(but->opname); - - if(ot) { - but->opptr= MEM_callocN(sizeof(PointerRNA), "uiButOpPtr"); - RNA_pointer_create(NULL, NULL, ot->srna, &but->opproperties, but->opptr); - } + but->opptr= MEM_callocN(sizeof(PointerRNA), "uiButOpPtr"); + WM_operator_properties_create(but->opptr, but->opname); } return but->opptr; |