Sculpt: Add per-brush input samples #117080
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#117080
Loading…
Reference in New Issue
No description provided.
Delete Branch "Sean-Kim/blender:108109-unified-input-samples"
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 users to specify
input_samples
on a per brush basis.The existing field in the main
Paint
struct forces all brushes of a particular tool type to use the same value. A new field was added to theBrush
struct to allow for this value to be specified there instead, and a corresponding unified value inUnifiedPaintSettings
has been created to allow users to use the same value across all brushes.Limitations
While the previous functionality allowed for storing data on a per-tool basis, the current implementation in this pull request only provides users the ability to specify
input_samples
on a brush or overall basis. Therefore, if any user happens to currently specify different values for different tool modes, they will be unable to after this pull request is merged. Additionally, in the case that multiple non-default values exist for this field currently in a blend file, the current implementation does not favor a particular tool's value for migrating data into theUnifiedPaintSettings
and instead leaves it at the default value of 1.Testing
make test
results in 3 failures (46 - gpu, 49 - io_wavefront, 323 - imbuf_save), but these tests appear to fail even prior to any changes being applied when running locallyAppearance
Addresses #108109
Tagging @Sergey @HooglyBoogly and @JulienKaspar as specified in the original issue for review.
On the user side this works exactly like expected 👍
This will be very useful for the upcoming essential brushes.
For now I'm fine with the loss of per mode Input Samples. At some point the Unified Settings should be stored per mode anyway, which would improve this further.
6509ffeda8
to7ebb780257
Looks good, just a few comments.
@ -0,0 +10,4 @@
#include "BKE_brush.hh"
namespace blender::bke::tests {
TEST(brush, BKE_brush_input_samples_get_unified)
IMO these tests add more trouble than they're worth. The functions being tested are just a few lines long, with extremely simple logic. I'd suggest skipping them, and maybe instead spend time adding tests for more complex areas of the code :)
Will do, I was on the fence about adding them, but I decided to keep it in the PR when submitting just to err on the side of more rather than less.
You made the right call if you were on the fence :) I love to see the excitement about testing, just have to be pragmatic too I think
@ -4559,6 +4559,61 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
FOREACH_NODETREE_END;
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 306, 12)) {
Only the versioning in the 400.cc file should be necessary as far as I know. That will always be applied.
@ -1339,2 +1343,4 @@
float secondary_rgb[3];
/** Unified brush stroke input samples. */
int input_samples;
Could we just change the meaning of
num_input_samples
instead of adding a new field here? That seems simpler in the long run.That seems like it would add more logic onto the python side of things to handle this instead of using the pattern that already exists for the
UnifiedPaintSettings
, and I think that having the flag stored with the other unified attributes while having the value stored in thePaint
struct will add to confusion down the line. I'm not strictly opposed, but I think changing it this way groups the attribute nicely with other similar concepts.Hmm, what I mean is just using the same integer in
Paint
. Why would that add logic in Python?It's not a big change, but this part of
UnifiedPaintPanel.prop_unified
:assumes that the only possible owners of a property are either the brush or the
UnifiedPaintSettings
struct. Keeping the value inPaint
would either mean adding a property check againstnum_input_samples
or adding a new optional property to the method signature to allow passing in thePaint
object. In my opinion this seems like adding clutter to this method.To me the added complexity of moving this attribute to
UnifiedPaintSettings
and deprecating the old one is worth it primarily due to future readability of the struct, instead of having the flag in one place and the actual value that it corresponds to somewhere else.Aah, oops! I missed the separation between the two changes in this file, that they were in different structs. Sorry for wasting your time!
No worries, it was a fair question to ask! 😄
@HooglyBoogly If this is all good to go could you merge the PR?