Command System

From The Foundry MODO SDK wiki
Revision as of 06:45, 17 May 2012 by Jangell (Talk | contribs) (Developing Commands)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Any time you interact with modo, you are executing a command. Anything from clicking in a viewport to creating a primitive to saving your work is done through commands. Using commands is also how scripts affect modo, including providing user interfaces and changing the scene itself.

Working With Commands

These articles break down the command system in more detail:

  • Basics covers command classes, the standard syntax format, arguments and datatypes, and command blocks.
  • Executing Commands explains how to fire commands, and the associated Command Dialogs that can appear.
  • Executing Scripts looks at how to execute scripts and pass arguments through the command system.
  • Querying explores querying a command's argument for its value, which can then be used by a script or a command, and how such queries create Form View
  • Query Operators examines the use of special operators to modify the values of command arguments before execution.
  • Aliases details an advanced feature that allows one command to completely replace another command in the application.
  • Startup Commands covers adding commands to your config that execute every time the application launches.
  • CommandService Reference explains how to obtain information about the command system through the ScriptQuery mechanism.

Developing Commands

These articles deal with creating new commands as plug-ins through the SDK:

Useful Viewports

There are a couple of viewports that are particularly useful when working with commands and scripts: the Command History and the Event Log.

Command History

The Command History Viewport tracks command executions, making it an essential development tool. This viewport also contains the undo stack, a complete command list, a simple scripting interface, and the results of any queries performed from the Command entry at the bottom of the viewport.

Event Log

The Event Log Viewport provides information a list of messages from various subsystems. Plug-ins can define their own log subsystems, or can use one of the existing ones. Scripts use a standard scripting subsystem. The log view can be filtered to show only certain subsystems and can be saved to disk.

Related

More Information