2.77a hair mesh collisions don't work for emitter object #48535

Closed
opened 2016-05-28 08:08:14 +02:00 by David Jeske · 8 comments

System Information
windows10, NVidia GTX 970

Blender Version
Broken: 2.77a abf6f08
Worked: ??

Short description of error

When using hair/mesh collision detection, particles ignore the emitter mesh.

Exact steps for others to reproduce the error

  1. Load this blend

https://dl.dropboxusercontent.com/u/428467/hair_mesh_collision_1.blend

  1. select "emitter object", goto particle properties, cache subpanel
  2. click "bake"
  3. WITNESS: scrub the baked frames, and witness the hair collides with the "test collider", but not "emitter object" (both of them have collisions turned on)
  4. EXPECTED: the particles to correctly collide with the "emitter object"

Note: if you duplicate "emitter object", delete the particle system from the copy, and re-bake the simulation, the hair will correctly collide with the duplicate of emitter object.

**System Information** windows10, NVidia GTX 970 **Blender Version** Broken: 2.77a abf6f08 Worked: ?? **Short description of error** When using hair/mesh collision detection, particles ignore the emitter mesh. **Exact steps for others to reproduce the error** 1) Load this blend https://dl.dropboxusercontent.com/u/428467/hair_mesh_collision_1.blend 2) select "emitter object", goto particle properties, cache subpanel 3) click "bake" 4) WITNESS: scrub the baked frames, and witness the hair collides with the "test collider", but not "emitter object" (both of them have collisions turned on) 5) EXPECTED: the particles to correctly collide with the "emitter object" Note: if you duplicate "emitter object", delete the particle system from the copy, and re-bake the simulation, the hair will correctly collide with the duplicate of emitter object.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @DavidJeske

Added subscriber: @DavidJeske

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2016-05-29 18:40:43 +02:00

Not sure this has ever been supported? Would need some kind of 'self intersection' option (like e.g. cloth)…

In any case, this is not a bug, rather a feature request - and on a feature that we intend to rewrite from scratch for 2.8…

Not sure this has ever been supported? Would need some kind of 'self intersection' option (like e.g. cloth)… In any case, this is not a bug, rather a feature request - and on a feature that we intend to rewrite from scratch for 2.8…
Author

I want to add a few pieces of information.. and ask some questions.

In this case, I wasn't talking about the hair intersecting with itself, which would be analagous to cloth self collision. I was talking about hair colliding with the emission mesh that it spawns from. I would expect if there was a collision modifier in the stack before the particle spawn, that the version of the mesh sent to the collision modifier would be available for the particle system to collide against.

The particle tools (comb etc) seem to have no problem doing collisions between the particles and the emission mesh to prevent particles from interpenetrating the emission mesh.

Hair is often spawned from a character model. Using hair dynamics for long hair requires the ability to prevent the hair from interpenetrating the character model it spawned from, which is the emission mesh.

If you still think this is a "feature request", that's fine.

Here are my questions.... 2.8 sounds a long way off. In the meantime, can you share any thoughts about why this is non-trivial to support today (especially considering the comb tools do it)?

As I mentioned above, I expected that putting the collision modifier in before the particle system would cause that modifier to be processed first, and thus that version of the mesh to be available for collisions in hair dynamics. Why doesn't it work this way? Is there something preventing it from working this way?

I want to add a few pieces of information.. and ask some questions. In this case, I wasn't talking about the hair intersecting with itself, which would be analagous to cloth self collision. I was talking about hair colliding with the emission mesh that it spawns from. I would expect if there was a collision modifier in the stack before the particle spawn, that the version of the mesh sent to the collision modifier would be available for the particle system to collide against. The particle tools (comb etc) seem to have no problem doing collisions between the particles and the emission mesh to prevent particles from interpenetrating the emission mesh. Hair is often spawned from a character model. Using hair dynamics for long hair requires the ability to prevent the hair from interpenetrating the character model it spawned from, which is the emission mesh. If you still think this is a "feature request", that's fine. Here are my questions.... 2.8 sounds a long way off. In the meantime, can you share any thoughts about why this is non-trivial to support today (especially considering the comb tools do it)? As I mentioned above, I expected that putting the collision modifier in before the particle system would cause that modifier to be processed first, and thus that version of the mesh to be available for collisions in hair dynamics. Why doesn't it work this way? Is there something preventing it from working this way?
Author

