WIP: Sculpt: Add operators to Mask, Face Sets, and Paint menus #105410

Draft
Tarek-Yasser wants to merge 23 commits from Tarek-Yasser/blender:102427_continued into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

The other part of #102427. This implements the rest of the operators mentioned in the issue. Mainly operators in the Mask, Face Sets, and Paint which. Details (issues, possible bugs, improvements, etc ..) Can be found in the original issue. Stuff related specifically to this PR can be found starting at this comment

The other part of #102427. This implements the rest of the operators mentioned in the issue. Mainly operators in the Mask, Face Sets, and Paint which. Details (issues, possible bugs, improvements, etc ..) Can be found in the original issue. Stuff related specifically to this PR can be found [starting at this comment](https://projects.blender.org/blender/blender/issues/102427#issuecomment-888677)
Tarek-Yasser added 17 commits 2023-03-03 17:49:49 +01:00
Added "Toggle Visibility", "Hide Active Face Set", "Invert Visible",
"Box Trim", "Lasso Trim", "Line Project", "Fair Positions", "Fair
Tangency".
The 8 variants are: 'SMOOTH', 'SURFACE_SMOOTH', 'INFLATE', 'RELAX',
'RELAX_FACE_SETS' 'SHARPEN', 'ENHANCE_DETAILS' 'ERASE_DISCPLACEMENT',
'RANDOM'.
UI: Mesh filters now change the cursor and update the statusbar.
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
d6a0fccf28
Mesh filters now use the `WM_CURSOR_EW_SCROLL` and have "LMB: Confirm"
as their statusbar message.
- Re-ordered and renamed `Mask` menu entries.
- Added `Mask by Color`
- Added `OPTYPE_DEPENDS_ON_CURSOR` to `SCULPT_OT_mask_by_color`.
Added operators:  Box/Lasso Face Set, Fair Face Set Positions/Tangency,
and Delete Face Set.
Renamed `Randomize Colors` to `Random Face Set Clors` to match the
example screenshot.
Current exposes Color Fill, Blur Colors, Change
Hue/Saturation/Value/Brightness/Color/Red/Gree/Blue and Expand Color by
Topology.

Added a header? submenu for fill, just testing out Joseph Eagar's
suggestion.
Also, modified the flags for `SCULPT_OT_color_filter` to grab the
cursor's X.
Note that the cancelling is copied from Joseph Eagar's Filter Mesh
cancel implemenation with some tweaks to work with colors.
Tarek-Yasser added 1 commit 2023-03-03 17:52:54 +01:00
Tarek-Yasser requested review from Julien Kaspar 2023-03-03 18:09:17 +01:00
Tarek-Yasser requested review from Joseph Eagar 2023-03-03 18:09:32 +01:00
Julien Kaspar added the
Module
Sculpt, Paint & Texture
label 2023-03-03 18:33:57 +01:00
Hans Goudey changed title from Sculpt: Add operators to Mask, Face Sets, and Paint menus. to Sculpt: Add operators to Mask, Face Sets, and Paint menus 2023-03-03 21:43:59 +01:00
Tarek-Yasser added 2 commits 2023-03-08 18:49:38 +01:00
Joseph Eagar added 1 commit 2023-04-16 23:43:20 +02:00
Joseph Eagar added 1 commit 2023-04-16 23:47:51 +02:00
Member

Ok I merged from main for you. Aside from one line of commented out code that needs to be deleted it looks good to me.

All those entries starting with "change" in the paint menu do look a bit off-putting to me. It might be a good idea to add them to a "Change" or "Filter" submenu, or perhaps just capitalize both words.

