Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy/utils/__init__.py
| Show First 20 Lines • Show All 852 Lines • ▼ Show 20 Lines | def register_tool(tool_cls, *, after=None, separator=False, group=False): | ||||
| def tool_from_class(tool_cls): | def tool_from_class(tool_cls): | ||||
| # Convert class to tuple, store in the class for removal. | # Convert class to tuple, store in the class for removal. | ||||
| tool_def = ToolDef.from_dict({ | tool_def = ToolDef.from_dict({ | ||||
| "idname": tool_cls.bl_idname, | "idname": tool_cls.bl_idname, | ||||
| "label": tool_cls.bl_label, | "label": tool_cls.bl_label, | ||||
| "description": getattr(tool_cls, "bl_description", tool_cls.__doc__), | "description": getattr(tool_cls, "bl_description", tool_cls.__doc__), | ||||
| "icon": getattr(tool_cls, "bl_icon", None), | "icon": getattr(tool_cls, "bl_icon", None), | ||||
| "cursor": getattr(tool_cls, "bl_cursor", None), | "cursor": getattr(tool_cls, "bl_cursor", None), | ||||
| "options": getattr(tool_cls, "bl_options", None), | |||||
| "widget": getattr(tool_cls, "bl_widget", None), | "widget": getattr(tool_cls, "bl_widget", None), | ||||
| "widget_properties": getattr(tool_cls, "bl_widget_properties", None), | "widget_properties": getattr(tool_cls, "bl_widget_properties", None), | ||||
| "keymap": getattr(tool_cls, "bl_keymap", None), | "keymap": getattr(tool_cls, "bl_keymap", None), | ||||
| "data_block": getattr(tool_cls, "bl_data_block", None), | "data_block": getattr(tool_cls, "bl_data_block", None), | ||||
| "operator": getattr(tool_cls, "bl_operator", None), | "operator": getattr(tool_cls, "bl_operator", None), | ||||
| "draw_settings": getattr(tool_cls, "draw_settings", None), | "draw_settings": getattr(tool_cls, "draw_settings", None), | ||||
| "draw_cursor": getattr(tool_cls, "draw_cursor", None), | "draw_cursor": getattr(tool_cls, "draw_cursor", None), | ||||
| }) | }) | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||