Sculpt: Add global automasking propagation steps #117316
No reviewers
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117316
Loading…
Reference in New Issue
No description provided.
Delete Branch "Sean-Kim/blender:102377-auto-masking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request adds the ability for the
propagation_steps
value for certain automasking settings to be applied globally instead of using the per-brush attribute.Previously, while the flag settings were stored at the brush and global level, the
propagation_steps
value would always change the brush attribute even when using the global menu.Testing
make test
results in 2 failures (49 - io_wavefront, 323 - imbuf_save), but these tests appear to fail even prior to any changes being applied when running locallyLimitations
No unit tests exist that touch this particular code path, the work for setting up stub data seems fairly involved so I'm currently opting to do that work in a follow-up task since the actual logical changes for this particular PR are relatively minor.
Addresses #102377
On the user side this works like expected.
Waiting for other reviewers to approve the technical side then.
Thanks for the PR! My main comment is about removing unrelated changes from this patch. They should be proposed separately.
@ -2654,2 +2654,4 @@
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 13)) {
if (!DNA_struct_member_exists(
The
DNA_struct_member_exists
check should be unnecessary given the file subversion bump.Oh, makes sense - I got a bit confused with seeing some of the previous changes in this file that do both. I assumed that it was a prerequisite to have both layers of checks.
@ -384,2 +384,4 @@
IDP_ClearProperty(idprop);
}
/* Ensure sculpt-mode global automasking_boundary_edges_propagation_steps is defaulted
This is basically the point of this function, so this comment isn't adding much. I'd suggest removing it.
@ -199,3 +209,1 @@
if (automasking_flags & (BRUSH_AUTOMASKING_BOUNDARY_EDGES |
BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS | BRUSH_AUTOMASKING_VIEW_NORMAL))
{
/* TODO: I'm unsure why the BRUSH_AUTOMASKING_VIEW_NORMAL cares at all about the propagation
Agreed, but how about handling that in a separate PR?
@ -802,10 +818,10 @@ bool tool_can_reuse_automask(int sculpt_tool)
SCULPT_TOOL_DRAW_FACE_SETS);
}
/* TODO: Update Sculpt * and Brush * to be const */
Agreed, but let's not add these todo comments in this PR
@ -818,3 +834,3 @@
automasking->current_stroke_id = ss->stroke_id;
bool use_stroke_id = false;
/* Initialize and ensure variables on both SculptSession and the Cache. */
These changes are unrelated to the goal of the PR. I generally agree, but better to propose them separately, like above.
Just to be clear - do you mean the general restructuring that happened in the
cache_init
function, or just the added comments?The general restructuring-- the changes should basically just be related to the functionality change in this PR
Sorry that I'm being a bit picky about removing unrelated changes from this PR, but I think it's a good habit to get into, and it makes the life of anyone reading the diff later easier.
@ -2667,2 +2667,4 @@
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 14)) {
if (!DNA_struct_member_exists(
The
DNA_struct_member_exists
check can be removed here, it should be redundant with the file subversion bumpWhoops, thought I removed this in the previous commit
@ -2669,0 +2673,4 @@
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Sculpt *sculpt = scene->toolsettings->sculpt;
if (sculpt != nullptr) {
Sculpt default_sculpt = *(DNA_struct_default_get(Sculpt));
Unnecessary parentheses here
@ -1286,2 +1286,3 @@
/* Brush can be null. */
/**
* Creates and initializes an automasking cache.
This comment change is still unrelated to the goal of the path, it should be remove from this PR
@ -315,2 +317,3 @@
/* automasking */
/* Automasking mode flags
* See rna_brush.cc#rna_enum_brush_automasking_flag_items
Unrelated change
@ -1088,2 +1088,4 @@
int transform_mode;
/* Automasking mode flags
* See rna_brush.cc#rna_enum_brush_automasking_flag_items
Unrelated change
No worries about being picky - it's a difference of development habits that I need to get used to for blender.
@ -186,2 +186,4 @@
}
/* Fetch the propogation_steps value, preferring the brush level value over the global sculpt tool
* * value. */
* * value
->* value
@HooglyBoogly If this is all good to go could you merge the PR?