blender/scripts/templates_py/UI/asset_shelf.py
quackarooni a0dafebac9 UI: subdirectory support for Menu.menu_path, use for text templates
Create submenus for common template types in the text editor as the menu
was getting too long.

Common categories such as Gizmo, UI & Operators are now in their own
directories, displayed as submenus.

Menu.menu_path now supports expanding sub-menus recursively.

Ref !154643
2026-03-05 11:04:52 +11:00

29 lines
692 B
Python

import bpy
class MyAssetShelf(bpy.types.AssetShelf):
bl_space_type = 'VIEW_3D'
bl_idname = "VIEW3D_AST_my_asset_shelf"
# Tell the shelf which data-block types to show. It is highly recommended
# to use these filters, as they avoid slowdowns when there are many assets
# of irrelevant data-block types.
# If no filter is set, all data-block types will show.
filter_material = True
filter_object = True
@classmethod
def poll(cls, context):
return context.mode == 'OBJECT'
def register():
bpy.utils.register_class(MyAssetShelf)
def unregister():
bpy.utils.unregister_class(MyAssetShelf)
if __name__ == "__main__":
register()