By Jeff Russell
Marmoset Toolbag has Python scripting support! This feature allows for the creation and distribution of user scripts and plugins to add custom behavior to Toolbag. Python is a powerful language, and its inclusion into Toolbag greatly enhances the possibilities of the software.
This page serves as a basic introduction to developing with Python with Toolbag. If you’re a software developer or a technical artist, you’ll probably be up and running quickly. If you’re new to programming, you might need to spend some time with the Python language and tools first before you’re able to make much headway.
The Python Language
Python is a powerful, simple, and widely-used language, well suited for scripting and plugin development. It is beyond the scope of this article to teach the Python language itself, but if you are unfamiliar you can fairly quickly get your bearings in the official Python tutorial.
As of the version 4.03 release Toolbag uses Python 3.9.4. You may find other reference material elsewhere on the internet for earlier versions of Python. Most concepts from version to version remain the same, but there are some differences so you should be careful when checking reference material.
Example scripts are a great way to get started and Toolbag ships with a collection of them accessible through the Edit -> Plugins menu.
Let’s create and run a simple example script of our own. Open your user plugins folder through the menu option Edit -> Plugins -> Show User Plugin Folder. Create a file named “tutorial.py” in this folder with a text editor of your choice. Place the following line of code in it: