Page MenuHome

Hair particle disconnect and then reconnect results in mess in children hairs
Open, Needs Triage by DeveloperPublic

Description

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-11 13:50, hash: rB06312c6d2db8
Worked: (optional)

Short description of error
I have character with hairstyle. For some reasons I need to disconnect, and then reconnect hairs back to character. Doing so makes huge mess in children hairs. I assume this is just a matter of incorrect interpolation, because, guide hairs looks OK. Check image:

Exact steps for others to reproduce the error
1 - Get this blendfile


2 - select hair particle
3 - Disconnect Hair
4 - Connect Hair
Result - children hair are messy, while guide hairs are OK - check in Particle edit mode.

Marek

Details

Type
Bug

Event Timeline

I'm about four hours away from checking this with blender, but this reminds me of T54488. Is there a mirror modifier in play?

Hi Garry. No mirror modifiers. Just mesh with hair particles. I am going to do some further testing as well, disconnect/connect work on simple sphere with hairs.. In case I find something I will report it here.
Thanks
Marek

Hi Garry. Further investigation of this hair issue led me to dead end. Interpolated hairs are always wrong on my head model, no matter what I do. So I opened some previous backup, and I found even worse and strange behaviour.

I will explain it here, but if it is worth creating separate bug report, let me know.

Open this blendfile:


Hair particle named "hair" is already selected..
1 - go to particle edit mode. Here is PROBLEM No.1 - NO GUIDE HAIRS VISIBLE, AND NO WAY TO EDIT PARTICLES IN ANY WAY.
2 - even if there are no guides visible, try to do rectangle selection around head (with hair selection mode switched to "point")
3 - while still in particle edit mode, select another hair particle named "brows"
4 - switch particle selection mode to "path" - PROBLEM No.2 - INSTANT CRASH
but strangely, I am unable to reproduce this crash everytime. Sometimes it crashes, and sometimes not instantly - I found out that switching between different hair particles, and different particle selection modes, while doing rectangle selection, will (sooner or later, but always ) lead to inevitable crash.

There is definitely something wrong with hair particles.

Tell me please, if I have to create separate bug reports for this.

Thanks

Marek

@Marek Hollý (asil8567)
Took me awhile to get to my desk last night, but I did run your file and confirm both your original report and the unusual rotations/translations which occur to child hair.
I also could reliably crash blender by test rendering (F12) while in particle edit mode. It does seem your file triggers a "certain fragility."

What I have not done - but, would very much like to do - is isolate what it is about your file that triggers that "certain fragility" and compose a simple (really, as simple as possible!) blend file that expresses the problem.

The tricky aspect of this bug is this: last night I made a number of meshes with vertex groups controlling hair density, making use of subdivision modifiers, and otherwise following the settings in your first posted blend file - and these examples behaved properly, to wit: disconnecting and reconnecting hair with interpolated children did not give rise to unusual scaling, translations or rotations of child hair, as is evidenced by your file, and I was able to render these experiments without crashes. To my mind, finding the quintessential element in your file which triggers this misbehavior is the key goal.

I don't think it is necessary to start a new bug report. The goal is being able to document a narrative starting with one of your blend files, above - or a simplified derivation of the same - and ending with a debugger stack trace that stems from a specific crash point. One matter you could illuminate for me is this: have you ever succeeded in weight-painting a mesh for controlling the density of child hair, and having no difficulty with disconnecting and reconnecting? There could be something subtle about how you go about doing this setup that I am missing.

@Marek Hollý (asil8567)
Update: Workaround

TL;DR - Guide hairs added through the particle editor only are not affected by disruptive translations, scalings or rotations under disconnect/connect cycles. Hair particles emitted by the particle system itself are affected. Set particle emissions to zero and add guide hair only through the particle editor.

This approach has given me some success tonight. It doesn't fix the bug, but if it works for you, you'll be able to move your project forward.

  1. Create your Vertex Group and set weights (weight paint).
  2. Create your particle system.
  3. In Particle system property settings, Vertex Groups --> Assign your vertex group to the Density channel
  4. In Particle system property settings, Emissions --> Number: Set to 0 (zero). In other words the particle system itself does not contribute any hair particles to the system.
  5. In Particle system property settings, Source --> Emit from Faces. You will be adding hair to the system solely through the Particle Editor Add tool. The Add tool is more responsive when it can hit an entire face, as opposed to an itty-bitty vertex.
  6. Switch the viewport to Particle Edit Mode
  7. Choose Add Tool
  8. In tool properties, set radius, count, steps, keys, and interpolate as you prefer.
  9. Add your hair patches as you prefer.
  10. Set up the remaining Particle System properties as you prefer.
  11. Test with disconnect/connect cycles. They should stay in place.

Nazar Noschenko's YouTube tutorial "Blender Hair Tutorial Part 1 - Styling the Hair" advises this emission == 0 step without explanation. Since this is a 2.79 tutorial from a few years ago, I surmise this bug (and its attendant workaround) has been around for a while.

If you could, confirm that this solves the problem for you? Thanks!

