Tom’s Tools 1.0.

This is a collection of tools that I have made and pulled together into a single location in Maya.

Features:

  • New Scene No Dialogue Tool.
  • Center Asset Tool.
  • Capping Tool.
  • Select Cap Tool.

TomsTools_05

TomsTools_04

 


import maya.cmds as cmds

#New Scene with No Dialogue Tool function and buttion.     
def NewSceneNoDialogue(*args):
    cmds.file(new=True,force=True);

#Center Asset Tool function and buttion.       
def CappingTool(*args):
    capObjects = cmds.ls(sl=True);
    cmds.polyExtrudeEdge(capObjects, ls=(.1, .1, 0));
    cmds.MergeToCenter(capObjects);


#Capping Tool Tool function and buttion.     
def centerAsset(*args):
    centerObjects = cmds.ls(sl=True);
    cmds.CenterPivot(centerObjects);
    print centerObjects;cmds.move(0,0,0,rpr=True);
    
    
#Select Cap Tool function and buttion.        
def selectCap(*args):
    CapSF=cmds.polyListComponentConversion (tf=True);
    CapSF=cmds.select (CapSF,r=True);
    CapSF=cmds.ls (sl=True,fl=True);

#Main UI Window Start.
cmds.window( widthHeight=(370, 280), t="Toms Tools."  )
form = cmds.formLayout()
tabs = cmds.tabLayout(innerMarginWidth=5, innerMarginHeight=5)
cmds.formLayout( form, edit=True, attachForm=((tabs, 'top', 0), (tabs, 'left', 0), (tabs, 'bottom', 0), (tabs, 'right', 0)) )

#Tools Tab UI.
ToolsTab = cmds.rowColumnLayout(numberOfColumns=1)
cmds.iconTextButton(  style='iconAndTextHorizontal', image1='polyCube.png', label='New Scene With No Dialogue Tool.', command=NewSceneNoDialogue )
cmds.iconTextButton(  style='iconAndTextHorizontal', image1='locator.png', label='Center Asset Tool.', command=centerAsset )
cmds.iconTextButton(  style='iconAndTextHorizontal', image1='polyPipe.png', label='Capping Tool Tool.', command=CappingTool )
cmds.iconTextButton(  style='iconAndTextHorizontal', image1='polyCollapseEdge.png', label='Select Cap Tool.', command=selectCap )
cmds.setParent( '..' )

#Help Tab UI.
HelpTab = cmds.rowColumnLayout(numberOfColumns=2)
cmds.gridLayout(numberOfColumns=2, cellWidthHeight=(170, 50) )

#New Scene No Dialogue Tool help with description.

cmds.text( l='New Scene No Dialogue Tool', al='center', ww=True,w=1,rs=True )
cmds.text( l='Opens up a new scene with no new scene dialogue. Use with caution!', al='center', ww=True )

#Center Asset Tool help with description.

cmds.text( l='Center Asset Tool', al='center', ww=True,rs=True )
cmds.text( l='Click this button to centre a pivot point of an asset and then move the asset to the centre of the world.', al='center', ww=True )

#Capping tool help with description.
cmds.text( l='Capping Tool', al='center', ww=True, w=1,rs=True )
cmds.text( l='Simply select a edge loop of a pipe and click this button to cap the pipe.', al='center', ww=True )


#Capping tool help with description.
cmds.text( l='Select Cap Tool', al='center', ww=True,rs=True )
cmds.text( l='Simply select the centre vertex of the cap and click the button to select the cap.', al='center', ww=True )

#Support with description.
cmds.text( l='Support', al='center', ww=True,rs=True )
cmds.text( l='tom.revill@gmail.com', al='center', ww=True,rs=True )

cmds.setParent( '..' )

#Main UI Window End.

#Defines the tabs 
cmds.tabLayout( tabs, edit=True, tabLabel=((ToolsTab, 'Tools'), (HelpTab, 'Help')) )

cmds.showWindow()

This entry was posted in Code, Pipelines, Update. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *