graphic:python:blender

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
graphic:python:blender [2024/01/24 10:02] – [Blender variable naming standards] yinggraphic:python:blender [2024/01/31 07:41] – [Blender variable naming standards] ying
Line 393: Line 393:
 ref:  ref: 
   * https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons   * https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons
 +  * https://developer.blender.org/docs/release_notes/2.80/python_api/addons/
   * https://s-nako.work/2020/12/blender-addon-naming-rules/   * https://s-nako.work/2020/12/blender-addon-naming-rules/
 +  * https://b3d.interplanety.org/en/class-naming-conventions-in-blender-2-8-python-api/
  
   * **Class name convention**: UPPER_CASE_{SEPARATOR}_mixed_case   * **Class name convention**: UPPER_CASE_{SEPARATOR}_mixed_case
Line 421: Line 423:
     * class ClassName()     * class ClassName()
  
 +Example of class name, balancing between Python PEP
 +  * example addon, <code python>
 +class BUILDMAKER_OT_CreateAsset(bpy.types.Operator):
 +    bl_idname = "custom.buildmaker_create_asset"
 +    
 +class CreateAsset(bpy.types.Operator):
 +    bl_idname = "BUILDMAKER_OT_CreateAsset"
 +
 +class BUILDMAKER_OT_createAsset(bpy.types.Operator):
 +
 +# 2.8x onwards, property
 +class MyOperator(bpy.types.Operator):
 +    value: IntProperty()
 +
 +</code>
 ===== common blender api commands ===== ===== common blender api commands =====
  
Line 540: Line 557:
 **UI** **UI**
   * bpy.types.Panel   * bpy.types.Panel
 +    * the panel display order is determined by the order bpy.utils.register_class processes
   * bpy.types.UIList   * bpy.types.UIList
   * bpy.types.Operator   * bpy.types.Operator
  • graphic/python/blender.txt
  • Last modified: 2024/06/12 06:47
  • by ying