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

Synopsis

baseTemplate([string], [exists=boolean], [fileName=string], [force=boolean], [load=boolean], [matchFile=string], [silent=boolean], [unload=boolean], [viewList=string])

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

baseTemplate is NOT undoable, queryable, and editable.

This is the class for the commands that edit and/or query templates.

Return value

None

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

Keywords

base, template

Related

baseView, containerTemplate

Flags

exists, fileName, force, load, matchFile, silent, unload, viewList
Long name (short name) Argument types Properties
exists(ex) boolean query
Returns true or false depending upon whether the specified template exists. When used with the matchFile argument, the query will return true if the template exists and the filename it was loaded from matches the filename given.
fileName(fn) string createquery
Specifies the filename associated with the template. This argument can be used in conjunction with load, save or query modes. If no filename is associated with a template, a default file name based on the template name will be used. It is recommended but not required that the filename and template name correspond.
force(f) boolean create
This flag is used with some actions to allow them to proceed with an overwrite or destructive operation. When used with load, it will allow an existing template to be reloaded from a file. When used in create mode, it will allow an existing template to be recreated (for example when using fromContainer argument to regenerate a template).
load(l) boolean
Load an existing template from a file. If a filename is specified for the template, the entire file (and all templates in it) will be loaded. If no file is specified, a default filename will be assumed, based on the template name.
matchFile(mf) string query
Used in query mode in conjunction with other flags this flag specifies an optional file name that is to be matched as part of the query operation.

In query mode, this flag needs a value.

silent(si) boolean createqueryedit
Silent mode will suppress any error or warning messages that would normally be reported from the command execution. The return values are unaffected.
unload(u) boolean create
Unload the specified template. This action will not delete the associated template file if one exists, it merely removes the template definition from the current session.
viewList(vl) string createquery
Used in query mode, returns a list of all views defined on the template.

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


#    Determine if template exists
#
cmds.baseTemplate ('foo.xml', exists=True)
#