Page MenuHome

tool_group_demo.py

import bpy
from bpy.types import WorkSpaceTool
class MyTool(WorkSpaceTool):
bl_space_type = 'VIEW_3D'
bl_context_mode = 'OBJECT'
# The prefix of the idname should be your add-on name.
bl_idname = "my_template.my_circle_select"
bl_label = "My Circle Select"
bl_description = (
"This is a tooltip\n"
"with multiple lines"
)
bl_icon = "ops.generic.select_circle"
bl_widget = None
bl_keymap = (
("view3d.select_circle", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("wait_for_input", False)]}),
("view3d.select_circle", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'SUB'), ("wait_for_input", False)]}),
)
def draw_settings(context, layout, tool):
props = tool.operator_properties("view3d.select_circle")
layout.prop(props, "mode")
layout.prop(props, "radius")
def register():
bpy.utils.register_tool(MyTool, after={"builtin.select_lasso"}, separator=False, group=False)
def unregister():
bpy.utils.unregister_tool(MyTool)
if __name__ == "__main__":
register()

File Metadata

Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
49/57/c081590e4e9e6d7be43f94c61967

Event Timeline