WIP: Sculpt: Plane Trim Brush #111382

Draft
Sergey Sharybin wants to merge 1 commits from Sergey/blender:sculpt_trim_brush into main

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

This implements a brush that can properly flatten and polish surfaces.
Right now the brush that does a similar thing is Scrape, which has a lot
of limitations and a confusing implementation between scrape/fill/flatten.

In order to solver most of the Scrape brush limitations and artifacts,
this brush does the following:

  • It uses its own surface sampling function, which takes into account the
    previous trim plane and samples different radius in different areas.
  • Area center and normal are stabilized using multiple samples.
  • Instead of combining proxies, the brush runs multiple iterations of
    sampling - deforming to converge towards the plane, similar to smooth.

Before continuing, refactoring and cleaning up the algorithm, it would
be nice to know how do we want to merge it before having brush
management. The options are:

  • Add a new Plane Trim tool (best option in my opinion, even if it is
    experimental. This will make things easier for the brush management
    refactor).
  • Add this as a deformation mode inside Scrape.
  • Add this as a deformation mode inside Flatten.
  • Replace Flatten (I still don't quite understand what that brush is for).

NOTE: This is a port of the submitted by Pablo Dobarro to the old developers
platform: https://archive.blender.org/developer/D9571


The patch on Phabricator is something Julien pointed at and wanted to bring
a push for moving forward, as on a functional level it seems very useful brush
to have.

This implements a brush that can properly flatten and polish surfaces. Right now the brush that does a similar thing is Scrape, which has a lot of limitations and a confusing implementation between scrape/fill/flatten. In order to solver most of the Scrape brush limitations and artifacts, this brush does the following: * It uses its own surface sampling function, which takes into account the previous trim plane and samples different radius in different areas. * Area center and normal are stabilized using multiple samples. * Instead of combining proxies, the brush runs multiple iterations of sampling - deforming to converge towards the plane, similar to smooth. Before continuing, refactoring and cleaning up the algorithm, it would be nice to know how do we want to merge it before having brush management. The options are: * Add a new Plane Trim tool (best option in my opinion, even if it is experimental. This will make things easier for the brush management refactor). * Add this as a deformation mode inside Scrape. * Add this as a deformation mode inside Flatten. * Replace Flatten (I still don't quite understand what that brush is for). NOTE: This is a port of the submitted by Pablo Dobarro to the old developers platform: https://archive.blender.org/developer/D9571 --- The patch on Phabricator is something Julien pointed at and wanted to bring a push for moving forward, as on a functional level it seems very useful brush to have.
Sergey Sharybin added 1 commit 2023-08-22 14:11:54 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
e53ac373c1
WIP: Sculpt: Plane Trim Brush
This implements a brush that can properly flatten and polish surfaces.
Right now the brush that does a similar thing is Scrape, which has a lot
of limitations and a confusing implementation between scrape/fill/flatten.

In order to solver most of the Scrape brush limitations and artifacts,
this brush does the following:

* It uses its own surface sampling function, which takes into account the
  previous trim plane and samples different radius in different areas.
* Area center and normal are stabilized using multiple samples.
* Instead of combining proxies, the brush runs multiple iterations of
  sampling - deforming to converge towards the plane, similar to smooth.

Before continuing, refactoring and cleaning up the algorithm, it would
be nice to know how do we want to merge it before having brush
management. The options are:

* Add a new Plane Trim tool (best option in my opinion, even if it is
  experimental. This will make things easier for the brush management
  refactor).
* Add this as a deformation mode inside Scrape.
* Add this as a deformation mode inside Flatten.
* Replace Flatten (I still don't quite understand what that brush is for).

NOTE: This is a port of the submitted by Pablo Dobarro to the old developers
      platform: https://archive.blender.org/developer/D9571
Author
Owner

Video from the original patch which demonstrates the behavior:

Video from the original patch which demonstrates the behavior: <video src="/attachments/a53a8b5b-0d7c-4cff-970e-8ae6aae45dfb" title="Untitled_Project_10.mov" controls></video>
Author
Owner

@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/PR111382) when ready.
Sergey Sharybin added the
Module
Sculpt, Paint & Texture
label 2023-08-22 14:15:18 +02:00
Member

I'll test this a bit. I'd be fine with adding this as a new brush type once we have brush asset support for the asset shelf (for better brush management).

But could also be a simple setting in the flatten, scrape and fill brushes since it seems to only average the plane normal and position during the stroke?
We'll see.

EDIT: The plane trim brush in this PR is not using most of the brush settings, so checking compatibility issues and customizability is not possible right now.
Otherwise the brush works as expected 👍

I'll test this a bit. I'd be fine with adding this as a new brush type once we have brush asset support for the asset shelf (for better brush management). But could also be a simple setting in the flatten, scrape and fill brushes since it seems to only average the plane normal and position during the stroke? We'll see. EDIT: The plane trim brush in this PR is not using most of the brush settings, so checking compatibility issues and customizability is not possible right now. Otherwise the brush works as expected 👍
First-time contributor

Very very glad to see pablo dobarro's patches being integrated..
Big thanks @Sergey 👍

Very very glad to see pablo dobarro's patches being integrated.. Big thanks @Sergey 👍
First-time contributor

Great initiative. 👏
I never thought we would see abandoned patches being revived officially.

When is it expected to land? WE NEED IT NOW...🙂

Btw, is there a page with a list of those "abandoned" patches that are going to be ported, or it's just being picked up randomly in the "dark"?

And what about the sculpt dev branch feeatures? I hope it gets the same treatment.
It's really hard to know what's going on in the sculpting module.

Great initiative. 👏 I never thought we would see abandoned patches being revived officially. When is it expected to land? WE NEED IT NOW...🙂 Btw, is there a page with a list of those "abandoned" patches that are going to be ported, or it's just being picked up randomly in the "dark"? And what about the sculpt dev branch feeatures? I hope it gets the same treatment. It's really hard to know what's going on in the sculpting module.
First-time contributor

so the trim brush is officially being worked on now :DDDD ?????

so the trim brush is officially being worked on now :DDDD ?????
Author
Owner

For the time being the code time availability is low, but we do want to schedule more time for the developers to tackle some of the sculpt topics.

For the time being the code time availability is low, but we do want to schedule more time for the developers to tackle some of the sculpt topics.
First-time contributor

For the time being the code time availability is low, but we do want to schedule more time for the developers to tackle some of the sculpt topics.

Cool. But what's preventing this PR from landing? Everything seems ready to go. 😕

> For the time being the code time availability is low, but we do want to schedule more time for the developers to tackle some of the sculpt topics. Cool. But what's preventing this PR from landing? Everything seems ready to go. :confused:
Member

It's not ready to go sadly. Currently the code is completely replacing the scrape & fill brushes instead of adding a new brush. Almost all brush settings are also not supported yet for the plane trim brush.

If we add it as a new brush it needs an icon as well. Or we wait for brush asset support and only make a new thumbnail for it.
Alternatively making it a brush setting is likely the better way to go but that needs more investigation into how this brush exactly works.

It's not ready to go sadly. Currently the code is completely replacing the scrape & fill brushes instead of adding a new brush. Almost all brush settings are also not supported yet for the plane trim brush. If we add it as a new brush it needs an icon as well. Or we wait for brush asset support and only make a new thumbnail for it. Alternatively making it a brush setting is likely the better way to go but that needs more investigation into how this brush exactly works.
First-time contributor

That's unfortunate.
Would be great to have that brush in the main branch, even as experimental.

That's unfortunate. Would be great to have that brush in the main branch, even as experimental.
Hans Goudey added this to the Sculpt, Paint & Texture project 2023-11-30 20:42:58 +01:00
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
This pull request has changes conflicting with the target branch.
  • source/blender/editors/sculpt_paint/sculpt.cc
  • source/blender/editors/sculpt_paint/sculpt_intern.hh

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u sculpt_trim_brush:Sergey-sculpt_trim_brush
git checkout Sergey-sculpt_trim_brush
Sign in to join this conversation.
No reviewers
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
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#111382
No description provided.