Sculpt: Add Lasso Hide tool #119140

Merged
Hans Goudey merged 6 commits from Sean-Kim/blender:80390-lasso-gesture-hide into main 2024-03-12 14:19:14 +01:00
Contributor

This commit adds the SCULPT_OT_hide_show_lasso_gesture and the
corresponding Lasso Hide tool.

  • Exposes the selection type for both the lasso and box hide tools
    as a option in the header
  • Adds functionality into sculpt_gesture.cc for handling lasso
    selections with the Outside selection type

For SelectionType::Outside, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.

Addresses one of the tools in #80390


Inside Outside Move & Show All
lasso_inside.gif lasso_outside.gif lasso_move_unhide.gif
This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the corresponding Lasso Hide tool. * Exposes the selection type for both the lasso and box hide tools as a option in the header * Adds functionality into `sculpt_gesture.cc` for handling lasso selections with the `Outside` selection type For `SelectionType::Outside`, the current implementation opts to not do any filtering on the PBVH node level due to cases where the node is mostly covered by a single gesture. Addresses one of the tools in #80390 --- | Inside | Outside | Move & Show All | --- | --- | --- | | ![lasso_inside.gif](/attachments/0e196189-d890-4623-a54b-497f02fae262) | ![lasso_outside.gif](/attachments/7e151b96-4789-42da-8b39-d79f53d0ff43) | ![lasso_move_unhide.gif](attachments/79182b7b-d4de-43d3-b739-71b103412dec)
Sean Kim added 1 commit 2024-03-07 01:02:36 +01:00
Sean Kim requested review from Hans Goudey 2024-03-07 01:03:25 +01:00
Sean Kim requested review from Julien Kaspar 2024-03-07 01:03:49 +01:00
Sean Kim requested review from Daniel Bystedt 2024-03-07 01:05:00 +01:00
Sean Kim added 1 commit 2024-03-07 01:23:37 +01:00
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
a190229af8
Remove extra keymap entry
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR119140) when ready.
Hans Goudey reviewed 2024-03-08 18:00:42 +01:00
@ -355,0 +355,4 @@
/* Certain degenerate cases of a lasso shape can cause the resulting
* frustum planes to enclose a node's AABB, therefore we must submit it
* to be more throughly evaluated. */
if (gesture_data->shape_type == ShapeType::Lasso) {
Member

I'd have to test to check the numbers, but my guess is that this BKE_pbvh_node_frustum_exclude_AABB check is an important part of making the tool feel snappy when hiding a small portion of a large mesh. So maybe this fix can be considered separately, because the tradeoff isn't obvious to me.

I'd have to test to check the numbers, but my guess is that this `BKE_pbvh_node_frustum_exclude_AABB` check is an important part of making the tool feel snappy when hiding a small portion of a large mesh. So maybe this fix can be considered separately, because the tradeoff isn't obvious to me.
Author
Contributor

I get the concern - but this particular code path would be handling the opposite use-case if lassoing a small portion of a large mesh - most pbvh nodes would pass the BKE_pbvh_node_frustum_exclude_AABB check. The situation you're describing should still be performant with these changes as that would go through the SelectionType::Inside check above.

If you think the SelectionType::Outside feature itself needs a bit more iteration though, I think it could be worked on separately.

A possible way to achieve this could be to extend the GestureData struct to contain a list of "included" and "excluded" nodes so that large batch operations for hide could be done through methods like partialvis_all_update_mesh which take advantage of threading

I get the concern - but this particular code path would be handling the opposite use-case if lassoing a small portion of a large mesh - most pbvh nodes would pass the `BKE_pbvh_node_frustum_exclude_AABB` check. The situation you're describing should still be performant with these changes as that would go through the `SelectionType::Inside` check above. If you think the `SelectionType::Outside` feature itself needs a bit more iteration though, I think it could be worked on separately. A possible way to achieve this could be to extend the `GestureData` struct to contain a list of "included" and "excluded" nodes so that large batch operations for hide could be done through methods like `partialvis_all_update_mesh` which take advantage of threading
Member

I'd have to test to check the numbers, but my guess is that this BKE_pbvh_node_frustum_exclude_AABB check is an important part of making the tool feel snappy when hiding a small portion of a large mesh. So maybe this fix can be considered separately, because the tradeoff isn't obvious to me.

I just checked the tool on a mesh with 3.5 million vertices using a multires modifier. I think it works perfectly fine and I don't see any issues in terms of snappyness.

From me it is thumbs up for this commit

> I'd have to test to check the numbers, but my guess is that this `BKE_pbvh_node_frustum_exclude_AABB` check is an important part of making the tool feel snappy when hiding a small portion of a large mesh. So maybe this fix can be considered separately, because the tradeoff isn't obvious to me. I just checked the tool on a mesh with 3.5 million vertices using a multires modifier. I think it works perfectly fine and I don't see any issues in terms of snappyness. From me it is thumbs up for this commit
@ -398,2 +404,3 @@
return lasso->mask_px[scr_co_s[1] * lasso->width + scr_co_s[0]].test();
const bool bitmap_result = lasso->mask_px[scr_co_s[1] * lasso->width + scr_co_s[0]].test();
return (bitmap_result && gesture_data->selection_type == SelectionType::Inside) ||
Member

Could this become a switch on the selection_type?

Could this become a switch on the `selection_type`?
Sean-Kim marked this conversation as resolved
Daniel Bystedt approved these changes 2024-03-09 16:37:15 +01:00
Dismissed
Daniel Bystedt left a comment
Member

This PR works perfectly as intended when I've been testing it. Well done Sean kim! Approving now.

This PR works perfectly as intended when I've been testing it. Well done Sean kim! Approving now.
Daniel Bystedt added this to the Sculpt, Paint & Texture project 2024-03-09 16:40:09 +01:00
First-time contributor

Hi @Sean-Kim I tested the tool a little bit, great functionality... 👍 and while testing, I noticed two things missing in comparison to the Box Hide tool...

The first thing is the ability to press and hold the Spacebar to move the entire selection region, like:

Lasso Mask example:


The second thing is the ability to click on an empty space to unhide everything, like:

Those are the two essential things missing in the Lasso Hide tool that are present in the Box Hide tool... I hope it can be addressed... 🙂
Other than that, it seems to work great...

Cheers...

Hi @Sean-Kim I tested the tool a little bit, great functionality... 👍 and while testing, I noticed two things missing in comparison to the Box Hide tool... The first thing is the ability to press and hold the Spacebar to move the entire selection region, like: ![](https://i.imgur.com/0tSeMMP.gif) Lasso Mask example: ![](https://i.imgur.com/95ZV8oC.gif) ___ The second thing is the ability to click on an empty space to unhide everything, like: ![](https://i.imgur.com/40a61dc.gif) Those are the two essential things missing in the Lasso Hide tool that are present in the Box Hide tool... I hope it can be addressed... 🙂 Other than that, it seems to work great... Cheers...
Author
Contributor

@DanielBystedt - Thanks for the performance testing!

@TheRedWaxPolice - Thanks for the feedback and testing, I'll look into both of those this coming week.

@DanielBystedt - Thanks for the performance testing! @TheRedWaxPolice - Thanks for the feedback and testing, I'll look into both of those this coming week.
Sean Kim changed title from Sculpt: Add Lasso Hide tool to WIP: Sculpt: Add Lasso Hide tool 2024-03-09 23:49:43 +01:00
Author
Contributor

Marked as WIP for now until I address the two usecases pointed out above.

Marked as WIP for now until I address the two usecases pointed out above.
Sean Kim added 4 commits 2024-03-10 01:17:42 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
342afa9ed6
PR style feedback
Sean Kim changed title from WIP: Sculpt: Add Lasso Hide tool to Sculpt: Add Lasso Hide tool 2024-03-10 01:22:07 +01:00
Author
Contributor

Addressed feedback & updated the main post with a new GIF of the two features that were missing and pointed out by @TheRedWaxPolice

Addressed feedback & updated the main post with a new GIF of the two features that were missing and pointed out by @TheRedWaxPolice
Hans Goudey approved these changes 2024-03-11 16:29:34 +01:00
Member

@blender-bot build

@blender-bot build
First-time contributor

greetings!
whats preventing this from landing?

greetings! whats preventing this from landing?
Hans Goudey merged commit 68afd22501 into main 2024-03-12 14:19:14 +01:00
Sean Kim deleted branch 80390-lasso-gesture-hide 2024-03-12 15:51:49 +01:00
Daniel Bystedt approved these changes 2024-03-18 00:41:39 +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 Assignees
7 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#119140
No description provided.