class VIEW3D_MT_PIE_bim_class(bpy.types.Menu):
bl_label = "Class"
@classmethod
def poll(cls, context):
if not context.active_object and not context.selected_objects:
cls.poll_message_set("No object selected.")
return False
return True
And it's not just Menu and AssetShelf, there are other places (e.g. UIList.draw_item, UIList.draw_filter) - you can find them by searching Context | None in the bpy\types\__init__.pyi, so it could to be a part of some more general issue.
fake-bpy-module-latest-20240724
I've noticed in a few places that typing is suggesting hat it's possible that provided
context
will beNone
:leading to issues like this:
And it's not just
Menu
andAssetShelf
, there are other places (e.g.UIList.draw_item
,UIList.draw_filter
) - you can find them by searchingContext | None
in thebpy\types\__init__.pyi
, so it could to be a part of some more general issue.