Update 'dyntopo_detail_size_edit' to support Relative/Brush Detail settings #108111

Closed
opened 2023-05-20 18:07:04 +02:00 by Julien Kaspar · 13 comments
Member

(NOTE) This task is part of the community & sub tasks of the workboard. Anyone is free to pick up this task and contribute. For any questions or needed reviewers, please tag @Sergey @HooglyBoogly and @JulienKaspar.

As of right now in sculpt mode the shortcut R is used while Dyntopo is enabled to change the detail size.
It calls the operator SCULPT_OT_dyntopo_detail_size_edit which displays a triangle overlay.
If tool_settings.sculpt.detail_type_method is not set to "constant" or "manual", it will fall back onto the older radial control SCULPT_OT_set_detail_size instead.
This operator is less ideal to control and display the target resolution.

500_dyntopo_detail_size.png

The operator SCULPT_OT_dyntopo_detail_size_edit should be updated to work with all detail type methods.
The methods "Relative" and "Brush" are screen based, instead of scene based, which doesn't strictly prevent the triangle overlay from displaying and estimated resolution.

(NOTE) This task is part of the community & sub tasks of the workboard. Anyone is free to pick up this task and contribute. For any questions or needed reviewers, please tag @Sergey @HooglyBoogly and @JulienKaspar. As of right now in sculpt mode the shortcut `R` is used while Dyntopo is enabled to change the detail size. It calls the operator `SCULPT_OT_dyntopo_detail_size_edit` which displays a triangle overlay. If `tool_settings.sculpt.detail_type_method` is not set to "constant" or "manual", it will fall back onto the older radial control `SCULPT_OT_set_detail_size` instead. This operator is less ideal to control and display the target resolution. ![500_dyntopo_detail_size.png](/attachments/3e6c56a1-8acb-493f-abba-d8f9a6e9a7a4) The operator `SCULPT_OT_dyntopo_detail_size_edit` should be updated to work with all detail type methods. The methods "Relative" and "Brush" are screen based, instead of scene based, which doesn't strictly prevent the triangle overlay from displaying and estimated resolution.
Julien Kaspar added the
Type
To Do
Module
Sculpt, Paint & Texture
labels 2023-05-20 18:07:04 +02:00
Julien Kaspar added this to the Sculpt, Paint & Texture project 2023-05-20 18:07:06 +02:00
Julien Kaspar changed title from Update `dyntopo_detail_size_edit` to support Relative Detail setting to Update `dyntopo_detail_size_edit` to support Relative/Brush Detail settings 2023-05-20 18:07:35 +02:00
Julien Kaspar changed title from Update `dyntopo_detail_size_edit` to support Relative/Brush Detail settings to Update 'dyntopo_detail_size_edit' to support Relative/Brush Detail settings 2023-05-20 18:08:34 +02:00
Contributor

Hey @JulienKaspar,

I am new to the development of Blender. Have been playing around with the source for the past two weeks.
Saw this in the community tasks and was wondering if I could maybe pick it up.
May take me some time though, still getting familiarized with the whole thing.

Hey @JulienKaspar, I am new to the development of Blender. Have been playing around with the source for the past two weeks. Saw this in the community tasks and was wondering if I could maybe pick it up. May take me some time though, still getting familiarized with the whole thing.
Author
Member

@Vasilis-Milios Sure this task is availible for grabs :)
I can give some more info and mockups if the design isn't clear. In a nutshell it would be good to use the operator (and the visualization) on the left of the image for all the dyntopo methods.

I'm unsure atm about how technically challenging the task may be. I added some more devs to tag into the task description in case feedback is needed.

@Vasilis-Milios Sure this task is availible for grabs :) I can give some more info and mockups if the design isn't clear. In a nutshell it would be good to use the operator (and the visualization) on the left of the image for all the dyntopo methods. I'm unsure atm about how technically challenging the task may be. I added some more devs to tag into the task description in case feedback is needed.
Contributor

@Vasilis-Milios - Have you done any work on this task / are you planning on continuing it? If not, I was planning on starting to take a look at this soon.

@Vasilis-Milios - Have you done any work on this task / are you planning on continuing it? If not, I was planning on starting to take a look at this soon.
Contributor

Starting to work on this, one clarifying question I have right now @JulienKaspar:

When replacing the existing brush mode detail type with the new display, should the percentage (24.8% in the attached image in the original post) also be displayed with the new triangle grid, or is that something that can / should come later?

Starting to work on this, one clarifying question I have right now @JulienKaspar: When replacing the existing brush mode detail type with the new display, should the percentage (24.8% in the attached image in the original post) also be displayed with the new triangle grid, or is that something that can / should come later?
Author
Member

@Sean-Kim That's a good question. It would even be fine to add he values to the header as simple status text, like for other modal operators. It doesn't need to be hovering over the grid. I hope that keeps it simple for now.

The important part is that it works with a limited range of values. Relative detail goes from 0-40 and Brush detail from 0.5-100%.
Constant and Manual detail doesn't have a limited range of values.

