Support > Scripts
Scripts

ToonzScript

The following link allows to download the chapter of the Toonz User Guide that describes the ToonzScript language.
There you can find the description of all the elements of the scripting language and some example to understand better how to write useful scripts.
Download ToonzScript manual.

Sample Code

Convert to Vector (Centerline method)
The script will show you the CenterlineVectorizer method.
Using this method you can convert a raster drawing in a vector drawing using a centerline method for the recognition of the vectors. Setting the proper attributes you can determine the overall aspect of the new vectorized image.
Inspect Script Download Script
Create Scene
The script will show you how to create a new scene and populate it using scripting. After creating an empty scene two levels will be created and their contents loaded and set into the corresponding cells of the scene's xsheet, then the scene is saved.
Inspect Script Download Script
Resize Full Color Level
The script will show you how to use the Transform and the ImageBuilder methods for scaling an existing level, up to 150% of its original size in the example, and then store it saving a new Toonz scene file.
Inspect Script Download Script
Convert to Vector (Outline method)
The script will show you the use of the OutlineVectorizer method.
Using an outline method for the recognition of the vectors you can convert a raster image in a vector image and setting the proper attributes you can determine the overall aspect of the new vectorized image.
Inspect Script Download Script
Convert PLI to Raster
The script will show you how to convert a PLI level into a raster level.
Using the available parameters you can define the size of the new images, their dpi and determine if they will be full color or Toonz color mapped raster level.
Inspect Script Download Script
Render specific Columns
The script will show you how to render just some selected columns from an already existent scene.
The output is saved as a .tif images sequence and then showed in a flipbook window.
Inspect Script Download Script
Create a new Scene and its Contents I
This script will show you how to create a new scene and populate it with a modified version of some pre-existing levels.
Focusing on more than one feature of the language this script is a bit longer and more complex than the others above.
Inspect Script Download Script
Create a new Scene and its Contents II (Function)
This script will show you how to create a new scene and populate it with a modified version of some pre-existing levels defining a Function.
ToonzScript supports the definition of Functions and their use results in a more compact and readable code.
Inspect Script Download Script

Scripting resources

Here you can find a list of useful resources available for scripting languages. These links can be used for building up a solid base about scripting languages and techniques, but they don't link to any material referring directly to ToonzScript.

JavaScript Guide

ECMAScript

Eloquent JavaScript