diff options
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 5 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_handlers.c | 3 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 2 | ||||
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.c | 5 | ||||
-rw-r--r-- | source/blender/python/rna_dump.py | 2 |
6 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index f1a8d450ea5..598640f8f68 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1385,7 +1385,6 @@ static PyObject *bpy_bmesh_calc_loop_triangles(BPy_BMElem *self) BMesh *bm; int looptris_tot; - int tottri; BMLoop *(*looptris)[3]; PyObject *ret; @@ -1398,10 +1397,10 @@ static PyObject *bpy_bmesh_calc_loop_triangles(BPy_BMElem *self) looptris_tot = poly_to_tri_count(bm->totface, bm->totloop); looptris = PyMem_MALLOC(sizeof(*looptris) * looptris_tot); - BM_mesh_calc_tessellation(bm, looptris, &tottri); + BM_mesh_calc_tessellation(bm, looptris); - ret = PyList_New(tottri); - for (i = 0; i < tottri; i++) { + ret = PyList_New(looptris_tot); + for (i = 0; i < looptris_tot; i++) { PyList_SET_ITEM(ret, i, BPy_BMLoop_Array_As_Tuple(bm, looptris[i], 3)); } diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 927ec11c376..4de6063098b 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -82,7 +82,10 @@ static PyTypeObject BlenderAppType; static PyStructSequence_Field app_info_fields[] = { {"version", "The Blender version as a tuple of 3 numbers. eg. (2, 83, 1)"}, - {"version_file", "The blend file version, compatible with ``bpy.data.version``"}, + {"version_file", + "The Blender version, as a tuple, last used to save a .blend file, compatible with " + "``bpy.data.version``. This value should be used for handling compatibility changes between " + "Blender versions"}, {"version_string", "The Blender version formatted as a string"}, {"version_cycle", "The release status of this build alpha/beta/rc/release"}, {"version_char", "Deprecated, always an empty string"}, diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index a0b543097e6..bc05c51414f 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -43,6 +43,9 @@ void bpy_app_generic_callback(struct Main *main, static PyTypeObject BlenderAppCbType; +/** + * See `BKE_callbacks.h` #eCbEvent declaration for the policy on naming. + */ static PyStructSequence_Field app_cb_info_fields[] = { {"frame_change_pre", "Called after frame change for playback and rendering, before any data is evaluated for the " diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index c312012b24c..5d38a3692c3 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -2253,7 +2253,7 @@ static PyObject *Matrix_str(MatrixObject *self) for (col = 0; col < self->num_col; col++) { maxsize[col] = 0; for (row = 0; row < self->num_row; row++) { - const int size = BLI_snprintf( + const int size = BLI_snprintf_rlen( dummy_buf, sizeof(dummy_buf), "%.4f", MATRIX_ITEM(self, row, col)); maxsize[col] = max_ii(maxsize[col], size); } diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index 1acbcc006ca..79ed9e68420 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -961,8 +961,6 @@ static PyObject *C_BVHTree_FromBMesh(PyObject *UNUSED(cls), PyObject *args, PyOb /* Get data for tessellation */ { - int tris_len_dummy; - coords_len = (uint)bm->totvert; tris_len = (uint)poly_to_tri_count(bm->totface, bm->totloop); @@ -971,8 +969,7 @@ static PyObject *C_BVHTree_FromBMesh(PyObject *UNUSED(cls), PyObject *args, PyOb looptris = MEM_mallocN(sizeof(*looptris) * (size_t)tris_len, __func__); - BM_mesh_calc_tessellation(bm, looptris, &tris_len_dummy); - BLI_assert(tris_len_dummy == (int)tris_len); + BM_mesh_calc_tessellation(bm, looptris); } { diff --git a/source/blender/python/rna_dump.py b/source/blender/python/rna_dump.py index 7d469d20110..bd45a36e8a4 100644 --- a/source/blender/python/rna_dump.py +++ b/source/blender/python/rna_dump.py @@ -62,7 +62,7 @@ def seek(r, txt, recurs): # print(dir(r)) # basic types - if type_r in (float, int, bool, type(None)): + if type_r in {float, int, bool, type(None)}: if PRINT_DATA: print(txt + ' -> ' + str(r)) return |