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/python | |
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/python')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index acc4d03db50..cc87fd0704e 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -174,7 +174,6 @@ static PyGetSetDef pyop_func_getseters[] = { static PyObject * pyop_func_call(BPy_OperatorFunc * self, PyObject *args, PyObject *kw) { - IDProperty *properties = NULL; wmOperatorType *ot; int error_val = 0; @@ -191,18 +190,16 @@ static PyObject * pyop_func_call(BPy_OperatorFunc * self, PyObject *args, PyObje return NULL; } - RNA_pointer_create(NULL, NULL, ot->srna, &properties, &ptr); + WM_operator_properties_create(&ptr, self->name); error_val= PYOP_props_from_dict(&ptr, kw); if (error_val==0) { - WM_operator_name_call(self->C, self->name, WM_OP_EXEC_DEFAULT, properties); + WM_operator_name_call(self->C, self->name, WM_OP_EXEC_DEFAULT, &ptr); } - if (properties) { - IDP_FreeProperty(properties); - MEM_freeN(properties); - } + WM_operator_properties_free(&ptr); + #if 0 /* if there is some way to know an operator takes args we should use this */ { |