Command System: Querying

From The Foundry MODO SDK wiki
Revision as of 03:11, 16 February 2012 by Jangell (Talk | contribs) (Created page with "Command arguments marked with a question mark can be '''queried'''. For example, the '''' command’s ...")

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

Command arguments marked with a question mark can be queried. For example, the command’s name argument can be queried for its value, returning the name of the selected materials. If multiple items are selected, multiple names are returned. Although multiple values can be returned by a query, only a single value can be set for a given argument.

Using the Command History’s Results Tab

Command History's Results tab, showing a disabled command, a failed command, a successful execution and a query.

The Results tab of the Command History shows the results of any command executed or queried from that viewport, including failures and any queried values. In the case of the command, one name will show up under the command's row for each material that is selected. If no items were selected, the command is disabled and (none) is shown in the results list.

Performing a Query

To query a command, simply insert a ? in place of the value. Queries always return raw values without units, and any square brackets around the question mark are ignored. What kind of value is returned is determined by the argument’s datatype. ? name:?