Startup Commands

From The Foundry MODO SDK wiki
Revision as of 02:41, 29 February 2012 by GwynneR (Talk | contribs) (Config File Format)

Jump to: navigation, search

On startup, modo can run any commands you like, including scripts, which can perform any operation you like. The list of startup commands is stored in the config, although none are defined by default.

Config File Format

To add startup commands, you first add a root-level <StartupCommands> atom tag to your config. This contains any number of <Command> list tags, which in turn represent the individual commands themselves. These commands will be executed in the order they are listed. Startup commands are executed at the very end of the startup process, just before the input loop starts. This example creates a simple hello on startup through the dialog.??? series of commands.

 <nowiki><atom type="StartupCommands">
     <list type="Command">dialog.setup info</list>
     <list type="Command">dialog.msg "Hello!"</list>
     <list type="Command"></list>
</syntaxhighlight lang="xml">
== Scripts as Startup Commands ==
Any command can be executed as a startup command, including scripts. Startup commands are intentionally executed before license checking occurs. This allows you to perform stand-alone operations before the user gets control. If you want your script to run without user interaction, you'll want to be sure to prefix commands with one or two exclamation point to suppress any dialogs they might open.
The following execute the [[Perl]] script ''''.
 <atom type="StartupCommands">
     <list type="Command"></list>
If run without a license, ''modo'' will open the license dialog will open after the startup commands finish executing. You can issue ''app.quit'' as a startup command to quit before the license dialog appears.
 <atom type="StartupCommands">
     <list type="Command"></list>
     <list type="Command">app.quit</list>
== Rendering with Startup Commands ==
See the [[Network Rendering]] article for information about using startup commands for fire-and-forget rendering.
== See Also ==
* [[Commands]]
* [[Config Files]]
* [[Network Rendering]]