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:
authorCampbell Barton <ideasman42@gmail.com>2021-06-13 07:47:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-13 07:47:04 +0300
commit84e98ba1824359dfd0b7dd011b5766b14fe8c4ff (patch)
tree7f978b2981d189ca2b9a64a52e84661d31e129f6
parent8e58f932157d71ab50b76f5efb5b2ddd37b3b1b0 (diff)
Cleanup: misleading return argument for hair_create_input_mesh
- The argument with named with an `r_` prefix when it was in fact also read from. - The argument passed in had to be 'psys->clmd->hairdata', if it was not - the function would not worked.
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index ce4be411c9a..149e345e501 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3312,13 +3312,11 @@ static MDeformVert *hair_set_pinning(MDeformVert *dvert, float weight)
static void hair_create_input_mesh(ParticleSimulationData *sim,
int totpoint,
int totedge,
- Mesh **r_mesh,
- ClothHairData **r_hairdata)
+ Mesh **r_mesh)
{
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
Mesh *mesh;
- ClothHairData *hairdata;
MVert *mvert;
MEdge *medge;
MDeformVert *dvert;
@@ -3339,9 +3337,8 @@ static void hair_create_input_mesh(ParticleSimulationData *sim,
medge = mesh->medge;
dvert = mesh->dvert;
- hairdata = *r_hairdata;
- if (!hairdata) {
- *r_hairdata = hairdata = MEM_mallocN(sizeof(ClothHairData) * totpoint, "hair data");
+ if (psys->clmd->hairdata == NULL) {
+ psys->clmd->hairdata = MEM_mallocN(sizeof(ClothHairData) * totpoint, "hair data");
}
/* calculate maximum segment length */
@@ -3493,7 +3490,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
}
}
- hair_create_input_mesh(sim, totpoint, totedge, &psys->hair_in_mesh, &psys->clmd->hairdata);
+ hair_create_input_mesh(sim, totpoint, totedge, &psys->hair_in_mesh);
if (psys->hair_out_mesh) {
BKE_id_free(NULL, psys->hair_out_mesh);