Fix #95419: Sculpt: Invert visible hides all faces with Multires modifier #121929

Merged
Raul Fernandez Hernandez merged 8 commits from farsthary/blender:grids_visibility_fix into main 2024-05-29 06:03:07 +02:00

Fix for sculpt mode: invert visible hides all faces with Multires modifier #95419

Grids face indices should not change on the fly based on hidden state.
It caused the rendering glitches shown on the original bug report and the attached recordings.

  • this PR removes the unnecessary check and dependency of grids visibility with the smooth/sharp of faces.
  • replaces smooth flag for sharp flag which better express the intent and simplifies the logic.
Fix for sculpt mode: invert visible hides all faces with Multires modifier #95419 Grids face indices should not change on the fly based on hidden state. It caused the rendering glitches shown on the original bug report and the attached recordings. * this PR removes the unnecessary check and dependency of grids visibility with the smooth/sharp of faces. * replaces smooth flag for sharp flag which better express the intent and simplifies the logic.
Raul Fernandez Hernandez added 4 commits 2024-05-17 23:51:27 +02:00
Raul Fernandez Hernandez requested review from Sergey Sharybin 2024-05-17 23:52:04 +02:00
Raul Fernandez Hernandez requested review from Hans Goudey 2024-05-17 23:52:04 +02:00
Raul Fernandez Hernandez added this to the Sculpt, Paint & Texture project 2024-05-17 23:52:19 +02:00
Raul Fernandez Hernandez requested review from Pratik Borhade 2024-05-17 23:58:18 +02:00
Member

Just a nit, PR title format for this would probably be better as something like

Fix #95419: Avoid changing vert index on multires visibility
Just a nit, PR title format for this would probably be better as something like ``` Fix #95419: Avoid changing vert index on multires visibility ```
Raul Fernandez Hernandez changed title from Fix sculpt mode: invert visible hides all faces with Multires modifier #95419 to Fix #95419: Avoid changing vert index on multires visibility 2024-05-18 02:52:33 +02:00
Hans Goudey reviewed 2024-05-20 01:40:31 +02:00
Hans Goudey left a comment
Member

Since the PR mostly moves code from one place to another it's hard to see where the actual logic change is. Do you think you could structure the final code so the diff is simpler? Or commit a cleanup so that the logic fix is a smaller diff?

Since the PR mostly moves code from one place to another it's hard to see where the actual logic change is. Do you think you could structure the final code so the diff is simpler? Or commit a cleanup so that the logic fix is a smaller diff?
Author
Member

Since the PR mostly moves code from one place to another it's hard to see where the actual logic change is. Do you think you could structure the final code so the diff is simpler? Or commit a cleanup so that the logic fix is a smaller diff?

Disagree, If small PR like this have issues with comprehension then PR's like this https://projects.blender.org/blender/blender/pulls/121835/files are incomprehensible and hence never-to-be-approved?

> Since the PR mostly moves code from one place to another it's hard to see where the actual logic change is. Do you think you could structure the final code so the diff is simpler? Or commit a cleanup so that the logic fix is a smaller diff? Disagree, If small PR like this have issues with comprehension then PR's like this https://projects.blender.org/blender/blender/pulls/121835/files are incomprehensible and hence never-to-be-approved?
Member

Separating cleanups and logic fixes is the most basic thing we can do for each other to make the code review process easier. This PR is a clear example of where that would help because the logic fix is relatively small and the cleanups are listed as separate changes in the description. This is not just for reviewers but future developers who have to make sense of the git history.

Separating cleanups and logic fixes is the most basic thing we can do for each other to make the code review process easier. This PR is a clear example of where that would help because the logic fix is relatively small and the cleanups are listed as separate changes in the description. This is not just for reviewers but future developers who have to make sense of the git history.
Raul Fernandez Hernandez added 1 commit 2024-05-20 21:33:15 +02:00
Author
Member

Resolved

Resolved
Raul Fernandez Hernandez added 1 commit 2024-05-21 18:18:58 +02:00
Raul Fernandez Hernandez added 1 commit 2024-05-21 18:23:48 +02:00
Raul Fernandez Hernandez requested review from Hans Goudey 2024-05-21 18:24:41 +02:00

