Hair particles: rekeying, cut tool, subdividing do not interpolate existing weights (breaking simulation) #62993

Open
opened 2019-03-27 07:44:36 +01:00 by Lance Phan · 12 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 418.81

Blender Version
Broken: version: 2.80 (sub 51), branch: blender2.7, commit date: 2019-03-25 23:15, hash: adfdae3fc2
Worked: (optional)
Just click once sometimes work right

Short description of error
[Please fill out a short description of the error here]

This bug happen in both 2.79 and 2.8
Click and drag the hair cut tool mess up the vertices position, especially after subdividing one or 2 segments of the hair. After the hair is messed up, it can't be fixed using rekey command.
Dragging the cut tool on a hair that is not subdivided also cause the problem, but not as severely, the vertices become unevenly positioned.

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

Create a hair system on the default cube, set the emission number to 1.
Go to particle edit mode, subdivide one or 2 segments of the hair.
Use the cut tool, click and drag from the tip of the hair.
The hair is now completely messed up.

**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 418.81 **Blender Version** Broken: version: 2.80 (sub 51), branch: blender2.7, commit date: 2019-03-25 23:15, hash: `adfdae3fc2` Worked: (optional) Just click once sometimes work right **Short description of error** [Please fill out a short description of the error here] This bug happen in both 2.79 and 2.8 Click and drag the hair cut tool mess up the vertices position, especially after subdividing one or 2 segments of the hair. After the hair is messed up, it can't be fixed using rekey command. Dragging the cut tool on a hair that is not subdivided also cause the problem, but not as severely, the vertices become unevenly positioned. **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] Create a hair system on the default cube, set the emission number to 1. Go to particle edit mode, subdivide one or 2 segments of the hair. Use the cut tool, click and drag from the tip of the hair. The hair is now completely messed up.
Author

Added subscriber: @ssendam

Added subscriber: @ssendam

#102851 was marked as duplicate of this issue

#102851 was marked as duplicate of this issue

#67301 was marked as duplicate of this issue

#67301 was marked as duplicate of this issue
Author

Any update on this bug ?
The cut tool can make our lives so much easier, but it's not usable with the current state.

Any update on this bug ? The cut tool can make our lives so much easier, but it's not usable with the current state.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

Added subscriber: @grosgood

Added subscriber: @grosgood

@ssendam wrote:

The hair is now completely messed up.

A few notes to somewhat resolve this broadly contoured observation.

Create a hair system on the default cube, set the emission number to 1.

Mine looks like this:
solo_01.png
The single hair particle has three keys: one root, one midway key and one tip.
Here is a weight dump of those keys from the python console:

>>> solo = bpy.context.active_object.particle_systems['Solo']
>>> type(solo)
<class 'bpy.types.ParticleSystem'>
>>> for k in solo.particles[0].hair_keys : k.weight 

1.0
0.5
0.0

>>>

This is the visualization of the hair and its keys, using the weight paint tool while in Particle Edit mode. The root has a weight of one, the tip has a weight of zero and the midway key has a weight of one-half.
solo_02.png
By the way, the host mesh is a one-face plane. We're peering down the Y+ axis toward the origin, Orthographic projection.
For readers new to the Blender Hair Party, hair key weights engender immobility under Hair Dynamics. Under the root, weight 1.0, is frozen in place. The tip, weight 0.0, is freely affected by gravity and such. The midway key is half-immobile at 0.5.

Go to particle edit mode, subdivide one or 2 segments of the hair.

I'll subdivide the segment between the midway key (weight 0.5: 'green') and the root key (weight 1.0: 'red')
solo_03.png
We are in the weeds. Select two keys and subdivide from the right-hand mouse button menu invokes ##bpy.ops.particle.subdivide()## which places a new key nicely between the two selected keys - but weights it at zero.

>>> for k in solo.particles[0].hair_keys: k.weight
... 

1.0
0.0
0.5
0.0

>>> 

This leads to non uniform hair dynamics - nice, if that is what is wanted, but, for users unaware of no-longer-evenly descending weights on the keys, it is, I suspect, the first step down the road to having completely messed up hair: Under gravity, the keys will fall at non-ascending rates. Short discussion: the hair will hang funny. This appears to be #67301 rearing its head.

Use the cut tool, click and drag from the tip of the hair.

