Difference between revisions of "Command System: Querying"

From The Foundry MODO SDK wiki
Jump to: navigation, search
(Created page with "Command arguments marked with a question mark can be '''queried'''. For example, the ''material.name'' command’s ...")
(No difference)

Revision as of 03:11, 16 February 2012

Command arguments marked with a question mark can be queried. For example, the material.name 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 material.name 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.

material.name ?
material.name name:?