From 2110391058fa732b745e1990249702a70723c49b Mon Sep 17 00:00:00 2001 From: Namit Bhutani Date: Thu, 11 Sep 2025 20:22:37 +0530 Subject: [PATCH] PyAPI: rename undo memory usage method, improve doc-string Ref !146095 --- source/blender/python/intern/bpy_app.cc | 14 +++++++------- tests/performance/tests/sculpt.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/blender/python/intern/bpy_app.cc b/source/blender/python/intern/bpy_app.cc index 0c19d90a634..f9b5d032a17 100644 --- a/source/blender/python/intern/bpy_app.cc +++ b/source/blender/python/intern/bpy_app.cc @@ -649,15 +649,15 @@ static PyObject *bpy_app_help_text(PyObject * /*self*/, PyObject *args, PyObject #endif PyDoc_STRVAR( /* Wrap. */ - bpy_app_undo_memory_info_doc, - ".. staticmethod:: undo_memory_info()\n" + bpy_app_memory_usage_undo_doc, + ".. staticmethod:: memory_usage_undo()\n" "\n" " Get undo memory usage information.\n" "\n" - " :return: 'total_memory'.\n" + " :return: Memory usage of the undo stack in bytes.\n" " :rtype: int\n"); -static PyObject *bpy_app_undo_memory_info(PyObject * /*self*/, PyObject * /*args*/) +static PyObject *bpy_app_memory_usage_undo(PyObject * /*self*/, PyObject * /*args*/) { size_t total_memory = 0; UndoStack *ustack = ED_undo_stack_get(); @@ -676,10 +676,10 @@ static PyMethodDef bpy_app_methods[] = { (PyCFunction)bpy_app_help_text, METH_VARARGS | METH_KEYWORDS | METH_STATIC, bpy_app_help_text_doc}, - {"undo_memory_info", - (PyCFunction)bpy_app_undo_memory_info, + {"memory_usage_undo", + (PyCFunction)bpy_app_memory_usage_undo, METH_NOARGS | METH_STATIC, - bpy_app_undo_memory_info_doc}, + bpy_app_memory_usage_undo_doc}, {nullptr, nullptr, 0, nullptr}, }; diff --git a/tests/performance/tests/sculpt.py b/tests/performance/tests/sculpt.py index e325398dade..7431aeaa657 100644 --- a/tests/performance/tests/sculpt.py +++ b/tests/performance/tests/sculpt.py @@ -182,7 +182,7 @@ def _run_brush_test(args: dict): bpy.ops.sculpt.brush_stroke(stroke=generate_stroke(context_override), override_location=True) bpy.ops.ed.undo_push() measurements.append(time.time() - start) - memory_info = bpy.app.undo_memory_info() + memory_info = bpy.app.memory_usage_undo() if len(measurements) >= min_measurements and (time.time() - total_time_start) > timeout: break if len(measurements) >= max_measurements: