PyDoc: Fix typing issues with bpy.utils.register_tool
- Add `type[]` for the `tool_cls` as it's expecting tool type class, not the instance (similar to #132420) - Add `set[str]` to `after` type as it's seems to be the way it's used the most widely, e.g. in "UI Tool Simple" example that comes with Blender: `bpy.utils.register_tool(MyTool, after={"builtin.scale_cage"}, separator=True, group=True)` Pull Request: https://projects.blender.org/blender/blender/pulls/133975
This commit is contained in:
committed by
Pratik Borhade
parent
4083b9ce62
commit
380e8455e8
@@ -1022,9 +1022,9 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
|
||||
Register a tool in the toolbar.
|
||||
|
||||
:arg tool_cls: A tool subclass.
|
||||
:type tool_cls: :class:`bpy.types.WorkSpaceTool`
|
||||
:type tool_cls: type[:class:`bpy.types.WorkSpaceTool`]
|
||||
:arg after: Optional identifiers this tool will be added after.
|
||||
:type after: Sequence[str] | None
|
||||
:type after: Sequence[str] | set[str] | None
|
||||
:arg separator: When true, add a separator before this tool.
|
||||
:type separator: bool
|
||||
:arg group: When true, add a new nested group of tools.
|
||||
|
||||
Reference in New Issue
Block a user