Sculpt: Add customizable increment for line tool snapping #121547

Merged
Sean Kim merged 7 commits from Sean-Kim/blender:line-angle into main 2024-05-14 19:01:12 +02:00
Member

This PR exposes the snap increments introduced in #118760 to the base WM_gesture_straightline operators and exposes the increment menu to allow users to change this value in both Sculpt and Weight Paint mode.

sculpt_line_snap.gif

Details

The full list of operators this affects:

  • IMAGE_OT_sample_line
  • PAINT_OT_weight_gradient
  • MESH_OT_bisect
  • PAINT_OT_mask_line_gesture
  • SCULPT_OT_trim_line_gesture
  • SCULPT_OT_project_line_gesture
  • PAINT_OT_hide_show_line_gesture

Compatibility

Previously, the hardcoded value for this snap increment was 15 degrees, by using the toolsetting value, this changes to 5 degrees.

This PR exposes the snap increments introduced in #118760 to the base `WM_gesture_straightline` operators and exposes the increment menu to allow users to change this value in both Sculpt and Weight Paint mode. ![sculpt_line_snap.gif](/attachments/ef793b7f-f53b-40fe-ace0-438a92b13234) ## Details The full list of operators this affects: * IMAGE_OT_sample_line * PAINT_OT_weight_gradient * MESH_OT_bisect * PAINT_OT_mask_line_gesture * SCULPT_OT_trim_line_gesture * SCULPT_OT_project_line_gesture * PAINT_OT_hide_show_line_gesture ## Compatibility Previously, the hardcoded value for this snap increment was 15 degrees, by using the toolsetting value, this changes to 5 degrees.
Sean Kim added 1 commit 2024-05-08 03:00:08 +02:00
Sean Kim requested review from Hans Goudey 2024-05-08 03:00:40 +02:00
Sean Kim requested review from Daniel Bystedt 2024-05-08 03:00:53 +02:00
Sean Kim added this to the Sculpt, Paint & Texture project 2024-05-08 03:01:01 +02:00
Sean Kim added 1 commit 2024-05-08 06:47:01 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 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
574395fe21
Remove precision angle field from UI
Contributor

Is that working for all line tools?

Is that working for all line tools?
Member

Nice! @HooglyBoogly can you make a @blender-bot package so I can review?

Nice! @HooglyBoogly can you make a @blender-bot package so I can review?
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/PR121547) when ready.
Member

How about putting this popover in the tool settings header so that it only shows up when there is a tool that uses the settings? I'm not sure about having the popover button clutter the UI in sculpt mode when it rarely has an effect.

How about putting this popover in the tool settings header so that it only shows up when there is a tool that uses the settings? I'm not sure about having the popover button clutter the UI in sculpt mode when it rarely has an effect.
Author
Member

Is that working for all line tools?

@nickberckley - Yes, the full list of tools that this would apply to is:

  • IMAGE_OT_sample_line
  • PAINT_OT_weight_gradient
  • MESH_OT_bisect
  • PAINT_OT_mask_line_gesture
  • SCULPT_OT_trim_line_gesture
  • SCULPT_OT_project_line_gesture
  • PAINT_OT_hide_show_line_gesture

Though this comment reminds me that I should check the other modes to ensure that the popover is visible.

How about putting this popover in the tool settings header so that it only shows up when there is a tool that uses the settings? I'm not sure about having the popover button clutter the UI in sculpt mode when it rarely has an effect.

@HooglyBoogly - I put it in the header initially to have it in a consistent spot with the other modes. I can move it to the tool settings header for sculpt though.

> Is that working for all line tools? @nickberckley - Yes, the full list of tools that this would apply to is: * IMAGE_OT_sample_line * PAINT_OT_weight_gradient * MESH_OT_bisect * PAINT_OT_mask_line_gesture * SCULPT_OT_trim_line_gesture * SCULPT_OT_project_line_gesture * PAINT_OT_hide_show_line_gesture Though this comment reminds me that I should check the other modes to ensure that the popover is visible. > How about putting this popover in the tool settings header so that it only shows up when there is a tool that uses the settings? I'm not sure about having the popover button clutter the UI in sculpt mode when it rarely has an effect. @HooglyBoogly - I put it in the header initially to have it in a consistent spot with the other modes. I can move it to the tool settings header for sculpt though.
Sean Kim added 1 commit 2024-05-08 20:39:17 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 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
4487b415f1
Move popover to tool settings
Author
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/PR121547) when ready.
First-time contributor

can we have a pic of where this setting is located now?

can we have a pic of where this setting is located now?
Author
Member

can we have a pic of where this setting is located now?

@ThinkingPolygons - Updated the main post with an example from Line Mask. Alternatively, if you want to see it for each tool that was changed, a build is available to download.

> can we have a pic of where this setting is located now? @ThinkingPolygons - Updated the main post with an example from *Line Mask*. Alternatively, if you want to see it for each tool that was changed, a build is available to download.
First-time contributor

@ThinkingPolygons - Updated the main post with an example from Line Mask. Alternatively, if you want to see it for each tool that was changed, a build is available to download.