For the title of the PR, follow the commit message guidelines. It should be explaining what is the user-level break. The details about vertex indices can go into the fuller description.

I am not sure if i can do proper review here, as I don't seem to be able to reproduce the issue. From reading the code I can not really understand why do we need to follow different ways (tris vs. quads) depending on the hidden state. Both of the tris and quads code paths seems to do hidden check, so indeed the extra logic can be removed.

For the title of the PR, follow the [commit message guidelines](https://developer.blender.org/docs/handbook/guidelines/commit_messages/#bug-fixes). It should be explaining what is the user-level break. The details about vertex indices can go into the fuller description. I am not sure if i can do proper review here, as I don't seem to be able to reproduce the issue. From reading the code I can not really understand why do we need to follow different ways (tris vs. quads) depending on the hidden state. Both of the tris and quads code paths seems to do hidden check, so indeed the extra logic can be removed.
Sergey Sharybin reviewed 2024-05-23 10:10:31 +02:00
@ -1183,2 +1168,2 @@
if (!smooth) {
bool sharp = (!sharp_faces.is_empty() && sharp_faces[grid_to_face_map[grid_index]]);
if (sharp) {

I'd do it as if (!sharp_faces.is_empty() && sharp_faces[grid_to_face_map[grid_index]]). No need to have an extra variable like that.

I'd do it as `if (!sharp_faces.is_empty() && sharp_faces[grid_to_face_map[grid_index]])`. No need to have an extra variable like that.

Even better:

if (is_empty()){
  continue;
}
if (!sharp_faces[grid_to_face_map[grid_index]]) {
  continue;
}
needs_tri_index = false;
break;
Even better: ```Cpp if (is_empty()){ continue; } if (!sharp_faces[grid_to_face_map[grid_index]]) { continue; } needs_tri_index = false; break; ```

I don't think this is necessarily better. It'll bite you back when/if there will be another condition under which the needs_tri_index would need to be disabled.

I don't think this is necessarily better. It'll bite you back when/if there will be another condition under which the `needs_tri_index` would need to be disabled.
farsthary marked this conversation as resolved
Member

For the title of the PR, follow the commit message guidelines. It should be explaining what is the user-level break. The details about vertex indices can go into the fuller description.

Whoops, my mistake on the recommendation for the commit message - I forgot that the title should still be the user-facing impact. Apologies for the added confusion

> For the title of the PR, follow the [commit message guidelines](https://developer.blender.org/docs/handbook/guidelines/commit_messages/#bug-fixes). It should be explaining what is the user-level break. The details about vertex indices can go into the fuller description. Whoops, my mistake on the recommendation for the commit message - I forgot that the title should still be the user-facing impact. Apologies for the added confusion
Raul Fernandez Hernandez changed title from Fix #95419: Avoid changing vert index on multires visibility to Fix #95419: sculpt mode: invert visible hides all faces with Multires modifier 2024-05-27 17:24:22 +02:00
Raul Fernandez Hernandez added 1 commit 2024-05-27 17:43:06 +02:00
Sergey Sharybin approved these changes 2024-05-28 10:39:50 +02:00
Sergey Sharybin left a comment
Owner

Think i've managed to reproduce the issue on macOS.
Can confirm the issue demonstarted by Raul, and the original issue is fixed with this PR.

Think i've managed to reproduce the issue on macOS. Can confirm the issue demonstarted by Raul, and the original issue is fixed with this PR.
Hans Goudey approved these changes 2024-05-28 19:01:13 +02:00
Hans Goudey changed title from Fix #95419: sculpt mode: invert visible hides all faces with Multires modifier to Fix #95419: Sculpt: Invert visible hides all faces with Multires modifier 2024-05-28 19:01:47 +02:00
Raul Fernandez Hernandez merged commit 8182ebd4d2 into main 2024-05-29 06:03:07 +02:00
Raul Fernandez Hernandez deleted branch grids_visibility_fix 2024-05-29 06:03:09 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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 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#121929
No description provided.