properties.py - Technical Documentation¶
PLACE IMAGE OF properties.py SOURCE CODE IN THE EDITOR HERE
The properties.py
file defines the global and specific properties used by DAMTools. These properties allow storing configurations, options, and states that are shared among the addon's operators, panels, and menus.
---\n
Index¶
- General Purpose
- File Structure
- Key Blocks and Explanation
- Definition of Global Properties
- Tool-Specific Properties
- Property Registration
- Key Code Snippets
- Suggested Images
General Purpose¶
- Defines global and specific properties for DAMTools' functionality.
- Allows storing persistent configurations and temporary states.
- Facilitates communication between operators, panels, and menus.
File Structure¶
- Definition of global properties: Properties added to
Scene
,Object
, orWindowManager
. - Tool-specific properties: Options and states for each tool (import, export, QuickSnap, etc.).
- Property registration: Functions to register and unregister properties when the addon is enabled/disabled.
Key Blocks and Explanation¶
Definition of Global Properties¶
bpy.types.Scene.DAMTools_batch_import_path = StringProperty(
name="Import Path",
description="Path for batch importing files",
subtype='DIR_PATH',
)
Tool-Specific Properties¶
bpy.types.Scene.DAMTools_quicksnap_enabled = BoolProperty(
name="QuickSnap Enabled",
description="Indicates if QuickSnap is active",
default=False,
)
Property Registration¶
def register():
# Adds properties to bpy.types.Scene, Object, etc.
def unregister():
# Removes properties when the addon is disabled
Key Code Snippets¶
Example of String Property¶
bpy.types.Scene.DAMTools_batch_export_path = StringProperty(
name="Export Path",
description="Path for batch exporting files",
subtype='DIR_PATH',
)
Example of Bool Property¶
bpy.types.Scene.DAMTools_align_floor_enabled = BoolProperty(
name="Align Floor Enabled",
description="Activates the floor alignment tool",
default=False,
)
Suggested Images¶
- PLACE IMAGE OF properties.py SOURCE CODE IN THE EDITOR HERE
- PLACE IMAGE OF PROPERTIES IN BLENDER'S SCENE PANEL
- PLACE DIAGRAM SHOWING THE RELATIONSHIP BETWEEN PROPERTIES AND OPERATORS
To see the integration with each tool, consult the documentation for the corresponding modules in the [DOCUMENTATION] folder.