thank you

> @ThinkingPolygons - Updated the main post with an example from *Line Mask*. Alternatively, if you want to see it for each tool that was changed, a build is available to download. thank you
First-time contributor

tested it a little bit, and it works fine. very useful feature 👍

but i think where it was made more sense. i mean, this is a global setting, not a per tool setting.
When you change it, it changes everywhere, and vice versa. when you change it in object mode, it also changes. so the ui should remain consistent imo

tested it a little bit, and it works fine. very useful feature 👍 but i think where it was made more sense. i mean, this is a global setting, not a per tool setting. When you change it, it changes everywhere, and vice versa. when you change it in object mode, it also changes. so the ui should remain consistent imo
Author
Member

tested it a little bit, and it works fine. very useful feature 👍

but i think where it was made more sense. i mean, this is a global setting, not a per tool setting.
When you change it, it changes everywhere, and vice versa. when you change it in object mode, it also changes. so the ui should remain consistent imo

I think the fact that it's a global setting is an important consideration as well. Thanks for the thoughts. I don't want to do too much back and forth on this, so I'll wait for more feedback from other module members before making any further changes to the icon location.

> tested it a little bit, and it works fine. very useful feature 👍 > > but i think where it was made more sense. i mean, this is a global setting, not a per tool setting. > When you change it, it changes everywhere, and vice versa. when you change it in object mode, it also changes. so the ui should remain consistent imo I think the fact that it's a global setting is an important consideration as well. Thanks for the thoughts. I don't want to do too much back and forth on this, so I'll wait for more feedback from other module members before making any further changes to the icon location.
Daniel Bystedt approved these changes 2024-05-12 23:58:45 +02:00
Daniel Bystedt left a comment
Member

This works as expected. I don't see any issue with the rotation snapping setting to be in the snapping settings for bisect (bpy.ops.wm.call_panel(name="VIEW3D_PT_snapping"))

Approving the pull request. Thank you :-)

This works as expected. I don't see any issue with the rotation snapping setting to be in the snapping settings for bisect (bpy.ops.wm.call_panel(name="VIEW3D_PT_snapping")) Approving the pull request. Thank you :-)
Author
Member

Uploading the two different options for where the header could be (mentioned in the UI module chat)

Uploading the two different options for where the header could be (mentioned in the UI module chat)
Author
Member

Just an update here from the module meeting - planning on going with the global header option right now to make it the most consistent with other modes so that it's more consistent with other modes.

Just an update here from the module meeting - planning on going with the global header option right now to make it the most consistent with other modes so that it's more consistent with other modes.
Hans Goudey approved these changes 2024-05-14 17:12:30 +02:00
Dismissed
Hans Goudey left a comment
Member

The consensus was in the sculpt module meeting today that this popover should go in the non-tool header next to the automasking popover, mainly for consistency with other global options.

The consensus was in the sculpt module meeting today that this popover should go in the non-tool header next to the automasking popover, mainly for consistency with other global options.
Sean Kim added 2 commits 2024-05-14 17:30:53 +02:00
Sean Kim added 1 commit 2024-05-14 17:46:38 +02:00
Hans Goudey reviewed 2024-05-14 17:48:51 +02:00
@ -995,3 +1014,1 @@
const float angle_snapped_deg = -floorf(angle_deg / STRAIGHTLINE_SNAP_DEG) *
STRAIGHTLINE_SNAP_DEG;
const float angle_snapped = DEG2RAD(angle_snapped_deg);
const float angle_deg = angle + (snap_angle / 2.0f);
Member

I think the snapping still has to happen in degrees, right? (A RAD2DEG missing here)

I think the snapping still has to happen in degrees, right? (A `RAD2DEG` missing here)
Author
Member

Oh, ugh, moving too fast. I think the names just need to be updated here.

The previous code was going from

  • angle - radians
  • angle_deg - degrees
  • angle_snapped_deg - degrees
  • angle_snapped - radians
Oh, ugh, moving too fast. I think the names just need to be updated here. The previous code was going from * `angle` - radians * `angle_deg` - degrees * `angle_snapped_deg` - degrees * `angle_snapped` - radians
Member

Is it not important that floorf is called on degrees rather than radians? Maybe I'm missing something but floor from 1.4 to 1.0 won't be meaningful for radians, right?

Is it not important that `floorf` is called on degrees rather than radians? Maybe I'm missing something but floor from 1.4 to 1.0 won't be meaningful for radians, right?
Author
Member

Discussed offline - for future reference the floorf is calculating a integer number of rotations to do.

Discussed offline - for future reference the `floorf` is calculating a integer number of rotations to do.
Sean-Kim marked this conversation as resolved
Hans Goudey approved these changes 2024-05-14 18:33:59 +02:00
Sean Kim added 1 commit 2024-05-14 18:38:27 +02:00
Sean Kim merged commit 1cf0d7ca6a into main 2024-05-14 19:01:12 +02:00
Sean Kim deleted branch line-angle 2024-05-14 19:01:15 +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
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#121547
No description provided.