Brushes' use of object mode for polling is ambiguous #119618
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#119618
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Brush DNA data blocks have
ob_mode
setting that ties them to a particular object mode. This is used inpaint_toolslots_init
to filter and select an appropriate brush for the current mode.This works fine when the brushes are used only for one object type, as is the case for most current modes. For Grease Pencil v3, however, the plan is to use the existing sculpt and paint mode instead of adding a specific mode for GreasePencil objects. The sculpt mode in particular requires special settings from the Brush::gpencil_settings. Checking only the
ob_mode
of the brush makes it so all brushes with theSCULPT
object mode are now eligible for Grease Pencil v3 sculpt mode, even if they don't have the appropriategpencil_settings
.The
paint_toolslots_init
can arbitrarily select a default brush that is not suitable for sculpt mode with GPv3 objects. Checking this additional condition would require context-dependent object properties. Using object mode to communicate which type of brush is expected is not enough to distinguish brushes (code).What i would suggest:
Instead of using object mode as proxy for the tool type/paint settings, use maybe the context mode or some other enum that is more specific than the object mode.
The
paint->runtime.ob_mode
is set inBKE_paint_runtime_init
based on the paint type used.Then
BKE_paint_toolslots_brush_validate
decodes this into matching brush types.There are now fewer object modes than there are possible
Paint
settings and some paint types become indistinguishable to brush poll functions.I would not do this change, it sounds like it's going to cause problems. For GPv3 you should really try to change as little other design as possible, and just get things working as they were before. Don't make these kinds of design changes that cause the GPv3 project to take even longer.
@brecht Would be good to understand why you think this will cause more issues. We're also already using
OB_MODE_EDIT
andOB_MODE_WEIGHT_PAINT
so those would have to be reverted as well.I'd like to add that one of the goals of GPv3 was to make Grease Pencil a "first class citizen" and not seperate it from the other objects. E.g. we're using the same
ModifierData
struct for modifiers.One part of this is a planning thing. If you encounter something like this that requires changing some deeper design, you should consider not doing it, even if you consider the existing design suboptimal. I think it's a big part of the reason the GPv3 project is taking longer than was initially expected, refactoring more logic than needed rather than mechanically changing one data structure to another. I don't think this even needed any new mode bits, the existing ones could have been used.
Regarding the design, I don't think using the same object mode bit is what makes it a first class citizen. Curves sculpt mode also uses its own bit, as brushes are not shared with regular sculpt mode. It's only the same thing in name and UI organization.
The existing brush and asset code relies on them being classified by mode. So I don't see the point in refactoring this and having to solve the design problem this issue is about. I don't think
OB_MODE_EDIT
has an equivalent problem, so if it works there is no need to change. IfOB_MODE_WEIGHT_PAINT
has a similar problem already without a solution, maybe it should be changed back.We'll go back to
OB_MODE_SCULPT_GPENCIL_LEGACY
andOB_MODE_WEIGHT_GPENCIL_LEGACY
. Closing.