Files
test/scripts
Philipp Oeser af601e01fa Fix #145987: Brush selector available in Image Editor Mask mode
The keymap `km_image_paint` righfully includes both
`VIEW3D_AST_brush_texture_paint` and `IMAGE_AST_brush_paint` since
painting can be done in both Editors.

So we want to improve upon polling.

Three parent classes involved: `ImageAssetShelf`, `View3DAssetShelf`,
both inherit from `BrushAssetShelf`

`IMAGE_AST_brush_paint` (inherits from `ImageAssetShelf`) was already
checking for being in paint mode (so that Asset Shelf already wasnt
showing), but `VIEW3D_AST_brush_texture_paint` (inherits from
`View3DAssetShelf`) was permissive (doesnt have specialized poll, relies
on the "mother" classes `BrushAssetShelf` which only checks for an
active object and if that active objects `mode` equals the Assets Shelfs
"mode"). This can be true if you have an object in Texture Paint mode in
the 3DView.

So to make shelves like `VIEW3D_AST_brush_texture_paint` **not** pass
their poll in the Image Editor, add a specific poll case.

NOTE: the report also mentiones a crash when actually selecting a "bad"
brush from the "bad" asset shelf. Since that scenario is now impossible
to reach, the crash has not been investigated further.

Pull Request: https://projects.blender.org/blender/blender/pulls/146071
2025-09-22 15:56:52 +02:00
..
2025-09-16 18:04:25 +02:00