insert_in_toolset.py#
insert_in_toolset.py
Insert the command into the Sculpt toolset
1# The tool insertion example - insert the tool that shows the "Hello world!"
2import coat
3# add the translation of the identifier "test_script"
5# if the command is not inserted into the toolset, we insert it there
9else:
10 # ... if inserted, we execute the action
1 # The tool insertion example - insert the tool that shows the "Hello world!"
2 import coat
3
4 # add the translation of the identifier "test_script"
5 coat.ui.addTranslation("test_tool", "The Tool")
6
7 # if the command is not inserted into the toolset, we insert it there
8 if not coat.ui.checkIfMenuItemInserted("test_tool"):
9 coat.ui.insertInToolset("Voxels","Adjust","test_tool")
10 coat.dialog().text("The 'test_tool' inserted into the Sculpt->Adjust->The tool.").ok().show()
11 else:
12 # ... if inserted, we execute the action
13 coat.dialog().text("Hello world!").ok().show()