Page Menu
Home
Search
Configure Global Search
Log In
Files
F8474566
tool_group_demo.py
David Friedli (hlorus)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
David Friedli (hlorus)
Apr 15 2020, 3:49 PM
Size
1 KB
Subscribers
None
tool_group_demo.py
View Options
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
Details
Attached
Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
49/57/c081590e4e9e6d7be43f94c61967
Attached To
D7436: Toolsystem: Fix error for groups with diffrent amount of tools between modes
Event Timeline
Log In to Comment