Ok I merged from main for you. Aside from one line of commented out code that needs to be deleted it looks good to me. All those entries starting with "change" in the paint menu do look a bit off-putting to me. It might be a good idea to add them to a "Change" or "Filter" submenu, or perhaps just capitalize both words.
Joseph Eagar reviewed 2023-04-16 23:52:32 +02:00
@ -224,0 +253,4 @@
BKE_pbvh_vertex_iter_begin (ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
SCULPT_orig_vert_data_update(&orig_data, &vd);
/* copy_v3_v3(vd.vertex, orig_data.col); */
Member

Remove commented out code.

Remove commented out code.
Joseph Eagar added 1 commit 2023-04-16 23:54:44 +02:00
Member

I had another look at this patch and I think most changes look good to me.

The operators in the Paint Menu need an overhaul though. I'd recommend to cut them out of the patch for now since they'd need some more iteration. It's not as simple as the current implementation.
My thoughts on them are:

  • We should not add a panel for a unique "Fill Color" and a "Fill" button. Instead the Fill operator should always use the tool_settings.unified_paint_settings.color or if available the bpy.data.brushes["brush"].color (just like in vertex paint mode)
  • The UI needs to be revisited at some point on how we want to show the color picker, even when no painting tool is active. But that's a bigger topic that's still unclear.
  • The Blur operator is hard to control when dragging
  • Negative blurring needs to be disabled since it's not working well
  • The Blur adjust last operation strength doesn't go beyond 1. Probably needs a "Repeat" slider as well.
  • "Change" should be removed in the operator names
  • Eventually the operators should be rewritten to be merged similarly to the other painting modes (How I proposed in the original task description)
I had another look at this patch and I think most changes look good to me. The operators in the Paint Menu need an overhaul though. I'd recommend to cut them out of the patch for now since they'd need some more iteration. It's not as simple as the current implementation. My thoughts on them are: - We should not add a panel for a unique "Fill Color" and a "Fill" button. Instead the Fill operator should always use the `tool_settings.unified_paint_settings.color` or if available the `bpy.data.brushes["brush"].color` (just like in vertex paint mode) - The UI needs to be revisited at some point on how we want to show the color picker, even when no painting tool is active. But that's a bigger topic that's still unclear. - The Blur operator is hard to control when dragging - Negative blurring needs to be disabled since it's not working well - The Blur adjust last operation strength doesn't go beyond 1. Probably needs a "Repeat" slider as well. - "Change" should be removed in the operator names - Eventually the operators should be rewritten to be merged similarly to the other painting modes (How I proposed in the original task description)
Julien Kaspar requested changes 2023-04-17 11:28:32 +02:00
Julien Kaspar left a comment
Member

About the rest of the changes in this patch:

  • The Fairing operators are now duplicated. Keep them in the "Sculpt" menu and remove them from the "Face Sets" menu
  • Rename "Mask Extract" to "Extract Masked" for consistency
  • Using "Delete Face Set" causes a crash if a Mesh Filter was used just before
  • "Mask by Color" needs Adjust Last Operation options
  • The "Sphere" Filter was removed but I don't know why?
About the rest of the changes in this patch: - The Fairing operators are now duplicated. Keep them in the "Sculpt" menu and remove them from the "Face Sets" menu - Rename "Mask Extract" to "Extract Masked" for consistency - Using "Delete Face Set" causes a crash if a Mesh Filter was used just before - "Mask by Color" needs Adjust Last Operation options - The "Sphere" Filter was removed but I don't know why?
Hans Goudey added this to the Sculpt, Paint & Texture project 2023-11-30 20:42:58 +01:00
Daniel Bystedt changed title from Sculpt: Add operators to Mask, Face Sets, and Paint menus to WIP: Sculpt: Add operators to Mask, Face Sets, and Paint menus 2024-04-16 16:53:23 +02:00
This pull request has changes conflicting with the target branch.
  • scripts/startup/bl_ui/space_view3d.py
  • source/blender/editors/include/ED_sculpt.h
  • source/blender/editors/sculpt_paint/sculpt_filter_color.cc
  • source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc
  • source/blender/editors/sculpt_paint/sculpt_intern.hh
  • source/blender/editors/sculpt_paint/sculpt_ops.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 102427_continued:Tarek-Yasser-102427_continued
git checkout Tarek-Yasser-102427_continued
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 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#105410
No description provided.