About Scripting
T-ANIMPA-007-001 & T-HSCP-001-001
Asset Editor provides you with several scripting interfaces to allow you to automate and streamline certain tasks as well as to add custom functionalities to the application. Those scripting interfaces use Qt Script, a scripting language based on the ECMAScript standard which is very similar to JavaScript.
Asset Editor has different scripting interfaces:
- Asset Editor Scripting is the main scripting interface. Among many possible uses, Asset Editor scripts can automate workflows and functionalities in Asset Editor, create dialogs and perform batch operations on a scene.
- The Extended Scripting Interface is a suite of modules for power users. It includes modules for editing drawings, for creating tools and toolbars and for executing Python scripts.
- The Script Node is a special node which can take input from image or peg nodes, process its information in a custom-made script and output the processed peg or image information in the desired way. It allows you to create nodes that have custom behaviours. For example, the Maya Render Batch node is actually a Script Node configured to render your scene through an external rendering engine.
- Control Center Scripting allows you to create scripts that can be launched in a command line interface via the Control Center application. They can be used to perform batch operations on the different elements of a Harmony Server database.
- Python Interface is an interface displaying a Python representation of Asset EditorGUI and its current project. This interface can be used to create custom tools and automation tasks using Python.
Asset Editor Scripting Reference
This section of the documentation explains how to use the Asset Editor Script Editor, but does not teaches how to write scripts nor does it contain in-depth information about the classes and modules that are available in the Asset Editor scripting interface.
You can access the documentation for each of the scripting interfaces using the links below:
- Asset Editor Scripting Interface Reference
- Extended Scripting Interface Reference
- Control Center Scripting Interface Reference
-
Python Scripting Interface Reference
The scripting reference guides are also packaged with Asset Editor, so you can access them even if you have no Internet connection:
- To access one of the Asset Editor scripting interface reference guides, open the Help menu at the top of the Asset Editor user interface and select either Scripting Interface Documentation or Extended Scripting Interface Documentation.
- To access one of the Asset Editor scripting interface reference guides, open the Help menu at the top of the Asset Editor user interface and select Scripting Interface Documentation, Extended Scripting Interface Documentation or Script Node Documentation.
- To access the Control Center scripting interface reference guide, open Control Center. Then, in the top menu of the Control Center user interface, open the Help menu and select Scripting Interface Documentation.
About Qt Script
Qt Script is an object-oriented scripting language based on the ECMAScript standard, like JavaScript and JScript. However, there are some differences that distinguish Qt Script from these other scripting languages, which are familiar to web programmers.
The Qt Script environment provides several standard classes and modules that are not documented in the Asset Editor scripting documentation.
As of Toon Boom Harmony 10.3, Toon Boom Animation has changed its scripting language from QSA script to Qt Script. Scripts are stored in plain text in files with the .js
extension, instead of .qsa
. This change to the API improves the software and gives access to 64-bit capabilities of the scripting interface.
Eery effort was made to ensure backward compatibility with QSA scripts. Hence, simple functions can be ported without making any changes, but class definitions must conform to the Qt Script syntax. Therefore, scripts that define classes must be updated.