Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-09-09 16:41:15 +0300
committerHans Goudey <h.goudey@me.com>2020-09-09 16:41:15 +0300
commit842f52d418aaccae45c8e400eb0a8bddef0dbb51 (patch)
tree800dc6f6db8b2dbf4d2c4c78713e79bdce6d025c /source/blender/python/intern/bpy_utils_units.c
parent6dc7266cf1f4ee4e6e6eaa7e4949fcff11372479 (diff)
Cleanup: Rename public "bUnit" functions
This commit renames the functions in "BKE_unit.h` to be consistent with the naming in the rest of blenkernel. bUnit_AsString -> BKE_unit_value_as_string_adaptive bUnit_AsString2 -> BKE_unit_value_as_string bUnit_ReplaceString -> BKE_unit_replace_string bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit bUnit_ToUnitAltName -> BKE_unit_name_to_alt bUnit_ClosestScalar -> BKE_unit_closest_scalar bUnit_BaseScalar -> BKE_unit_base_scalar bUnit_IsValid -> BKE_unit_is_valid bUnit_GetSystem -> BKE_unit_system_get bUnit_GetBaseUnit -> BKE_unit_base_get bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get bUnit_GetName -> BKE_unit_name_get bUnit_GetNameDisplay -> BKE_unit_display_name_get bUnit_GetIdentifier -> BKE_unit_identifier_get bUnit_GetScaler -> BKE_unit_scalar_get bUnit_IsSuppressed -> BKE_unit_is_suppressed Differential Revision: https://developer.blender.org/D8828
Diffstat (limited to 'source/blender/python/intern/bpy_utils_units.c')
-rw-r--r--source/blender/python/intern/bpy_utils_units.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/python/intern/bpy_utils_units.c b/source/blender/python/intern/bpy_utils_units.c
index 4433f5d0f88..a58e2bcb975 100644
--- a/source/blender/python/intern/bpy_utils_units.c
+++ b/source/blender/python/intern/bpy_utils_units.c
@@ -134,7 +134,7 @@ static bool bpyunits_validate(const char *usys_str, const char *ucat_str, int *r
return false;
}
- if (!bUnit_IsValid(*r_usys, *r_ucat)) {
+ if (!BKE_unit_is_valid(*r_usys, *r_ucat)) {
PyErr_Format(PyExc_ValueError,
"%.200s / %.200s unit system/category combination is not valid.",
usys_str,
@@ -197,7 +197,7 @@ static PyObject *bpyunits_to_value(PyObject *UNUSED(self), PyObject *args, PyObj
str = PyMem_MALLOC(sizeof(*str) * (size_t)str_len);
BLI_strncpy(str, inpt, (size_t)str_len);
- bUnit_ReplaceString(str, (int)str_len, uref, scale, usys, ucat);
+ BKE_unit_replace_string(str, (int)str_len, uref, scale, usys, ucat);
if (!PyC_RunString_AsNumber(NULL, str, "<bpy_units_api>", &result)) {
if (PyErr_Occurred()) {
@@ -291,10 +291,11 @@ static PyObject *bpyunits_to_string(PyObject *UNUSED(self), PyObject *args, PyOb
char buf1[64], buf2[64], *str;
PyObject *result;
- bUnit_AsString(buf1, sizeof(buf1), value, precision, usys, ucat, (bool)split_unit, false);
+ BKE_unit_value_as_string_adaptive(
+ buf1, sizeof(buf1), value, precision, usys, ucat, (bool)split_unit, false);
if (compatible_unit) {
- bUnit_ToUnitAltName(buf2, sizeof(buf2), buf1, usys, ucat);
+ BKE_unit_name_to_alt(buf2, sizeof(buf2), buf1, usys, ucat);
str = buf2;
}
else {