On ... https://wiki.blender.org/index.php/Dev:Source/Physics/Collision_Modifier

It says:

"The collision modifier safes the position of the vertices of the object at the corresponding position on the modifier stack. It does this for the current and the last position using GLOBAL coordinates. The data is only valid as long as

  • you don't skip ahead/back several frames [TODO: should be enhanced later]
  • the number of vertices don't change on the modifier stack."

Is this related? Is the collision modifier information being invalidated when the particle system adds verticies to the derived mesh? Why is it necessary to invalidate the collision modifer 'safe' when verticies are added? It seems like the entire point of the collision modifier is to save the state of the object at that point, regardless of what happens later in the modifier stack.

On ... https://wiki.blender.org/index.php/Dev:Source/Physics/Collision_Modifier It says: "The collision modifier safes the position of the vertices of the object at the corresponding position on the modifier stack. It does this for the current and the last position using GLOBAL coordinates. The data is only valid as long as * you don't skip ahead/back several frames [TODO: should be enhanced later] * the number of vertices don't change on the modifier stack." Is this related? Is the collision modifier information being invalidated when the particle system adds verticies to the derived mesh? Why is it necessary to invalidate the collision modifer 'safe' when verticies are added? It seems like the entire point of the collision modifier is to save the state of the object at that point, regardless of what happens later in the modifier stack.
Author

Considering normal (non-hair) particle dynamics for a moment. Normal particles skip collision checks with their emitter, because of this code in particle_system.c:dynamics_step(). The second parameter (sim->ob) causes it to skip itself when constructing the collider list.

  if (part->type != PART_HAIR)
     sim->colliders = get_collider_cache(sim->scene, sim->ob, NULL);

If I change this to:

  if (part->type != PART_HAIR)
     sim->colliders = get_collider_cache(sim->scene, NULL, NULL);

Then placing a collision modifier on a particle emitter seems to correctly cause the particles to collide with their own emitter in some simple tests.

So this begs the question..

Why do normal particle dynamics specifically ignore the emitter object? Does this cause problems in certain situations? What situations?

Hair particles don't use particle-dynamics, but cloth-modifier dynamics. The cloth code calls also calls get_collider_cache() ignoring itself, and it handles self-collision explicitly. This makes sense for cloth, but I don't see why it needs to be this way for hair. Experimenting with changing this is a bit more tricky, because the cloth sim code doesn't currently know when it's being used for hair sim vs cloth sim.

Considering normal (non-hair) particle dynamics for a moment. Normal particles skip collision checks with their emitter, because of this code in particle_system.c:dynamics_step(). The second parameter (sim->ob) causes it to skip itself when constructing the collider list. ``` if (part->type != PART_HAIR) sim->colliders = get_collider_cache(sim->scene, sim->ob, NULL); ``` If I change this to: ``` if (part->type != PART_HAIR) sim->colliders = get_collider_cache(sim->scene, NULL, NULL); ``` Then placing a collision modifier on a particle emitter seems to correctly cause the particles to collide with their own emitter in some simple tests. So this begs the question.. Why do normal particle dynamics specifically ignore the emitter object? Does this cause problems in certain situations? What situations? Hair particles don't use particle-dynamics, but cloth-modifier dynamics. The cloth code calls also calls get_collider_cache() ignoring itself, and it handles self-collision explicitly. This makes sense for cloth, but I don't see why it needs to be this way for hair. Experimenting with changing this is a bit more tricky, because the cloth sim code doesn't currently know when it's being used for hair sim vs cloth sim.
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
2 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#48535
No description provided.