Emphasis mine. Click (and no drag) evenly spaces the keys along the surviving length. Note that Blender preserves the key count: it does not remove keys during cuts. Click and drag, however, makes the interior keys - those between the tip and root - dance randomly.
solo_04.png
On button release, the intervals between keys vary randomly. Short discussion: the hair will hang even more funnily.

The hair is now completely messed up.

Indeed.
Hopefully, these notes will be helpful to the occasional particle repairmen who happen by, now and again.
[Edit]
Neglected to upload the test file.

T62993_solohair.blend

@ssendam wrote: > The hair is now completely messed up. A few notes to somewhat resolve this broadly contoured observation. > Create a hair system on the default cube, set the emission number to 1. Mine looks like this: ![solo_01.png](https://archive.blender.org/developer/F7953269/solo_01.png) The single hair particle has three keys: one root, one midway key and one tip. Here is a weight dump of those keys from the python console: ``` >>> solo = bpy.context.active_object.particle_systems['Solo'] >>> type(solo) <class 'bpy.types.ParticleSystem'> >>> for k in solo.particles[0].hair_keys : k.weight ``` 1.0 0.5 0.0 ``` >>> ``` This is the visualization of the hair and its keys, using the weight paint tool while in Particle Edit mode. The root has a weight of one, the tip has a weight of zero and the midway key has a weight of one-half. ![solo_02.png](https://archive.blender.org/developer/F7953285/solo_02.png) By the way, the host mesh is a one-face plane. We're peering down the Y+ axis toward the origin, Orthographic projection. For readers new to the Blender Hair Party, hair key weights engender immobility under Hair Dynamics. Under the root, weight 1.0, is frozen in place. The tip, weight 0.0, is freely affected by gravity and such. The midway key is half-immobile at 0.5. > Go to particle edit mode, subdivide one or 2 segments of the hair. I'll subdivide the segment between the midway key (weight 0.5: 'green') and the root key (weight 1.0: 'red') ![solo_03.png](https://archive.blender.org/developer/F7953297/solo_03.png) We are in the weeds. Select two keys and subdivide from the right-hand mouse button menu invokes ##bpy.ops.particle.subdivide()## which places a new key nicely between the two selected keys - but weights it at zero. ``` >>> for k in solo.particles[0].hair_keys: k.weight ... ``` 1.0 0.0 0.5 0.0 ``` >>> ``` This leads to non uniform hair dynamics - nice, if that is what is wanted, but, for users unaware of no-longer-evenly descending weights on the keys, it is, I suspect, the first step down the road to having completely messed up hair: Under gravity, the keys will fall at non-ascending rates. Short discussion: the hair will hang funny. This appears to be #67301 rearing its head. > Use the cut tool, **click and drag** from the tip of the hair. Emphasis mine. Click (and no drag) evenly spaces the keys along the surviving length. Note that Blender preserves the key count: it does not remove keys during cuts. **Click and drag,** however, makes the interior keys - those between the tip and root - dance randomly. ![solo_04.png](https://archive.blender.org/developer/F7953359/solo_04.png) On button release, the intervals between keys vary randomly. Short discussion: the hair will hang even more funnily. > The hair is now completely messed up. Indeed. Hopefully, these notes will be helpful to the occasional particle repairmen who happen by, now and again. [Edit] Neglected to upload the test file. [T62993_solohair.blend](https://archive.blender.org/developer/F7958789/T62993_solohair.blend)
Philipp Oeser changed title from hair cut tool severely mess up the hair to Hair particles: rekeying, cut tool, subdividing do not interpolate existing weights (breaking simulation) 2019-11-20 12:42:26 +01:00
Member

Added subscribers: @Radical, @ZedDB

Added subscribers: @Radical, @ZedDB
Philipp Oeser self-assigned this 2020-02-06 11:05:35 +01:00
Member

Hopefully, we can sneak this improvement in when doing the work on #68981 (New curves object type).
For now, this will be tagged as Known Issue...

Hopefully, we can sneak this improvement in when doing the work on #68981 (New curves object type). For now, this will be tagged as Known Issue...
Philipp Oeser removed their assignment 2020-11-17 14:07:24 +01:00
Member

Stepping down due to time constraints and to not block this task.
It seems more reasonable to work on #68981 instead.

Stepping down due to time constraints and to not block this task. It seems more reasonable to work on #68981 instead.

Added subscriber: @rwman

Added subscriber: @rwman
Member

Added subscriber: @s12a

Added subscriber: @s12a
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:47:58 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#62993
No description provided.