blender/scripts/templates_py/ui_asset_shelf.py
Julian Eisel d5bac0421f Fix warning print when running asset shelf UI template
Was printing the following warning:
  Warning: 'MyAssetShelf' does not contain '_AST_' with prefix and suffix

I followed some other template for the naming, apparently the "Ui Tool
Simple" one, but that doesn't print the warning.
2023-08-30 16:26:55 +02:00

27 lines
500 B
Python

import bpy
class MyAssetShelf(bpy.types.AssetShelf):
bl_space_type = 'VIEW_3D'
bl_idname = "VIEW3D_AST_my_asset_shelf"
@classmethod
def poll(cls, context):
return context.mode == 'OBJECT'
@classmethod
def asset_poll(cls, asset):
return asset.file_data.id_type in {'MATERIAL', 'OBJECT'}
def register():
bpy.utils.register_class(MyAssetShelf)
def unregister():
bpy.utils.unregister_class(MyAssetShelf)
if __name__ == "__main__":
register()