Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

translator( [string] , [defaultOptions=string], [extension=boolean], [fileCompression=string], [filter=boolean], [list=boolean], [loaded=boolean], [objectType=boolean], [optionsScript=boolean], [readSupport=boolean], [writeSupport=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

translator is undoable, queryable, and NOT editable.

Set or query parameters associated with the file translators specified in as the argument.

Return value

boolean or string array depending upon which flags are specified.

In query mode, return type is based on queried flag.

Related

workspace

Flags

defaultOptions, extension, fileCompression, filter, list, loaded, objectType, optionsScript, readSupport, writeSupport
Long name (short name) Argument types Properties
list(l) boolean query
Return a string array of all the translators that are loaded.
loaded(ld) boolean query
Returns true if the given translator is currently loaded.
defaultOptions(do) string query
Return/set a string of default options used by this translator.
objectType(ot) boolean query
Returns a list of the file types that can be handled by this translator.
optionsScript(os) boolean query
Query the name of the options script to use to post the user options UI. When this script is invoked it will expect the name of the parent layout in which the options will be displayed as well as the name of the callback to be invoked once the apply button has been depressed in the options area.
readSupport(rs) boolean query
Returns true if this translator supports read operations.
writeSupport(ws) boolean query
Returns true if this translator supports write operations.
fileCompression(cmp) string query
Specifies the compression action to take when a file is saved. Possible values are "compressed", "uncompressed" "asCompressed".
extension(ext) boolean query
Returns the default file extension for this translator.
filter(f) boolean query
Returns the filter string used for this translator.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Returns true if dxf files can be read.
cmds.translator( 'dxf', q=True, rs=True )