Your Ad Here

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

Synopsis

setUITemplate( [templateName] , [popTemplate=boolean], [pushTemplate=boolean])

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

setUITemplate is undoable, queryable, and editable.

This command sets the current(default) command template for the ELF commands. The special name NONE can be used to set no templates current. See "uiTemplate" command also.

Flags

popTemplate, pushTemplate
Long name (short name) [argument types] Properties
pushTemplate(pst) boolean create
Push the current template onto a stack that can later be popped.
popTemplate(ppt) boolean create
Pop the current template off of the stack and sets the next template on the stack to be current.

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.

Return value


The name of the currently selected command template.

Python examples

import maya.cmds as cmds

#    Create a new template.
#
if cmds.uiTemplate( 'ExampleTemplate', exists=True ):
	cmds.deleteUI( 'ExampleTemplate', uiTemplate=True )

cmds.uiTemplate( 'ExampleTemplate' )

cmds.button( defineTemplate='ExampleTemplate', width=100, height=40, align='left' )
cmds.frameLayout( defineTemplate='ExampleTemplate', borderVisible=True, labelVisible=False )

#    Create a window and apply the template.
#
window = cmds.window()
cmds.setUITemplate( 'ExampleTemplate', pushTemplate=True )
cmds.columnLayout( rowSpacing=5 )

cmds.frameLayout()
cmds.columnLayout()
cmds.button( label='One' )
cmds.button( label='Two' )
cmds.button( label='Three' )
cmds.setParent( '..' )
cmds.setParent( '..' )

cmds.frameLayout()
cmds.columnLayout()
cmds.button( label='Red' )
cmds.button( label='Green' )
cmds.button( label='Blue' )
cmds.setParent( '..' )
cmds.setParent( '..' )

cmds.setUITemplate( popTemplate=True )

cmds.showWindow( window )

  

Return to Autodesk Index


Your Ad Here