diff options
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 71 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_capi_utils.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_gizmo_wrap.c | 20 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 18 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 2 |
6 files changed, 81 insertions, 35 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index ae9ffe4f3b8..cabeeba18b9 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -40,11 +40,11 @@ extern bool pyrna_id_FromPyObject(PyObject *obj, ID **id); extern PyObject *pyrna_id_CreatePyObject(ID *id); extern bool pyrna_id_CheckPyObject(PyObject *obj); -/*********************** ID Property Main Wrapper Stuff ***************/ - -/* ---------------------------------------------------------------------------- - * static conversion functions to avoid duplicate code, no type checking. - */ +/* -------------------------------------------------------------------- */ +/** \name Python from ID-Property (Internal Conversions) + * + * Low level conversion to avoid duplicate code, no type checking. + * \{ */ static PyObject *idprop_py_from_idp_string(const IDProperty *prop) { @@ -124,7 +124,11 @@ static PyObject *idprop_py_from_idp_idparray(ID *id, IDProperty *prop) return seq; } -/* -------------------------------------------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name IDProp Group Access + * \{ */ /* use for both array and group */ static Py_hash_t BPy_IDGroup_hash(BPy_IDProperty *self) @@ -374,7 +378,11 @@ static const char *idp_try_read_name(PyObject *name_obj) return name; } -/* -------------------------------------------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name ID-Property from Python (Internal Conversions) + * \{ */ /** * The 'idp_from_Py*' functions expect that the input type has been checked before @@ -658,7 +666,12 @@ static IDProperty *idp_from_PyObject(PyObject *name_obj, PyObject *ob) } } -/* -------------------------------------------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Mapping Get/Set (Internal Access) + * \{ */ + /** * \note group can be a pointer array or a group. * assume we already checked key is a string. @@ -862,6 +875,12 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) return NULL; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name ID-Property Group Methods + * \{ */ + PyDoc_STRVAR( BPy_IDGroup_pop_doc, ".. method:: pop(key, default)\n" @@ -1142,6 +1161,12 @@ static struct PyMethodDef BPy_IDGroup_methods[] = { {NULL, NULL, 0, NULL}, }; +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name ID-Property Group Type + * \{ */ + static PySequenceMethods BPy_IDGroup_Seq = { (lenfunc)BPy_IDGroup_Map_Len, /* lenfunc sq_length */ NULL, /* binaryfunc sq_concat */ @@ -1223,7 +1248,11 @@ PyTypeObject BPy_IDGroup_Type = { BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */ }; -/********Array Wrapper********/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name ID Array Methods + * \{ */ static PyTypeObject *idp_array_py_type(BPy_IDArray *self, bool *r_is_double) { @@ -1567,6 +1596,10 @@ static PyBufferProcs BPy_IDArray_Buffer = { (releasebufferproc)BPy_IDArray_releasebuffer, }; +/* -------------------------------------------------------------------- */ +/** \name ID Array Type + * \{ */ + PyTypeObject BPy_IDArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) /* For printing, in format "<module>.<name>" */ @@ -1648,7 +1681,11 @@ PyTypeObject BPy_IDArray_Type = { NULL, }; -/*********** ID Property Group iterator ********/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name ID-Property Group Iterator Type + * \{ */ static PyObject *IDGroup_Iter_repr(BPy_IDGroup_Iter *self) { @@ -1746,9 +1783,11 @@ void IDProp_Init_Types(void) PyType_Ready(&BPy_IDArray_Type); } -/*----------------------------MODULE INIT-------------------------*/ +/** \} */ -/* --- */ +/* -------------------------------------------------------------------- */ +/** \name Public Module 'idprop.types' + * \{ */ static struct PyModuleDef IDProp_types_module_def = { PyModuleDef_HEAD_INIT, @@ -1784,7 +1823,11 @@ static PyObject *BPyInit_idprop_types(void) return submodule; } -/* --- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Public Module 'idprop' + * \{ */ static PyMethodDef IDProp_methods[] = { {NULL, NULL, 0, NULL}, @@ -1818,3 +1861,5 @@ PyObject *BPyInit_idprop(void) return mod; } + +/** \} */ diff --git a/source/blender/python/intern/bpy_capi_utils.c b/source/blender/python/intern/bpy_capi_utils.c index f63b77e1726..89ef2f40a30 100644 --- a/source/blender/python/intern/bpy_capi_utils.c +++ b/source/blender/python/intern/bpy_capi_utils.c @@ -24,6 +24,7 @@ #include <Python.h> #include "BLI_dynstr.h" +#include "BLI_listbase.h" #include "BLI_utildefines.h" #include "bpy_capi_utils.h" @@ -91,7 +92,7 @@ void BPy_reports_write_stdout(const ReportList *reports, const char *header) PySys_WriteStdout("%s\n", header); } - for (const Report *report = reports->list.first; report; report = report->next) { + LISTBASE_FOREACH (const Report *, report, &reports->list) { PySys_WriteStdout("%s: %s\n", report->typestr, report->message); } } diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c index 8ff3af59930..774ad95c3eb 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.c +++ b/source/blender/python/intern/bpy_gizmo_wrap.c @@ -101,8 +101,8 @@ fail: static void gizmo_properties_init(wmGizmoType *gzt) { - PyTypeObject *py_class = gzt->ext.data; - RNA_struct_blender_type_set(gzt->ext.srna, gzt); + PyTypeObject *py_class = gzt->rna_ext.data; + RNA_struct_blender_type_set(gzt->rna_ext.srna, gzt); /* only call this so pyrna_deferred_register_class gives a useful error * WM_operatortype_append_ptr will call RNA_def_struct_identifier @@ -160,9 +160,9 @@ void BPY_RNA_gizmo_wrapper(wmGizmoType *gzt, void *userdata) /* don't do translations here yet */ #if 0 - /* Use i18n context from ext.srna if possible (py gizmogroups). */ - if (gt->ext.srna) { - RNA_def_struct_translation_context(gt->srna, RNA_struct_translation_context(gt->ext.srna)); + /* Use i18n context from rna_ext.srna if possible (py gizmogroups). */ + if (gt->rna_ext.srna) { + RNA_def_struct_translation_context(gt->srna, RNA_struct_translation_context(gt->rna_ext.srna)); } #endif @@ -179,8 +179,8 @@ void BPY_RNA_gizmo_wrapper(wmGizmoType *gzt, void *userdata) static void gizmogroup_properties_init(wmGizmoGroupType *gzgt) { - PyTypeObject *py_class = gzgt->ext.data; - RNA_struct_blender_type_set(gzgt->ext.srna, gzgt); + PyTypeObject *py_class = gzgt->rna_ext.data; + RNA_struct_blender_type_set(gzgt->rna_ext.srna, gzgt); /* only call this so pyrna_deferred_register_class gives a useful error * WM_operatortype_append_ptr will call RNA_def_struct_identifier @@ -203,9 +203,9 @@ void BPY_RNA_gizmogroup_wrapper(wmGizmoGroupType *gzgt, void *userdata) /* don't do translations here yet */ #if 0 - /* Use i18n context from ext.srna if possible (py gizmogroups). */ - if (gzgt->ext.srna) { - RNA_def_struct_translation_context(gzgt->srna, RNA_struct_translation_context(gzgt->ext.srna)); + /* Use i18n context from rna_ext.srna if possible (py gizmogroups). */ + if (gzgt->rna_ext.srna) { + RNA_def_struct_translation_context(gzgt->srna, RNA_struct_translation_context(gzgt->rna_ext.srna)); } #endif diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index b7d3c99d3da..9fb25d41844 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -39,8 +39,8 @@ static void operator_properties_init(wmOperatorType *ot) { - PyTypeObject *py_class = ot->ext.data; - RNA_struct_blender_type_set(ot->ext.srna, ot); + PyTypeObject *py_class = ot->rna_ext.data; + RNA_struct_blender_type_set(ot->rna_ext.srna, ot); /* Only call this so pyrna_deferred_register_class gives a useful error * WM_operatortype_append_ptr will call RNA_def_struct_identifier later. @@ -123,9 +123,9 @@ void BPY_RNA_operator_wrapper(wmOperatorType *ot, void *userdata) *ot = *((wmOperatorType *)userdata); ot->srna = srna; /* restore */ - /* Use i18n context from ext.srna if possible (py operators). */ - if (ot->ext.srna) { - RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->ext.srna)); + /* Use i18n context from rna_ext.srna if possible (py operators). */ + if (ot->rna_ext.srna) { + RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->rna_ext.srna)); } operator_properties_init(ot); @@ -142,11 +142,11 @@ void BPY_RNA_operator_macro_wrapper(wmOperatorType *ot, void *userdata) ot->flag |= data->flag; /* append flags to the one set by registration */ ot->pyop_poll = data->pyop_poll; ot->ui = data->ui; - ot->ext = data->ext; + ot->rna_ext = data->rna_ext; - /* Use i18n context from ext.srna if possible (py operators). */ - if (ot->ext.srna) { - RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->ext.srna)); + /* Use i18n context from rna_ext.srna if possible (py operators). */ + if (ot->rna_ext.srna) { + RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->rna_ext.srna)); } operator_properties_init(ot); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 9579f78be30..2c54b9ce1e1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4091,7 +4091,7 @@ static PyObject *pyrna_struct_bl_rna_get_subclass(PyObject *cls, PyObject *args) if (srna_base == &RNA_Node) { bNodeType *nt = nodeTypeFind(id); if (nt) { - RNA_pointer_create(NULL, &RNA_Struct, nt->ext.srna, &ptr); + RNA_pointer_create(NULL, &RNA_Struct, nt->rna_ext.srna, &ptr); return pyrna_struct_CreatePyObject(&ptr); } } diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index c8af6377d59..d8043ee2fdf 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -35,7 +35,7 @@ #include "ED_keyframes_edit.h" #include "ED_keyframing.h" -#include "BKE_animsys.h" +#include "BKE_anim_data.h" #include "BKE_context.h" #include "BKE_fcurve.h" #include "BKE_global.h" |