Invalid normals after undo in sculpt mode #95185

Closed
opened 2022-01-24 19:57:10 +01:00 by Diogo Valadares Reis dos Santos · 19 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 21.12.1 30.0.14011.3017

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-23 19:27, hash: abf30007ab

Caused by d9c6ceb3b8

Short description of error
Whenever sculpting some actions do not update the normals of the surface while others create weird visual glitching.

Exact steps for others to reproduce the error

#95185.blend

  • open file
  • enter sculptmode
  • do random stroke with the pose brush
  • undo
  • observe normals not updating correctly

before
image.png
after
image.png

Examples are:
Ctrl + z after pose brush

image.png
image.png
image.png

Projection brush and ctrl+z projection

image.png
image.png

mesh fairing and ctrl+z the mesh fairing
image.png
image.png

The normals only update if the region is interacted with again with another brush. Leaving sculpt mode gets back to normal, but entering sculpt mode again brings the weird normals back

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 21.12.1 30.0.14011.3017 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-23 19:27, hash: `abf30007ab` Caused by d9c6ceb3b8 **Short description of error** Whenever sculpting some actions do not update the normals of the surface while others create weird visual glitching. **Exact steps for others to reproduce the error** [#95185.blend](https://archive.blender.org/developer/F12823210/T95185.blend) - open file - enter sculptmode - do random stroke with the pose brush - undo - observe normals not updating correctly before ![image.png](https://archive.blender.org/developer/F12823221/image.png) after ![image.png](https://archive.blender.org/developer/F12823225/image.png) --- Examples are: Ctrl + z after pose brush ![image.png](https://archive.blender.org/developer/F12821620/image.png) ![image.png](https://archive.blender.org/developer/F12821623/image.png) ![image.png](https://archive.blender.org/developer/F12821626/image.png) Projection brush and ctrl+z projection ![image.png](https://archive.blender.org/developer/F12821634/image.png) ![image.png](https://archive.blender.org/developer/F12821630/image.png) mesh fairing and ctrl+z the mesh fairing ![image.png](https://archive.blender.org/developer/F12821649/image.png) ![image.png](https://archive.blender.org/developer/F12821652/image.png) The normals only update if the region is interacted with again with another brush. Leaving sculpt mode gets back to normal, but entering sculpt mode again brings the weird normals back

Added subscriber: @Diogo_Valadares

Added subscriber: @Diogo_Valadares

#95406 was marked as duplicate of this issue

#95406 was marked as duplicate of this issue
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hi, thanks for the report. Please provide sample .blend file for reproducing the issue.

Hi, thanks for the report. Please provide sample .blend file for reproducing the issue.

well, the file I'm working on is pretty heavy, but I managed to reproduce it just by using a high poly mesh.

In the case below a subdivided cilinder:

image.png
image.png
fair the pink part.blend

And while trying to reproduce it again, I noted that it only happens if the mesh is in Shade Smooth. on flat shading the problem does not occur. I also tested with factory settings but the problem persists.

well, the file I'm working on is pretty heavy, but I managed to reproduce it just by using a high poly mesh. In the case below a subdivided cilinder: ![image.png](https://archive.blender.org/developer/F12823139/image.png) ![image.png](https://archive.blender.org/developer/F12823141/image.png) [fair the pink part.blend](https://archive.blender.org/developer/F12823168/fair_the_pink_part.blend) And while trying to reproduce it again, I noted that it only happens if the mesh is in Shade Smooth. on flat shading the problem does not occur. I also tested with factory settings but the problem persists.

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm, assume this is caused by d9c6ceb3b8, will check

Can confirm, assume this is caused by d9c6ceb3b8, will check
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

@HooglyBoogly : mind checking?

@HooglyBoogly : mind checking?
Member

Added subscriber: @JosephEagar

Added subscriber: @JosephEagar
Member

I've spent a few hours testing various things-- marking PBVH nodes for updates, tagging verts for updates, skipping dirty checks in the PBVH normal calculation, tagging mesh normals dirty in various places in the sculpt undo code, trying to restore normals from SculptUndoNode::no. None of it has worked, except completely replacing the PBVH normal calculation with the Mesh function.

I understand the sculpt undo system a bit better now, but I haven't been able to wrap my head around the state it expects everything to be in. In particular, it's not actually clear to me how SculptUndoNode::no is supposed to be used, or even if it is used at all.

I need a break from this for the day, but I'll try again tomorrow. Maybe someone with more experience with the sculpt undo system would be able to spot the error much quicker. Maybe @JosephEagar?

I've spent a few hours testing various things-- marking PBVH nodes for updates, tagging verts for updates, skipping dirty checks in the PBVH normal calculation, tagging mesh normals dirty in various places in the sculpt undo code, trying to restore normals from `SculptUndoNode::no`. None of it has worked, except completely replacing the PBVH normal calculation with the `Mesh` function. I understand the sculpt undo system a bit better now, but I haven't been able to wrap my head around the state it expects everything to be in. In particular, it's not actually clear to me how `SculptUndoNode::no` is supposed to be used, or even if it *is* used at all. I need a break from this for the day, but I'll try again tomorrow. Maybe someone with more experience with the sculpt undo system would be able to spot the error much quicker. Maybe @JosephEagar?
Hans Goudey changed title from Several Normal glitches/delayed updates in sculpt mode to Invalid normals after undo in sculpt mode 2022-01-27 23:03:55 +01:00
Member

I've created a prototype patch here: D13939: Fix #95185: Invalid normals after undo in sculpt mode

Ideally I would get the opinion of someone more experienced in this area.

I've created a prototype patch here: [D13939: Fix #95185: Invalid normals after undo in sculpt mode](https://archive.blender.org/developer/D13939) Ideally I would get the opinion of someone more experienced in this area.

I have another problem with normals in sculpt mode but I'm not sure if its related to this one. I'm not sure what I am doing to make it but I'm guessing its something to do with dyntopo/wireframe view.

image.png

image.png

I get these "lines" that change place when I sculpt over then. I don't know if I should open another report for this one.

I have another problem with normals in sculpt mode but I'm not sure if its related to this one. I'm not sure what I am doing to make it but I'm guessing its something to do with dyntopo/wireframe view. ![image.png](https://archive.blender.org/developer/F12831103/image.png) ![image.png](https://archive.blender.org/developer/F12831105/image.png) I get these "lines" that change place when I sculpt over then. I don't know if I should open another report for this one.

This issue was referenced by c8814fb610

This issue was referenced by c8814fb6103f2e028c857872f4f0eb613ef75db9

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2022-02-01 05:36:34 +01:00
Member

Added subscriber: @IlyasseL

Added subscriber: @IlyasseL
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#95185
No description provided.