@Marek Hollý (asil8567)
Took me awhile to get to my desk last night, but I did run your file and confirm both your original report and the unusual rotations/translations which occur to child hair.
I also could reliably crash blender by test rendering (F12) while in particle edit mode. It does seem your file triggers a "certain fragility."
What I have not done - but, would very much like to do - is isolate what it is about your file that triggers that "certain fragility" and compose a simple (really, as simple as possible!) blend file that expresses the problem.
The tricky aspect of this bug is this: last night I made a number of meshes with vertex groups controlling hair density, making use of subdivision modifiers, and otherwise following the settings in your first posted blend file - and these examples behaved properly, to wit: disconnecting and reconnecting hair with interpolated children did not give rise to unusual scaling, translations or rotations of child hair, as is evidenced by your file, and I was able to render these experiments without crashes. To my mind, finding the quintessential element in your file which triggers this misbehavior is the key goal.
I don't think it is necessary to start a new bug report. The goal is being able to document a narrative starting with one of your blend files, above - or a simplified derivation of the same - and ending with a debugger stack trace that stems from a specific crash point. One matter you could illuminate for me is this: have you ever succeeded in weight-painting a mesh for controlling the density of child hair, and having no difficulty with disconnecting and reconnecting? There could be something subtle about how you go about doing this setup that I am missing.

Hi Garry

Sorry for delay. Thank you for taking a care. I will explain you the process, of this hairstyle creation - maybe you will see some discrepancy there, which is causing the problem, because those hairs were not done in clearly regular way, but were based on previous mesh with hairstyle.
Here is how it was done:
1 - I started to generate hair particles on head mesh version 0.
2 - particle density was driven by vertex groups (hari, brows, upper lids, lower lids...)
3 - particle length was further driven by texture maps
4 - I made hairstyle for all the hair particles on the head.
.. but then I received newer version of base head mesh - version 1. Hairstyle was done. on version 0, and I did not wanted to make it all from scratch. Since mesh topology changed, I was unable to use version 1 as shape applied to version 0. So I came to solution, it will be inevitable, to do it from scratch. So:
1 - I've created all the vertex groups on head 1, as identical as possible to head 0 , with same naming.
2 - I generated hair particles with same names and driven by same vertex groups as in head 0.
3 - BUT, as soon as hair particles were generated on head 1, I choose particle settings (from dropdown menu just under list of particles) from head 0 - I thought, I could save at least some time , when I take basic settings from head 0 - like: length, shape, amount, seed, and children settings.
PERSONALLY, I THINK THIS WAS A MISTAKE, BECAUSE I TOOK PARTICLE SETTINGS FROM ALREADY STYLED PARTICLES, AND USED IT AS BASIS FOR NEW UNSTYLED PARTICLES.
4 - Then I styled new particles on head1, during all this process I did not encountered any crash. But there was strange behaviour on eyebrows, when I was unable to use texture to drive length of particles - specifically - cutting the length worked well on just one half of mesh (i do not have any mirror modifiers), Texture and UV layout is symmetrical without any UV overlaps.. I do not remember exact steps, but as far as I remember, I had to paint completely new texture to be able to cut eyebrows symmetricaly.
5 - After style was done, I've realized, my head scale is 0.01, but I need scale of 1. So I've disconnected particles, applied object transforms, and then reconnected particles, and this is whereI've realized, something is wrong. Because, disconnecting and reconnecting particles even without applying object transforms, did not worked. So I decided to create bug report.

Hopefully, this will help you to track down the issue, so another users will not experience similar problems.

Thanks

Marek

@Marek Hollý (asil8567)
Update: Workaround
TL;DR - Guide hairs added through the particle editor only are not affected by disruptive translations, scalings or rotations under disconnect/connect cycles. Hair particles emitted by the particle system itself are affected. Set particle emissions to zero and add guide hair only through the particle editor.
This approach has given me some success tonight. It doesn't fix the bug, but if it works for you, you'll be able to move your project forward.

  1. Create your Vertex Group and set weights (weight paint).
  2. Create your particle system.
  3. In Particle system property settings, Vertex Groups --> Assign your vertex group to the Density channel
  4. In Particle system property settings, Emissions --> Number: Set to 0 (zero). In other words the particle system itself does not contribute any hair particles to the system.
  5. In Particle system property settings, Source --> Emit from Faces. You will be adding hair to the system solely through the Particle Editor Add tool. The Add tool is more responsive when it can hit an entire face, as opposed to an itty-bitty vertex.
  6. Switch the viewport to Particle Edit Mode
  7. Choose Add Tool
  8. In tool properties, set radius, count, steps, keys, and interpolate as you prefer.
  9. Add your hair patches as you prefer.
  10. Set up the remaining Particle System properties as you prefer.
  11. Test with disconnect/connect cycles. They should stay in place.

Nazar Noschenko's YouTube tutorial "Blender Hair Tutorial Part 1 - Styling the Hair" advises this emission == 0 step without explanation. Since this is a 2.79 tutorial from a few years ago, I surmise this bug (and its attendant workaround) has been around for a while.
If you could, confirm that this solves the problem for you? Thanks!

So, I tested this approach, and I can confirm, Disconnect/Connetct works well! So, partially it solves my problem, but still I have to create hairstyle from scratch.
Thank you.
Marek.

After spending some time experimenting with this, I am convinced that this report is another manifestation of T54488.
While that report has "mirror modifier" in its title, later work by @omgold (omgold) uncovered broader difficulties with disconnecting/reconnecting hair particles while other modifiers are on the stack, in particular the subdivision modifier, which this poster also included in the stack. See @omgold (omgold) 's commentary there for particulars, along with his emails with @Brecht Van Lommel (brecht). Essentially this is an old 2.7x particle system bug that has carried over to 2.80.
Perhaps there ought to be a "documentation fix" to this and T54488; to wit: avoid (or first apply) modifiers before undertaking hair particle editing sessions, or follow "Noschenko's Rule" and work with "emissions = 0" systems; for reasons that are not entirely clear to me, hair particles originating from particle editing sessions have less difficulty re-finding their root locations after a disconnect/reconnect cycle.