[Bf-blender-cvs] [37943b00f2c] master: Fix: Output int for precision in UI data as_dict method

Hans Goudey noreply at git.blender.org
Tue Aug 31 16:05:10 CEST 2021


Commit: 37943b00f2cf0cda51bea3f14da6f83a75ca1239
Author: Hans Goudey
Date:   Tue Aug 31 09:05:03 2021 -0500
Branches: master
https://developer.blender.org/rB37943b00f2cf0cda51bea3f14da6f83a75ca1239

Fix: Output int for precision in UI data as_dict method

This is stored internally and used as an integer, so there is no need
to convert it to a float for "as_dict". This was just an oversight.

===================================================================

M	source/blender/python/generic/idprop_py_ui_api.c

===================================================================

diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c
index 92cc3b8e1dd..7e88e79496b 100644
--- a/source/blender/python/generic/idprop_py_ui_api.c
+++ b/source/blender/python/generic/idprop_py_ui_api.c
@@ -489,7 +489,7 @@ static void idprop_ui_data_to_dict_float(IDProperty *property, PyObject *dict)
   Py_DECREF(item);
   PyDict_SetItemString(dict, "step", item = PyFloat_FromDouble((double)ui_data->step));
   Py_DECREF(item);
-  PyDict_SetItemString(dict, "precision", item = PyFloat_FromDouble((double)ui_data->precision));
+  PyDict_SetItemString(dict, "precision", item = PyLong_FromDouble((double)ui_data->precision));
   Py_DECREF(item);
   if (property->type == IDP_ARRAY) {
     PyObject *list = PyList_New(ui_data->default_array_len);



More information about the Bf-blender-cvs mailing list