HostService Reference

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

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.

Attributes

Querying the hostservice ScriptQuery interface reveals the following attributes:

  • classes
  • class.???
  • servers
  • server.???
  • defaultPath

classes And class Attributes

classes

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.

Datatype string
Example query hostservice classes ?
Result [list of all classes by name]

class.servers

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.

Datatype string
Example query hostservice class.servers ? loader
Result [list of all servers of the loader class]

servers And server Attributes

servers

servers requires no selection. It returns a full list of all available servers, which can then be used with the server attributes.

Datatype string
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.

server.name

Get the internal name of a server.

Datatype string
Example query hostservice server.name ? loader/$LWO2
Result $LWO2

server.userName

Get the human-readable name of a server.

Datatype string
Example query hostservice server.userName ? loader/$LWO2
Result Lightwave Object (LWO2)

server.class

Get the class of a server. This class can be used as a selector for the class.servers attribute.

Datatype string
Example query hostservice server.class ? loader/$LWO2
Result loader

server.module

Get the path to the file that the server exists in. If this is a built-in server, an empty list is returned.

Datatype string
Example query hostservice server.userName ? loader/mayaAscii
Result C:\Program Files\Luxology\modo\fmtmayama.lx

server.infoTag

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.

Datatype string
Example query hostservice server.name ? loader/$LWO2

query hostservice server.infoTag ? loader.dosPattern

Result *.lwo

defaultPath Attribute

defaultPath

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.

Datatype string
Example query hostservice defaultPath ?
Result C:\Program Files\Luxology\modo

More Information