WIP: Brush assets project #106303

Draft
Julian Eisel wants to merge 354 commits from brush-assets-project into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 29 additions and 11 deletions
Showing only changes of commit cdba752bb0 - Show all commits

View File

@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
from bpy.types import (
AssetShelf,
Header,
Menu,
Panel,
@ -30,6 +31,9 @@ from bl_ui.properties_grease_pencil_common import (
from bl_ui.space_toolsystem_common import (
ToolActivePanelHelper,
)
from bl_ui.space_view3d import (
BrushAssetShelf,
)
from bpy.app.translations import (
contexts as i18n_contexts,
@ -1723,6 +1727,15 @@ class IMAGE_PT_annotation(AnnotationDataPanel, Panel):
# Grease Pencil drawing tools.
class ImageAssetShelf(BrushAssetShelf):
bl_space_type = "IMAGE_EDITOR"
class IMAGE_AST_brush_sculpt(ImageAssetShelf, AssetShelf):
mode = 'TEXTURE_PAINT'
mode_prop = "use_paint_image"
classes = (
IMAGE_MT_view,
IMAGE_MT_view_zoom,
@ -1794,6 +1807,7 @@ classes = (
IMAGE_PT_overlay_uv_edit_geometry,
IMAGE_PT_overlay_texture_paint,
IMAGE_PT_overlay_image,
IMAGE_AST_brush_sculpt,
)

View File

@ -8933,7 +8933,6 @@ class VIEW3D_PT_viewport_debug(Panel):
class BrushAssetShelf:
bl_space_type = "VIEW_3D"
bl_options = {'DEFAULT_VISIBLE', 'NO_ASSET_DRAG', 'STORE_ENABLED_CATALOGS_IN_PREFERENCES'}
bl_activate_operator = "BRUSH_OT_asset_select"
bl_default_preview_size = 48
@ -8962,52 +8961,56 @@ class BrushAssetShelf:
layout.menu_contents("VIEW3D_MT_brush_context_menu")
class VIEW3D_AST_brush_sculpt(BrushAssetShelf, bpy.types.AssetShelf):
class View3DAssetShelf(BrushAssetShelf):
bl_space_type = "VIEW_3D"
class VIEW3D_AST_brush_sculpt(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'SCULPT'
mode_prop = "use_paint_sculpt"
class VIEW3D_AST_brush_sculpt_curves(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_sculpt_curves(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'SCULPT_CURVES'
mode_prop = "use_paint_sculpt_curves"
class VIEW3D_AST_brush_vertex_paint(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_vertex_paint(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'VERTEX_PAINT'
mode_prop = "use_paint_vertex"
class VIEW3D_AST_brush_weight_paint(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_weight_paint(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'WEIGHT_PAINT'
mode_prop = "use_paint_weight"
class VIEW3D_AST_brush_texture_paint(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_texture_paint(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'TEXTURE_PAINT'
mode_prop = "use_paint_image"
class VIEW3D_AST_brush_gpencil_paint(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_gpencil_paint(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'PAINT_GPENCIL'
mode_prop = "use_paint_grease_pencil"
class VIEW3D_AST_brush_grease_pencil_paint(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_grease_pencil_paint(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'PAINT_GREASE_PENCIL'
mode_prop = "use_paint_grease_pencil"
class VIEW3D_AST_brush_gpencil_sculpt(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_gpencil_sculpt(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'SCULPT_GPENCIL'
mode_prop = "use_sculpt_grease_pencil"
class VIEW3D_AST_brush_gpencil_vertex(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_gpencil_vertex(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'VERTEX_GPENCIL'
mode_prop = "use_vertex_grease_pencil"
class VIEW3D_AST_brush_gpencil_weight(BrushAssetShelf, bpy.types.AssetShelf):
class VIEW3D_AST_brush_gpencil_weight(View3DAssetShelf, bpy.types.AssetShelf):
mode = 'WEIGHT_GPENCIL'
mode_prop = "use_weight_grease_pencil"

View File

@ -1227,6 +1227,7 @@ void ED_spacetype_image()
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_ASSET_SHELF | ED_KEYMAP_FRAMES;
art->duplicate = asset::shelf::region_duplicate;
art->free = asset::shelf::region_free;
art->on_poll_success = asset::shelf::region_on_poll_success;
art->listener = asset::shelf::region_listen;
art->poll = asset::shelf::regions_poll;
art->snap_size = asset::shelf::region_snap;