No user visible changes expected, except of new experimental feature option. ------------------------------------------------------------------------------ This introduces asset shelves as a new standard UI element for accessing assets. Based on the current context (like the active mode and/or tool), they can provide assets for specific workflows/tasks. As such they are more limited in functionality than the asset browser, but a lot more efficient for certain tasks. The asset shelf is developed as part of the brush assets project (see #101895), but is also meant to replace the current pose library UI. Support for asset shelves can quite easily be added to different editor types, the following commit will add support for the 3D View. If an editor type supports asset shelves, add-ons can chose to register an asset shelf type for an editor with just a few lines of Python. It should be possible to entirely remove `UILayout.asset_view_template()` once asset shelves are non-experimental. Some changes are to be expected still, see #107881. Task: #102879 Brush asset workflow blog post: https://code.blender.org/2022/12/brush-assets-workflow/ Initial technical documentation: https://developer.blender.org/docs/asset_system/user_interface/asset_shelf/ Pull Request: #104831
40 lines
826 B
Python
40 lines
826 B
Python
# SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import bpy
|
|
from bpy.types import (
|
|
Panel,
|
|
)
|
|
|
|
|
|
class ASSETSHELF_PT_display(Panel):
|
|
bl_label = "Display Settings"
|
|
# Doesn't actually matter. Panel is instanced through popover only.
|
|
bl_space_type = 'VIEW_3D'
|
|
bl_region_type = 'HEADER'
|
|
|
|
def draw(self, context):
|
|
layout = self.layout
|
|
|
|
shelf = context.asset_shelf
|
|
|
|
layout.prop(shelf, "show_names", text="Names")
|
|
layout.prop(shelf, "preview_size")
|
|
|
|
@classmethod
|
|
def poll(cls, context):
|
|
return context.asset_shelf is not None
|
|
|
|
|
|
classes = (
|
|
ASSETSHELF_PT_display,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
register_class(cls)
|