RNA
Merging changes made by Arystanbek in the soc-2009-kazanbas branch, plus some things modified and added by me. * The API files now all in the makesrna module, convention is to call them e.g. rna_mesh_api.c for rna_mesh.c. Note for visual studio build maintainers, the rna_*_api.c files are compiled as part of "makesrna", but do not have rna_*_gen.c generated as part of the library. SCons/cmake/make were updated. * Added function flags FUNC_USE_CONTEXT and FUNC_USE_REPORTS, to allow RNA functions to get context and error reporting parameters optionally. Renamed FUNC_TYPESTATIC to FUNC_NO_SELF. * RNA collections now have a pointer to add/remove FunctionRNA's, this isn't actually used anywhere yet, purpose is to make an alias main.meshes.add() for main.add_mesh() in python. * Fixes to make autogenerating property set/get for multidimensional arrays work, though a 4x4 matrix will be exposed as a length 16 one dimensional RNA array. * Functions and properties added: * Main.add_mesh() * Main.remove_mesh() * Object.matrix * Object.create_render_mesh() * WindowManager.add_fileselect()
This commit is contained in:
@@ -1310,11 +1310,19 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw)
|
||||
ret= NULL;
|
||||
if (err==0) {
|
||||
/* call function */
|
||||
RNA_function_call(self_ptr, self_func, parms);
|
||||
ReportList reports;
|
||||
bContext *C= BPy_GetContext();
|
||||
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
RNA_function_call(C, &reports, self_ptr, self_func, parms);
|
||||
|
||||
err= (BPy_reports_to_error(&reports))? -1: 0;
|
||||
BKE_reports_clear(&reports);
|
||||
|
||||
/* return value */
|
||||
if(pret)
|
||||
ret= pyrna_param_to_py(&funcptr, pret, retdata);
|
||||
if(err==0)
|
||||
if(pret)
|
||||
ret= pyrna_param_to_py(&funcptr, pret, retdata);
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
@@ -2121,7 +2129,7 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args)
|
||||
C= BPy_GetContext();
|
||||
|
||||
/* call the register callback */
|
||||
BKE_reports_init(&reports, RPT_PRINT);
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
srna= reg(C, &reports, py_class, bpy_class_validate, bpy_class_call, bpy_class_free);
|
||||
|
||||
if(!srna) {
|
||||
|
||||
Reference in New Issue
Block a user