bpy.types.WorkSpaceTool attributes and methods are undocumented #105018

Open
opened 2024-11-14 07:30:13 +01:00 by Andrej · 0 comments
Contributor

WorkSpaceTool docs - https://docs.blender.org/api/current/bpy.types.WorkSpaceTool.html

It has bl_idname, bl_description, draw_settings (method used to draw the tool UI) and some other attributes that are used during register_tool. See the code:

        tool_def = ToolDef.from_dict({
            "idname": tool_cls.bl_idname,
            "label": tool_cls.bl_label,
            "description": getattr(tool_cls, "bl_description", tool_cls.__doc__),
            "icon": getattr(tool_cls, "bl_icon", None),
            "cursor": getattr(tool_cls, "bl_cursor", None),
            "options": getattr(tool_cls, "bl_options", None),
            "widget": getattr(tool_cls, "bl_widget", None),
            "widget_properties": getattr(tool_cls, "bl_widget_properties", None),
            "keymap": getattr(tool_cls, "bl_keymap", None),
            "data_block": getattr(tool_cls, "bl_data_block", None),
            "operator": getattr(tool_cls, "bl_operator", None),
            "draw_settings": getattr(tool_cls, "draw_settings", None),
            "draw_cursor": getattr(tool_cls, "draw_cursor", None),
        })
WorkSpaceTool docs - https://docs.blender.org/api/current/bpy.types.WorkSpaceTool.html It has `bl_idname`, `bl_description`, `draw_settings` (method used to draw the tool UI) and some other attributes that are used during `register_tool`. See the [code](https://projects.blender.org/blender/blender/src/commit/6b7ba4c7266cbe50388b77b8a32a4c85cd8d0459/scripts/modules/bpy/utils/__init__.py#L1059-L1073): ```python tool_def = ToolDef.from_dict({ "idname": tool_cls.bl_idname, "label": tool_cls.bl_label, "description": getattr(tool_cls, "bl_description", tool_cls.__doc__), "icon": getattr(tool_cls, "bl_icon", None), "cursor": getattr(tool_cls, "bl_cursor", None), "options": getattr(tool_cls, "bl_options", None), "widget": getattr(tool_cls, "bl_widget", None), "widget_properties": getattr(tool_cls, "bl_widget_properties", None), "keymap": getattr(tool_cls, "bl_keymap", None), "data_block": getattr(tool_cls, "bl_data_block", None), "operator": getattr(tool_cls, "bl_operator", None), "draw_settings": getattr(tool_cls, "draw_settings", None), "draw_cursor": getattr(tool_cls, "draw_cursor", None), }) ```
Andrej added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-11-14 07:30:13 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#105018
No description provided.