ScriptQuery

From The Foundry MODO SDK wiki
Jump to: navigation, search

ScriptQuery Interfaces

This section provides information about the ScriptQuery interfaces supported by modo. Each group of attributes for each service is listed separately, and then each attribute itself in this form:

Attribute: commands
Description: Get a list of all available commands
Datatype: string
Example: query commandservice commands ?
Result: [list of all commands]
  • Attribute is the name of the attribute as provided to the query command.
  • Description briefly describes the attribute and how it is used.
  • Datatype is the datatype of the attribute. Queries always return lists, although the list may be empty or there may be only a single element. A list of common datatypes is described in the Datatype section earlier in this guide.
  • Example is a simple example of how the attribute might be queried, include a selection, if required.
  • Result shows the results of the example. Italics are used to represent the actual values returned by the call, while normal text in square braces provides information about the more complex values.

Service Categories

Commandservice

Commands are executed and queried directly through the command syntax description previously in this guide, but this doesn’t provide any information about the available commands, their possible arguments, and so on. The commandservice ScriptQuery can be used to obtain detailed information about commands.

platformservice

The platformservice interface provides information about the system that modo is running on. This includes the user the application is licensed to, the application version, and operating system it is running on.

hostservice

The hostservice interface provides access to the list of available plug-ins, known as servers. This includes both built-in servers that are part of modo itself and any externally loaded modules.
The most useful application of this to scripts is to allow access to the list of loaders and savers. Servers with names starting with dollar signs, such as loader/$LXOB and saver/$Targa, are built-in servers. All other servers, such as loader/freeimage and saver/PNG, are plug-in servers.

Layerservice

Commands are executed and queried directly through the command syntax description previously in this guide, but this doesn’t provide any detailed information about meshes and their related elements. The Layerservice ScriptQuery can be used to obtain this detailed mesh information.

Many item-level operations in Layerservice have been superseded by those in Sceneservice . Be sure to check sceneservice to see if it is more appropriate to your task than Layerservice.
In general, when you want to deal with items and their channels or when you want scene-level information, you'll mostly be making use of Sceneservice.

When you want to deal with modeling operations or need to obtain information about the specific vertices, polygons and edges of a mesh, you'd use Layerservice.

Due to its design, Layerservice is only meant to work on mesh items. Attempting to pass other kinds of items to any of the attributes will fail.

Sceneservice

The sceneservice interface is used to get information about items in the scene. This includes information about cameras, lights, meshes, and the scene itself.

View3dservice

The modo interface is made up of a series of viewports, the most important of which are arguably the 3D and UV views. The view3dservice can be used to get information about them.

Scriptservice

The scriptsysservice provides some information about user values that are not available by simply querying user.value and user.def.

Messageservice

The messageservice provides access to message tables. These tables are simply config files in a specific format.

This category currently contains no pages or media.