30 July, 2020

Blender Python Tutorial: Class Naming Convention





In this video, we will be looking at the correct Naming Convention for our classes. The Class name should be as follows: ADDONNAME_PT_main_panel


ADDONNAME - Using Uppercase, we type the Name of the Add-on. An underscore can be used if the name is more than one word.

_PT_ - it is then separated by two letters which denotes the Class Type (from which the type is inherited).

main_panel - using lowercase, we can type the name of the Operator/Panel/Header ect.

Other Class Types:
  • HT – Header
  • MT – Menu
  • OT – Operator
  • PT – Panel
  • UL – UI list

Here are some examples of Valid Class Names and their Identifiers.













Notice how the Identifier for the Operator is different?.

We do not need to add the OT but instead we must add a full stop. We also do not need to add the '_operator' at the end but I prefer to name it as such.

1 comment: