Blender Wiki notes the following about bl_idname convention.
"For headers, menus and panels, the bl_idname is expected to match the class name (automatic if none is specified).
Valid Examples:
class OBJECT_OT_fancy_tool (and bl_idname = "object.fancy_tool")
class MyFancyTool (and bl_idname = "MYADDON_MT_MyFancyTool")
" In other Blender Python documentation I noted also: PythonDocumentationPanel
class HelloWorldPanel(bpy.types.Panel): bl_idname = "OBJECT_PT_hello_world"
and
class PanelOne(View3DPanel, bpy.types.Panel): bl_idname = "VIEW3D_PT_test_1"
I struggle to grasp how all these are valid as the demand is "expected to match the class name".
Can you shade light on the convention or refer me to the right source, so I know how and when to use Upper, Lower, Mix case?
MyFancyToolas well asMyFancyPanelis valid because of PEP8: https://www.python.org/dev/peps/pep-0008/#class-names However, the recommended way is the one you've already found in the release notes,CUSTOM_PT_myPanelorCUSTOM_OT_myOperatorfor the class name. When it comes to operators, the most important thing to note is that they can be called usingbpy.ops.*... bpy.ops + namespace + your name to classify whether it is an operator for meshes, lights, cameras or whatnot,bpy.ops.namespace.my_fancy_tool(). Does this help? – brockmann Feb 25 '21 at 15:32HelloWorldPanelWhen a class is registered, it is known to blender via itsbl_idname(in template example case)bpy.types.OBJECT_PT_helloCan leave out thebl_idnameand it registers asbpy.types.HelloWorldPanel(with the warning) which is undesirable, particularly if for instance it was named "Panel" (wont reg, but imagine the hassles if it did) Hence for panels and menus my suggestion is stick to using abl_idnamewith the convention, rather than the alternate of class naming via convention. – batFINGER Feb 26 '21 at 02:47