@Sean-Kim That's a good question. It would even be fine to add he values to the header as simple status text, like for other modal operators. It doesn't need to be hovering over the grid. I hope that keeps it simple for now. The important part is that it works with a limited range of values. Relative detail goes from 0-40 and Brush detail from 0.5-100%. Constant and Manual detail doesn't have a limited range of values.
Contributor

@JulienKaspar - Just a few notes here about this

The important part is that it works with a limited range of values. Relative detail goes from 0-40 and Brush detail from 0.5-100%.
Constant and Manual detail doesn't have a limited range of values.

  • According to the RNA, the UI range for Relative Detail is [0.5, 40] - even when using the current operator the header says Detail Size: 0, but actually sets the value to 0.5
  • The UI range and the actual range for the resolution value used for Constant and Manual differ here, where the UI caps the max at 1000. However, the actual operator clamps the range to [1, 500] as seen here
@JulienKaspar - Just a few notes here about this > The important part is that it works with a limited range of values. Relative detail goes from 0-40 and Brush detail from 0.5-100%. Constant and Manual detail doesn't have a limited range of values. * According to [the RNA](https://projects.blender.org/blender/blender/src/commit/412b279629afecb197c7f21326121371a78a8976/source/blender/makesrna/intern/rna_sculpt_paint.cc#L830), the UI range for Relative Detail is [0.5, 40] - even when using the current operator the header says `Detail Size: 0`, but actually sets the value to 0.5 * The UI range and the actual range for the resolution value used for Constant and Manual differ [here](https://projects.blender.org/blender/blender/src/commit/412b279629afecb197c7f21326121371a78a8976/source/blender/makesrna/intern/rna_sculpt_paint.cc#L846-L847), where the UI caps the max at 1000. However, the actual operator clamps the range to [1, 500] as seen [here](https://projects.blender.org/blender/blender/src/commit/412b279629afecb197c7f21326121371a78a8976/source/blender/editors/sculpt_paint/sculpt_detail.cc#L641)
Contributor

Another question after getting it mostly working - currently moving left when selecting detail size on the Constant / Manual mode lowers the value which makes a larger resulting triangle and moving right increases the value which makes smaller triangles.

For Brush & Relative, moving left when selecting the detail size lowers the corresponding property value (detail size / detail percentage), but this has the opposite effect on the grid - it makes smaller triangles moving left and larger triangles moving right.

Which behavior do we want? When using this operator should moving left always reduce the backed value or always make larger triangles?

Another question after getting it mostly working - currently moving left when selecting detail size on the Constant / Manual mode lowers the value which makes a larger resulting triangle and moving right increases the value which makes smaller triangles. For Brush & Relative, moving left when selecting the detail size lowers the corresponding property value (detail size / detail percentage), but this has the **opposite** effect on the grid - it makes smaller triangles moving left and larger triangles moving right. Which behavior do we want? When using this operator should moving left always reduce the backed value or always make larger triangles?
Contributor

Which behavior do we want? When using this operator should moving left always reduce the backed value or always make larger triangles?

Forgot to update this with discussions that were had via chat - the desired behavior is to have all modes create bigger triangles moving to the left and smaller ones moving to the right

> Which behavior do we want? When using this operator should moving left always reduce the backed value or always make larger triangles? Forgot to update this with discussions that were had via chat - the desired behavior is to have all modes create bigger triangles moving to the left and smaller ones moving to the right
Contributor

After #118403 is merged in, should the old set_detail_size operator be removed?

After #118403 is merged in, should the old `set_detail_size` operator be removed?
Contributor

Also reminder to self to update the manual after the code change is merged in.

Also reminder to self to update the manual after the code change is merged in.
Author
Member

After #118403 is merged in, should the old set_detail_size operator be removed?

@Sean-Kim Yes I think it's best to remove the old operator.

> After #118403 is merged in, should the old `set_detail_size` operator be removed? @Sean-Kim Yes I think it's best to remove the old operator.
Contributor

For consistency's sake, since the Brush and Relative modes now support sampling when using this modal operator and holding down Ctrl, should the pipette icon in the toolbar when using Constant or Manual detailing be added to the Brush and Relative modes and the sample_detail_size operator be updated as well?

For consistency's sake, since the *Brush* and *Relative* modes now support sampling when using this modal operator and holding down `Ctrl`, should the pipette icon in the toolbar when using *Constant* or *Manual* detailing be added to the *Brush* and *Relative* modes and the `sample_detail_size` operator be updated as well?
Author
Member

@Sean-Kim I think we can leave it as it is for now. It's nice that the operator is consistent but sampling resolutions for Relative and Brush is not that useful anyway.

Will close the issue since it's been resolved. Great work!

@Sean-Kim I think we can leave it as it is for now. It's nice that the operator is consistent but sampling resolutions for *Relative* and *Brush* is not that useful anyway. Will close the issue since it's been resolved. Great work!
Blender Bot added the
Status
Archived
label 2024-02-26 16:59:17 +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
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#108111
No description provided.