hair sculpt collision doesn't work well with real scale human head. #115843

Open
opened 2023-12-06 13:58:09 +01:00 by Massimiliano Puliero · 7 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 546.17

Blender Version
Broken: version: 3.6.5, branch: blender-v3.6-release, commit date: 2023-10-16 14:30, hash: cf1e1ed46b7e

Short description of error
Collision activated in hair sculpt mode prevent to comb the hair is the model is a real scale human head.

Exact steps for others to reproduce the error

  • open the .blend file attached
  • try to comb the hair.

Thank you
Max

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 546.17 **Blender Version** Broken: version: 3.6.5, branch: blender-v3.6-release, commit date: 2023-10-16 14:30, hash: `cf1e1ed46b7e` **Short description of error** Collision activated in hair sculpt mode prevent to comb the hair is the model is a real scale human head. <video src="/attachments/73f5ff70-a407-48c0-8db4-5c1dedf75d20" controls></video> **Exact steps for others to reproduce the error** - open the .blend file attached - try to comb the hair. Thank you Max
Massimiliano Puliero added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-12-06 13:58:10 +01:00
Iliya Katushenock added the
Interest
Nodes & Physics
Interest
Sculpt, Paint & Texture
labels 2023-12-06 14:50:35 +01:00
Richard Antalik added
Module
Sculpt, Paint & Texture
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-12-06 21:12:42 +01:00

Thank you for the report.
I can confirm the issue and it will be forwarded to the developers for further inspection.

Thank you for the report. I can confirm the issue and it will be forwarded to the developers for further inspection.
Member

Collision radius was made larger in a76b5d3a07 (think we should probably use actually used mean radius instead).

However, there is also another issue which I think is wrong: as soon as one point inside the brush radius has a collision detected, the whole curve gets reset, think there are still valid points to be moved here in such a case, will check on this...

Collision radius was made larger in a76b5d3a077e14c40a8c610fef36a5a4e2068def (think we should probably use actually used mean radius instead). However, there is also another issue which I think is wrong: as soon as one point inside the brush radius has a collision detected, the whole curve gets reset, think there are still valid points to be moved here in such a case, will check on this...
Philipp Oeser self-assigned this 2023-12-07 11:23:23 +01:00
Member

Looked at this a bit, and the solution from e7606139ba has the problem that it keeps running into max iterations of the collision solver (and just freezes the whole curve).

There might not be a way around this (had a clumsy try at it, see below, but that probably has other issues then).

diff --git a/source/blender/geometry/intern/curve_constraints.cc b/source/blender/geometry/intern/curve_constraints.cc
index d19ce0bcfdb..991daeff56f 100644
--- a/source/blender/geometry/intern/curve_constraints.cc
+++ b/source/blender/geometry/intern/curve_constraints.cc
@@ -161,8 +161,12 @@ void solve_length_and_collision_constraints(const OffsetIndices<int> points_by_c
           else {
             /* Minimum distance is larger than allowed segment length.
              * The unilateral collision constraint is satisfied by just clamping segment length. */
+            /* For points originally inside the ray radius of the surface, this will keep
+             * iterating, eventually hitting "max_collisions" and thus revert/freeze the whole
+             * curve. Maybe better to just break here? */
             positions_cu[point_i] = prev_pos_cu + math::normalize(old_pos_su - prev_pos_cu) *
                                                       goal_segment_length_cu;
+            break;
           }
         }
         if (used_iterations == max_collisions) {

Probably the best way now would be to make the collision distance a setting (just as the old particle system had)?
image

Anyhow, will step down, I think @LukasTonne or @JacquesLucke better look at this

Looked at this a bit, and the solution from e7606139ba186aa4e8421a5eea277f15cfc3b358 has the problem that it keeps running into max iterations of the collision solver (and just freezes the whole curve). There might not be a way around this (had a clumsy try at it, see below, but that probably has other issues then). ```Diff diff --git a/source/blender/geometry/intern/curve_constraints.cc b/source/blender/geometry/intern/curve_constraints.cc index d19ce0bcfdb..991daeff56f 100644 --- a/source/blender/geometry/intern/curve_constraints.cc +++ b/source/blender/geometry/intern/curve_constraints.cc @@ -161,8 +161,12 @@ void solve_length_and_collision_constraints(const OffsetIndices<int> points_by_c else { /* Minimum distance is larger than allowed segment length. * The unilateral collision constraint is satisfied by just clamping segment length. */ + /* For points originally inside the ray radius of the surface, this will keep + * iterating, eventually hitting "max_collisions" and thus revert/freeze the whole + * curve. Maybe better to just break here? */ positions_cu[point_i] = prev_pos_cu + math::normalize(old_pos_su - prev_pos_cu) * goal_segment_length_cu; + break; } } if (used_iterations == max_collisions) { ``` Probably the best way now would be to make the collision distance a setting (just as the old particle system had)? ![image](/attachments/d60e614c-fc94-4ec4-862a-b8f64c767f39) Anyhow, will step down, I think @LukasTonne or @JacquesLucke better look at this
Philipp Oeser removed their assignment 2023-12-07 14:56:10 +01:00
Philipp Oeser added
Module
Nodes & Physics
and removed
Module
Sculpt, Paint & Texture
labels 2023-12-07 14:56:28 +01:00

I recompiled Blender with the old radius of 0.001f and it works much better. Curve collision is useless in current form with 1:1 scale.

I don't observe any huge freezing issues. The only non-optimal behavior is that I can't really slide a hair strand sideways (tangent) easily across a surface. I have to comb it away a bit first. This is still much less annoying than not being able to use curve collision at all.

Can the distance value be made adjustable?

I recompiled Blender with the old radius of 0.001f and it works *much* better. Curve collision is useless in current form with 1:1 scale. I don't observe any huge freezing issues. The only non-optimal behavior is that I can't really slide a hair strand *sideways* (tangent) easily across a surface. I have to comb it away a bit first. This is still much less annoying than not being able to use curve collision at all. Can the distance value be made adjustable?
Member

I'm fine with exposing the value. Just need to find a good place in the UI. Do you want to make a pull request?

It's a little bit related to the hair radius, but it seems reasonable to decouple the surface collision distance from the curve radius.

I'm fine with exposing the value. Just need to find a good place in the UI. Do you want to make a pull request? It's a little bit related to the hair radius, but it seems reasonable to decouple the surface collision distance from the curve radius.

A PR for the UI or for the default distance? I don't have the knowledge to make a UI change. I agree though that it would be very nice to have it as a UI value. Right now it's hardcoded in the eval function for curve hair sculpting.

A PR for the UI or for the default distance? I don't have the knowledge to make a UI change. I agree though that it would be very nice to have it as a UI value. Right now it's hardcoded in the eval function for curve hair sculpting.
Member

I meant a PR that includes the UI, but it's fine if that is a bit out of scope for you.

I meant a PR that includes the UI, but it's fine if that is a bit out of scope for you.
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
5 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#115843
No description provided.