Cleanup: Extract sculpt gesture functionality to separate file #118881

Merged
Hans Goudey merged 3 commits from Sean-Kim/blender:common-gesture into main 2024-03-01 22:07:35 +01:00
Member

This PR extracts the common sculpt gesture code from paint_mask.cc into a separate file in preparation for further changes to use it within the existing PAINT_OT_hide_show box gesture operator and later for adding a new Lasso Hide operator for #80390

Testing

  • Basic sanity check of Trim Box operator to ensure that nothing went wrong while extracting code.
This PR extracts the common sculpt gesture code from paint_mask.cc into a separate file in preparation for further changes to use it within the existing `PAINT_OT_hide_show` box gesture operator and later for adding a new *Lasso Hide* operator for #80390 ## Testing * Basic sanity check of *Trim Box* operator to ensure that nothing went wrong while extracting code.
Sean Kim added 1 commit 2024-02-29 03:48:39 +01:00
Sean Kim requested review from Hans Goudey 2024-02-29 03:48:59 +01:00
Hans Goudey reviewed 2024-02-29 16:44:16 +01:00
Hans Goudey left a comment
Member

Seems like a good place to start!

Seems like a good place to start!
@ -63,6 +63,8 @@
namespace blender::ed::sculpt_paint::mask {
using namespace blender::ed::sculpt_paint::gesture;
Member

I'd rather avoid these using namespace. Ideally namespaces are helpful when reading to show where different code comes from and separate concerns.

I'd rather avoid these `using namespace`. Ideally namespaces are helpful when reading to show where different code comes from and separate concerns.
Author
Member

Ah, yeah this and your other comment make sense - I'll do a renaming of the associated types and methods and remove the usage of using

Ah, yeah this and your other comment make sense - I'll do a renaming of the associated types and methods and remove the usage of `using`
Sean-Kim marked this conversation as resolved
@ -1667,0 +1759,4 @@
};
/* Determines whether or not a gesture action should be applied. */
bool sculpt_gesture_is_effected(SculptGestureContext *sgcontext,
Member

As an example about the namespace function naming thing, all the Sculpt in these function and type names are unnecessary, since the code is already in the sculpt_paint namespace. Not sure it's worth changing in this PR, but that's the direction we can go in anyway.

As an example about the namespace function naming thing, all the `Sculpt` in these function and type names are unnecessary, since the code is already in the `sculpt_paint` namespace. Not sure it's worth changing in this PR, but that's the direction we can go in anyway.
Sean-Kim marked this conversation as resolved
Sean Kim added 1 commit 2024-02-29 19:53:45 +01:00
Sean Kim reviewed 2024-02-29 19:59:22 +01:00
@ -1667,0 +1698,4 @@
struct Operation;
/* Common data used for executing a gesture operation. */
struct Context {
Author
Member

Unsure if this naming without the SculptGesture prefix is now too similar to the common bContext. I have some slight concerns about this naming later with free too - thoughts on both of these @HooglyBoogly ?

Unsure if this naming without the `SculptGesture` prefix is now too similar to the common `bContext`. I have some slight concerns about this naming later with `free` too - thoughts on both of these @HooglyBoogly ?
Member

Thanks for trying that out! I think those are valid concerns. Maybe free_data would work? And maybe GestureData is okay. I like something like cloth::SimulationData, but I can't think of another word besides Gesture for that. Not a big deal to just add a bit of redundancy in these cases though.

Thanks for trying that out! I think those are valid concerns. Maybe `free_data` would work? And maybe `GestureData` is okay. I like something like `cloth::SimulationData`, but I can't think of another word besides `Gesture` for that. Not a big deal to just add a bit of redundancy in these cases though.
Sean-Kim marked this conversation as resolved
Sean Kim added 1 commit 2024-03-01 01:12:20 +01:00
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-coordinator Build done. Details
db5d3fc9e8
Further renaming
Member

@blender-bot build

@blender-bot build
Hans Goudey approved these changes 2024-03-01 21:17:25 +01:00
Hans Goudey merged commit 8791153a7b into main 2024-03-01 22:07:35 +01:00
Sean Kim deleted branch common-gesture 2024-03-01 22:19:12 +01:00
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 project
No Assignees
2 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#118881
No description provided.