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 <campbell@blender.org>2022-03-25 04:04:21 +0300
committerCampbell Barton <campbell@blender.org>2022-03-25 04:10:21 +0300
commit7d1d9e601503fb7e921c935524fec1469363c121 (patch)
treed19dcbbcf9ada051ff3ec629c397ddca23eb2b55 /source/blender/blenkernel
parent4d46fac65d9946382c4be5b3842660e77468f00b (diff)
Cleanup: rename ParticleSettings.child_nbr => child_percent
child_nbr was used as a percentage as well as the final number of particles. Rename to avoid confusion.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/particle.c8
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c6
-rw-r--r--source/blender/blenkernel/intern/particle_system.c10
3 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index c47b22dcd34..9ea1336a95a 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2661,8 +2661,8 @@ void psys_find_parents(ParticleSimulationData *sim, const bool use_render_params
int from = PART_FROM_FACE;
totparent = (int)(totchild * part->parents * 0.3f);
- if (use_render_params && part->child_nbr && part->ren_child_nbr) {
- totparent *= (float)part->child_nbr / (float)part->ren_child_nbr;
+ if (use_render_params && part->child_percent && part->child_render_percent) {
+ totparent *= (float)part->child_percent / (float)part->child_render_percent;
}
/* hard limit, workaround for it being ignored above */
@@ -2736,8 +2736,8 @@ static bool psys_thread_context_init_path(ParticleThreadContext *ctx,
if (totchild && part->childtype == PART_CHILD_FACES) {
totparent = (int)(totchild * part->parents * 0.3f);
- if (use_render_params && part->child_nbr && part->ren_child_nbr) {
- totparent *= (float)part->child_nbr / (float)part->ren_child_nbr;
+ if (use_render_params && part->child_percent && part->child_render_percent) {
+ totparent *= (float)part->child_percent / (float)part->child_render_percent;
}
/* part->parents could still be 0 so we can't test with totparent */
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 83fb52ce1ef..d2c3776d4ea 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -64,14 +64,14 @@ static void distribute_simple_children(Scene *scene,
{
ChildParticle *cpa = NULL;
int i, p;
- int child_nbr = psys_get_child_number(scene, psys, use_render_params);
- int totpart = psys_get_tot_child(scene, psys, use_render_params);
+ const int child_num = psys_get_child_number(scene, psys, use_render_params);
+ const int totpart = psys_get_tot_child(scene, psys, use_render_params);
RNG *rng = BLI_rng_new_srandom(31415926 + psys->seed + psys->child_seed);
alloc_child_particles(psys, totpart);
cpa = psys->child;
- for (i = 0; i < child_nbr; i++) {
+ for (i = 0; i < child_num; i++) {
for (p = 0; p < psys->totpart; p++, cpa++) {
float length = 2.0;
cpa->parent = p;
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 1a74008c405..7fdc60a265b 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -98,9 +98,9 @@ float psys_get_current_display_percentage(ParticleSystem *psys, const bool use_r
ParticleSettings *part = psys->part;
if ((use_render_params &&
- !particles_are_dynamic(psys)) || /* non-dynamic particles can be rendered fully */
- (part->child_nbr && part->childtype) || /* display percentage applies to children */
- (psys->pointcache->flag & PTCACHE_BAKING)) /* baking is always done with full amount */
+ !particles_are_dynamic(psys)) || /* non-dynamic particles can be rendered fully */
+ (part->child_percent && part->childtype) || /* display percentage applies to children */
+ (psys->pointcache->flag & PTCACHE_BAKING)) /* baking is always done with full amount */
{
return 1.0f;
}
@@ -287,10 +287,10 @@ int psys_get_child_number(Scene *scene, ParticleSystem *psys, const bool use_ren
}
if (use_render_params) {
- child_num = psys->part->ren_child_nbr;
+ child_num = psys->part->child_render_percent;
}
else {
- child_num = psys->part->child_nbr;
+ child_num = psys->part->child_percent;
}
return get_render_child_particle_number(&scene->r, child_num, use_render_params);