Page MenuHome

Hair density maps increases hair children amount on reopening scene file (or rendering which will get slow)
Confirmed, NormalPublic

Description

System Information
Operating system: window 10
Graphics card: 2080 Ti

blender 2.93.00

Worked: dont know when it worked

Hair density changes on reopening scene file

  • Open the attached file and first turn of and turn on and of interpolated children
  • see how the density changes. The number of children increases.
  • save the file and reopen it to see that its back to a lower number of children.
  • affects both viewport and offline render

Test File

Event Timeline

This report does not contain all the requested information, which is required for us to investigate the issue.

Please submit a new report and carefully follow the instructions. Be sure to provide system information, Blender version, the last Blender version which worked, and a .blend file with exact steps to reproduce the problem.

A guideline for making a good bug report can be found at https://wiki.blender.org/wiki/Process/Bug_Reports

Just open the scene file and turn off and then on the children of the hair. you will see that when you turn it on again, the number of children will increase.
If you save and reopen the same file its back to a lower number of children again.
This is also persistent in render etc.

best/
Daniel

You did not include a blend file...

Pratik Borhade (PratikPB2123) changed the task status from Needs Triage to Needs Information from User.Fri, Jul 2, 3:15 PM

Pratik Borhade (PratikPB2123) changed the task status from Needs Information from User to Needs Triage.Mon, Jul 5, 10:50 AM
Pratik Borhade (PratikPB2123) updated the task description. (Show Details)
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Wed, Jul 7, 10:48 AM

Can confirm, will have a quick look.

I have a hunch that it is connected to my other bug report here: https://developer.blender.org/T89596 but I'm probably wrong...

Got a fix for this, just double-checking the reasoning behind the change...

Hrmf, I should have not looked into this [turned into a timesink], to properly reason about particle code is... not easy.
Will post my findings tomorrow

Here are my findings:

  • changing settings on the ParticleSettings trigger this bug (e.g. changing child_type), whereas changing settings on the ParticleSystem wont (e.g. changing child_seed)
    • note here that changes on the particle system (the "working" scenario) will tag the particle system ID_RECALC_PSYS_CHILD -- the "broken" state tries it too (but on the owner ID
  • what happens in the "broken" scenario is that we are "loosing" more and more (on each iteration) particles tagged PARS_UNEXIST
    • in system_step: initialize_all_particles will clear PARS_UNEXIST (under certain condition -- this needs a bit more investigation [from module devs probably])
    • in system_step: reset_particle > init_particle_texture will set PARS_UNEXIST correctly (but this is only done for a subset -- starting from )
    • this results in an ever increasing number of existing particles (psys->totpart vs psys->totunexist shifts [totpart increases, totunexist decreases]), which is wrong

related (I think) commits:

Doing this change (which will basically reset all particles) will show a working state (but the "fix" is probably the wrong thing to do):

1
2
3diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
4index 06d3daaf4d6..c82c65776d4 100644
5--- a/source/blender/blenkernel/intern/particle_system.c
6+++ b/source/blender/blenkernel/intern/particle_system.c
7@@ -4513,7 +4513,7 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_
8 distribute_particles(sim, part->from);
9 initialize_all_particles(sim);
10 /* reset only just created particles (on startframe all particles are recreated) */
11- reset_all_particles(sim, 0.0, cfra, oldtotpart);
12+ reset_all_particles(sim, 0.0, cfra, 0);
13 free_unexisting_particles(sim);
14
15 if (psys->fluid_springs) {

Other suspicion is that RNA updates (rna_Particle_redo_child / particle_recalc) tagging goes wrong in terms of ParticleSystem vs. ParticleSettings (see very first finding).

Will step down, maybe this rings a bell immediately for @Sergey Sharybin (sergey) or @Jacques Lucke (JacquesLucke)

Philipp Oeser (lichtwerk) renamed this task from Hair density changes on reopening scene file to Hair density maps increases hair children amount on reopening scene file (or rendering which will get slow).Fri, Jul 23, 1:39 PM