Autodesk® MatchMover TM embeds a script interpreter compatible with Python and also gives access to some of its internal data and user interface commands. This allows the user to write any kind of pre- or post processing on the input/output data that flows through the computation engine. But scripts can also be used to launch any command, just as one would do with its mouse or keyboard.
The power of scripting is only limited by the user’s imagination, and one can improve the interface with fully customized tools. For quick access to the most frequently used scripts, a Script Toolbar can be configured dynamically by the user. Some scripts are given as examples that display current cameras/tracks, or select all the tracks that have not been reconstructed. These are few samples of the power of scripts built-in MatchMover.
The Script Editor can be opened through the Scripts menu or by using the icon at the bottom right of the Status Bar.
This editor should be use to edit/run scripts. It is divided into two panes: the upper pane shows the script output while the lower pane is the editor.
You can directly type some scripts here and execute them (Ctrl+Enter). When the Script Editor is floating, the current script name and its modification status are displayed in the title bar, but the Script Editor can also be docked as any other window.
The Scripts menu order is a bit different in the Script Editor and in the main menu, for more efficiency, but all the commands are the same.
Erases the content of the editor pane. May ask to save the current script if it has been modified.
Stores the current script in the script database. The database can later be edited using the Script Manager. Stored scripts can be directly launched using the Script submenu in the Script Editor.
Or even better, they can be displayed in the Script Toolbar and launched by a simple click.
The Script Manager is used to handle the script database. MatchMover can keep track of some useful scripts and provide ways to launch them more easily through the menu or the Script Toolbar.
The Script Manager shows the list of currently stored scripts. Note that what is stored is just the source filename of the script, not the script itself. This allows you to edit your scripts in any other editors.
Take care if you move the source file to another location, the link in the database will not be updated automatically. You can add some new scripts here or remove the selected ones. When a script is selected, you can click on Open Script to see it in the Script Editor, or simply double-click on its label in the script list.
Script attributes are editable as follows:
This is the text that will be displayed in the script submenu in the Script Editor and on the button in the Script Toolbar.
This is the text that will be displayed in the Status Bar when the mouse passes over this script item.
Toggle if this script is also shown as a tool button in the Script Toolbar for faster launching.
Use this to select an image file that will be shown in the toolbar instead of the script label.
If checked, this option automatically opens the Script Editor to see the script output when this script is launched.
For a huge script, or debugging process, you may want to launch a script in a separate thread. When such a script is launched, the user interface is not stopped and the script can be stopped by pressing the Stop Script button that pops up.
Tells if the interpreter needs to be reset before launching this script.
The MatchMover Package makes the link with the script interpreter. It is a module that allows scripts to interact with the MatchMover interface and data. This package is materialized by an Python object called "mm". This means that you can send a command to MatchMover using a syntax like:
[Python] > mm.selectTracks( [ mm.getTrackId( "Track 01" ) ] );
Usually, all commands that refer to an object take its id as a parameter. The link between an item and its id is made through calls like getTrackId, getGroupId etc., that take the item label as argument
To see the list of all additional MatchMover Package commands, use the Help command in the Languages menu of either the Script Editor or the main Script menu item. This will display all the commands with their syntax and usage. When some arguments are optional, their default values is shown in the argument list.
> createTrack( label = "", group = -1 )
This means you can launch createTrack without argument at all, or specify a label, and even a group id if needed.
Scripts can also be used to run MatchMover in batch Mode from the command line. Here is the corresponding syntax for setting language:
> MatchMover -script filename language 'filename' should point to the source file containing the script 'language' is the script language (1 = Python)
With MatchMover comes a collection of sample scripts in several languages. Check in the Scripts subdirectory of your installation for details. Each file is self commented and provides all kind of examples, such as a NUKE exporter.
Each script file can contain several subroutines, and you can select any of them, even with optional arguments in the Script Manager.