Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
graphic:python:blender [2024/01/25 06:12] – [Blender variable naming standards] ying | graphic:python:blender [2024/01/31 08:00] – [Blender variable naming standards] ying | ||
---|---|---|---|
Line 393: | Line 393: | ||
ref: | ref: | ||
* https:// | * https:// | ||
+ | * https:// | ||
* https:// | * https:// | ||
+ | * https:// | ||
* **Class name convention**: | * **Class name convention**: | ||
Line 422: | Line 424: | ||
Example of class name, balancing between Python PEP | Example of class name, balancing between Python PEP | ||
- | * BLOSM addon, <code python> | + | * example |
+ | class BUILDMAKER_OT_CreateAsset(bpy.types.Operator): | ||
+ | bl_idname = " | ||
+ | |||
+ | class CreateAsset(bpy.types.Operator): | ||
+ | bl_idname = " | ||
+ | class BUILDMAKER_OT_createAsset(bpy.types.Operator): | ||
+ | |||
+ | # 2.8x onwards, property | ||
+ | class MyOperator(bpy.types.Operator): | ||
+ | value: IntProperty() | ||
+ | |||
+ | class ToolProperties(bpy.types.PropertyGroup): | ||
+ | commandLineMode: | ||
+ | name = " | ||
+ | description = "The option specifies if the addon is used in the command line mode", | ||
+ | default = False | ||
+ | ) | ||
+ | | ||
+ | class ToolProps(bpy.types.PropertyGroup): | ||
+ | email : StringProperty( | ||
+ | name=" | ||
+ | description=" | ||
+ | default="" | ||
+ | ) | ||
+ | class TOOL_PROPS(bpy.types.PropertyGroup): | ||
+ | lon: FloatProperty() | ||
+ | lat: FloatProperty() | ||
+ | class BUILDMAKER_PG_color(PropertyGroup): | ||
+ | color: FloatVectorProperty(subtype=' | ||
</ | </ | ||
===== common blender api commands ===== | ===== common blender api commands ===== | ||
Line 544: | Line 575: | ||
**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 |