From 62d791c8d6cd27112ca2fd0b6125770500b3d1ed Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Sep 2025 23:03:01 +1000 Subject: [PATCH] Cleanup: only use "r_" prefix for return arguments --- source/blender/blenkernel/BKE_particle.h | 2 +- source/blender/blenkernel/intern/particle.cc | 10 +++++----- .../blender/io/alembic/exporter/abc_writer_hair.cc | 12 ++++++------ source/blender/io/usd/hydra/curves.cc | 6 +++--- source/blender/python/generic/blf_py_api.cc | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index c3538bf7bbe..7416d9773bc 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -342,7 +342,7 @@ bool psys_render_simplify_params(struct ParticleSystem *psys, struct ChildParticle *cpa, float *params); -void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2]); +void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float r_uv[2]); void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc); void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time); diff --git a/source/blender/blenkernel/intern/particle.cc b/source/blender/blenkernel/intern/particle.cc index 081e984aa95..7367d7d6ca1 100644 --- a/source/blender/blenkernel/intern/particle.cc +++ b/source/blender/blenkernel/intern/particle.cc @@ -1723,7 +1723,7 @@ void psys_interpolate_face(Mesh *mesh, } } } -void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float uvco[2]) +void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float r_uv[2]) { float v10 = tface->uv[0][0]; float v11 = tface->uv[0][1]; @@ -1737,12 +1737,12 @@ void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float v40 = tface->uv[3][0]; v41 = tface->uv[3][1]; - uvco[0] = w[0] * v10 + w[1] * v20 + w[2] * v30 + w[3] * v40; - uvco[1] = w[0] * v11 + w[1] * v21 + w[2] * v31 + w[3] * v41; + r_uv[0] = w[0] * v10 + w[1] * v20 + w[2] * v30 + w[3] * v40; + r_uv[1] = w[0] * v11 + w[1] * v21 + w[2] * v31 + w[3] * v41; } else { - uvco[0] = w[0] * v10 + w[1] * v20 + w[2] * v30; - uvco[1] = w[0] * v11 + w[1] * v21 + w[2] * v31; + r_uv[0] = w[0] * v10 + w[1] * v20 + w[2] * v30; + r_uv[1] = w[0] * v11 + w[1] * v21 + w[2] * v31; } } diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc index 3c4d61a0347..9796e86e536 100644 --- a/source/blender/io/alembic/exporter/abc_writer_hair.cc +++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc @@ -162,10 +162,10 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context, MTFace *tface = mtface + num; if (mface) { - float r_uv[2], mapfw[4], vec[3]; + float uv[2], mapfw[4], vec[3]; - psys_interpolate_uvs(tface, face->v4, pa->fuv, r_uv); - uv_values.emplace_back(r_uv[0], r_uv[1]); + psys_interpolate_uvs(tface, face->v4, pa->fuv, uv); + uv_values.emplace_back(uv[0], uv[1]); psys_interpolate_face(mesh, reinterpret_cast(positions.data()), @@ -280,10 +280,10 @@ void ABCHairWriter::write_hair_child_sample(const HierarchyContext &context, const MFace *face = &mface[num]; MTFace *tface = mtface + num; - float r_uv[2], tmpnor[3], mapfw[4], vec[3]; + float uv[2], tmpnor[3], mapfw[4], vec[3]; - psys_interpolate_uvs(tface, face->v4, pc->fuv, r_uv); - uv_values.emplace_back(r_uv[0], r_uv[1]); + psys_interpolate_uvs(tface, face->v4, pc->fuv, uv); + uv_values.emplace_back(uv[0], uv[1]); psys_interpolate_face(mesh, reinterpret_cast(positions.data()), diff --git a/source/blender/io/usd/hydra/curves.cc b/source/blender/io/usd/hydra/curves.cc index ca19e90d585..58e9a7b5cb6 100644 --- a/source/blender/io/usd/hydra/curves.cc +++ b/source/blender/io/usd/hydra/curves.cc @@ -265,7 +265,7 @@ void HairData::write_curves() ParticleSystemModifierData *psmd = psys_get_modifier(object, particle_system_); int num = ELEM(pa.num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND) ? pa.num : pa.num_dmcache; - float r_uv[2] = {0.0f, 0.0f}; + float uv[2] = {0.0f, 0.0f}; if (ELEM(psmd->psys->part->from, PART_FROM_FACE, PART_FROM_VOLUME) && !ELEM(num, DMCACHE_NOTFOUND, DMCACHE_ISCHILD)) { @@ -276,10 +276,10 @@ void HairData::write_curves() if (mface && mtface) { mtface += num; - psys_interpolate_uvs(mtface, mface->v4, pa.fuv, r_uv); + psys_interpolate_uvs(mtface, mface->v4, pa.fuv, uv); } } - uvs_.push_back(pxr::GfVec2f(r_uv[0], r_uv[1])); + uvs_.push_back(pxr::GfVec2f(uv[0], uv[1])); } } } diff --git a/source/blender/python/generic/blf_py_api.cc b/source/blender/python/generic/blf_py_api.cc index 2dd2b0dc03f..bc962d2569e 100644 --- a/source/blender/python/generic/blf_py_api.cc +++ b/source/blender/python/generic/blf_py_api.cc @@ -229,7 +229,7 @@ PyDoc_STRVAR( static PyObject *py_blf_dimensions(PyObject * /*self*/, PyObject *args) { const char *text; - float r_width, r_height; + float width, height; PyObject *ret; int fontid; @@ -237,10 +237,10 @@ static PyObject *py_blf_dimensions(PyObject * /*self*/, PyObject *args) return nullptr; } - BLF_width_and_height(fontid, text, INT_MAX, &r_width, &r_height); + BLF_width_and_height(fontid, text, INT_MAX, &width, &height); ret = PyTuple_New(2); - PyTuple_SET_ITEMS(ret, PyFloat_FromDouble(r_width), PyFloat_FromDouble(r_height)); + PyTuple_SET_ITEMS(ret, PyFloat_FromDouble(width), PyFloat_FromDouble(height)); return ret; }