Difference between revisions of "HostService Reference"
(Created page with "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'' ...")
Revision as of 08:59, 8 April 2012
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 provide a 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.
Querying the hostservice ScriptQuery interface reveals the following attributes:
classes And class Attributes
Get a list of all available server classes. No selection is required. Lists of servers within those classes can be obtained with the. server.??? series of attributes.
|Example||query hostservice classes ?|
|Result||[list of all classes by name]|
The only attribute in the class.??? group, class.servers returns a list of all servers within a specific class. The selector must be one of the strings returned by classes.
|Example||query hostservice class.servers ? loader|
|Result||[list of all servers of the loader class]|
servers And server Attributes
servers requires no selection. It returns a full list of all available servers, which can then be used with the server attributes.
|Example||query hostservice servers ?|
|Result||[list of all servers by name]|
The 'server' series of attributes provide information about specific servers. Each requires a selector returned by servers or class.servers unless otherwise noted.
Get the internal name of a server.
|Example||query hostservice server.name ? loader/$LWO2|
Get the human-readable name of a server.
|Example||query hostservice server.userName ? loader/$LWO2|
|Result||Lightwave Object (LWO2)|
Get the class of a server. This class can be used as a selector for the class.servers attribute.
|Example||query hostservice server.class ? loader/$LWO2|
Get the path to the file that the server exists in. If this is a built-in server, an empty list is returned.
|Example||query hostservice server.userName ? loader/mayaAscii|
Get the value of serve tag. Tags can be any simple static information the server wants to provide to the application. Some of these are particularly useful to scripts, such as loader.dosPattern and saver.dosPattern, which define the file extensions of loaders and savers.
The selector is the tag to be retrieved. Note that tags are case sensitive. Before using this attribute, a specific server must have previously been "selected" with server.name or one of the other server attributes.
|Example||query hostservice server.name ? loader/$LWO2
query hostservice server.infoTag ? loader.dosPattern
Returns the external server search path. It requires no selection. This is also available through platformservice interface by passing hosts as the selector to the path.path attribute.
|Example||query hostservice defaultPath ?|