Skip to content

Instantly share code, notes, and snippets.

@thejoltjoker
Created May 24, 2017 16:51
Show Gist options
  • Save thejoltjoker/1e3e20602294115eac1bd239e166ba0a to your computer and use it in GitHub Desktop.
Save thejoltjoker/1e3e20602294115eac1bd239e166ba0a to your computer and use it in GitHub Desktop.
My custom shelf in Maya.
global proc shelf_Custom () {
global string $gBuffStr;
global string $gBuffStr0;
global string $gBuffStr1;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Display relationships among nodes in your scene graphically"
-enableBackground 0
-align "center"
-label "Node Editor"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "NE"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconWindow.png"
-image1 "menuIconWindow.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "NodeEditorWindow"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "List the objects in the scene"
-enableBackground 0
-align "center"
-label "Outliner"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "Outl"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconWindow.png"
-image1 "menuIconWindow.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "OutlinerWindow"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Display and edit connections in shading networks"
-enableBackground 0
-align "center"
-label "Hypershade"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "Hshd"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconWindow.png"
-image1 "menuIconWindow.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "HypershadeWindow"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "vrayShowVFB();"
-enableBackground 0
-align "center"
-label "vrayShowVFB();"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "VFB"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "commandButton.png"
-image1 "commandButton.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "vrayShowVFB();"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "import imp\n\nfoo = imp.load_source('maya', 'C:/johannes/gdrive/scripts/sequence/maya/menu.py')\nmaya.theSequenceMenu()"
-enableBackground 0
-align "center"
-label "import imp\n\nfoo = imp.load_source('maya', 'C:/johannes/gdrive/sc..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "seqMenu"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "import imp\n\nfoo = imp.load_source('maya', 'D:/people/johannes/scripts/repos/sequence/maya/menu.py')\nmaya.theSequenceMenu()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Delete construction history on the selected object(s)"
-enableBackground 0
-align "center"
-label "History"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "Hist"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconEdit.png"
-image1 "menuIconEdit.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "DeleteHistory"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Select an object(s)"
-enableBackground 0
-align "center"
-label "Freeze Transformations"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "FT"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconModify.png"
-image1 "menuIconModify.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "FreezeTransformations"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Select an object(s)"
-enableBackground 0
-align "center"
-label "Center Pivot"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "CP"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "menuIconModify.png"
-image1 "menuIconModify.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "CenterPivot"
-sourceType "mel"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "def scriptImport(): \n from sequence.maya.tools import renameTool\n reload(renameTool)\n renameTool.renameTool()\n print '# Sequence menu reloaded'\n\nscriptImport()"
-enableBackground 0
-align "center"
-label "def scriptImport(): \n from sequence.maya.tools import rename..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "rn"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "def scriptImport(): \n from sequence.maya.tools import renameTool\n reload(renameTool)\n renameTool.renameTool()\n print '# Sequence menu reloaded'\n\nscriptImport()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\ncmds.orientConstraint( w=1, mo=False );\ncmds.delete( cn=True );"
-enableBackground 0
-align "center"
-label "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\n..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.25
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\ncmds.orientConstraint( w=1, mo=False );\ncmds.delete( cn=True );"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "import maya.cmds as cmds\n\ndef removeVrayEnvironmentPreviewTm():\n\t# Are there any vrayEnvironmentPreviewTm nodes?\n\ttry: \n\t\tcmds.select('vrayEnvironmentPreviewTm*', r=True)\n\t\tnodesFound = cmds.ls( selection=True )\n\t\t\n\t\ttextMessage = 'Nodes found:\\n\\n'\n\t\tfor node in nodesFound:\n\t\t\ttextMessage += node + '\\n'\n\t\ttextMessage += '\\nAre you sure you want to delete them?'\n\t\tresponse = cmds.confirmDialog( title='Confirm', message=textMessage, button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )\n\n\texcept:\n\t\tresponse = cmds.confirmDialog( title='Oh wait', message='No vrayEnvironmentPreviewTm nodes found.', button=['Doh'], defaultButton='Doh', dismissString='Doh' )\n\n\n\t# Delete the nodes selected\n\tif (response == 'Yes'):\n\t\ttry:\n\t\t\tcmds.delete()\n\t\texcept:\n\t\t\tresponse = cmds.confirmDialog( title='Confirm', message='Unable to delete the nodes... (reason unknown) - ask Freddddddooo!', button=['Ok'], defaultButton='Ok', dismissString='Ok' )"
-enableBackground 0
-align "center"
-label "import maya.cmds as cmds\n\ndef removeVrayEnvironmentPreviewTm():\n..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "venvpr"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "import maya.cmds as cmds\n\ndef removeVrayEnvironmentPreviewTm():\n\t# Are there any vrayEnvironmentPreviewTm nodes?\n\ttry: \n\t\tcmds.select('vrayEnvironmentPreviewTm*', r=True)\n\t\tnodesFound = cmds.ls( selection=True )\n\t\t\n\t\ttextMessage = 'Nodes found:\\n\\n'\n\t\tfor node in nodesFound:\n\t\t\ttextMessage += node + '\\n'\n\t\ttextMessage += '\\nAre you sure you want to delete them?'\n\t\tresponse = cmds.confirmDialog( title='Confirm', message=textMessage, button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )\n\n\texcept:\n\t\tresponse = cmds.confirmDialog( title='Oh wait', message='No vrayEnvironmentPreviewTm nodes found.', button=['Doh'], defaultButton='Doh', dismissString='Doh' )\n\n\n\t# Delete the nodes selected\n\tif (response == 'Yes'):\n\t\ttry:\n\t\t\tcmds.delete()\n\t\texcept:\n\t\t\tresponse = cmds.confirmDialog( title='Confirm', message='Unable to delete the nodes... (reason unknown) - ask Freddddddooo!', button=['Ok'], defaultButton='Ok', dismissString='Ok' )"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "# replace the \";\" with \":\" for OSX\n# or better yet determine your system and\n# automatically do it. I'll leave that up to you.\n# (hint: try os.name)\n\nimport sys\nfrom pymel.all import *\n\ndef getEnvironment():\n scriptPaths = mel.getenv(\"MAYA_SCRIPT_PATH\")\n plugInPaths = mel.getenv(\"MAYA_PLUG_IN_PATH\")\n pythonPaths = mel.getenv(\"PYTHONPATH\")\n iconPaths = mel.getenv(\"XBMLANGPATH\")\n pathPaths = mel.getenv(\"PATH\")\n sysPaths = sys.path\n \n allScriptPaths = scriptPaths.split(\";\")\n print \"\\nMAYA_SCRIPT_PATHs are:\"\n for scriptPath in allScriptPaths:\n print scriptPath\n\n allPlugInPaths = plugInPaths.split(\";\")\n print \"\\nMAYA_PLUG_IN_PATHs are:\"\n for plugInPath in allPlugInPaths:\n print plugInPath\n \n allPythonPaths = pythonPaths.split(\";\")\n print \"\\nPYTHONPATHs are:\"\n for pythonPath in allPythonPaths:\n print pythonPath\n \n allIconPaths = iconPaths.split(\";\")\n print \"\\nXBMLANGPATHs are:\"\n for iconPath in allIconPaths:\n print iconPath\n \n allPathPaths = pathPaths.split(\";\")\n print \"\\nPATHs are:\"\n for pathPath in allPathPaths:\n print pathPath\n \n print \"\\nsys.paths are:\"\n for sysPath in sysPaths:\n print sysPath\n\ngetEnvironment()"
-enableBackground 0
-align "center"
-label "# replace the \";\" with \":\" for OSX\n# or better yet determine you..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "path"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "# replace the \";\" with \":\" for OSX\n# or better yet determine your system and\n# automatically do it. I'll leave that up to you.\n# (hint: try os.name)\n\nimport sys\nfrom pymel.all import *\n\ndef getEnvironment():\n scriptPaths = mel.getenv(\"MAYA_SCRIPT_PATH\")\n plugInPaths = mel.getenv(\"MAYA_PLUG_IN_PATH\")\n pythonPaths = mel.getenv(\"PYTHONPATH\")\n iconPaths = mel.getenv(\"XBMLANGPATH\")\n pathPaths = mel.getenv(\"PATH\")\n sysPaths = sys.path\n \n allScriptPaths = scriptPaths.split(\";\")\n print \"\\nMAYA_SCRIPT_PATHs are:\"\n for scriptPath in allScriptPaths:\n print scriptPath\n\n allPlugInPaths = plugInPaths.split(\";\")\n print \"\\nMAYA_PLUG_IN_PATHs are:\"\n for plugInPath in allPlugInPaths:\n print plugInPath\n \n allPythonPaths = pythonPaths.split(\";\")\n print \"\\nPYTHONPATHs are:\"\n for pythonPath in allPythonPaths:\n print pythonPath\n \n allIconPaths = iconPaths.split(\";\")\n print \"\\nXBMLANGPATHs are:\"\n for iconPath in allIconPaths:\n print iconPath\n \n allPathPaths = pathPaths.split(\";\")\n print \"\\nPATHs are:\"\n for pathPath in allPathPaths:\n print pathPath\n \n print \"\\nsys.paths are:\"\n for sysPath in sysPaths:\n print sysPath\n\ngetEnvironment()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "def seqMenuImport(): \n from sequence.maya.tools import renameTool\n reload(renameTool)\n renameTool.renameTool()\n print '# Sequence menu reloaded'\n\nseqMenuImport()"
-enableBackground 0
-align "center"
-label "def seqMenuImport(): \n from sequence.maya.tools import renam..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "check"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "from sequence.maya.tools import preRendCheck\nreload(preRendCheck)\npreRendCheck.main()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "def scriptImport():\n from sequence.maya.tools.clayblast import clayblast\n reload(clayblast)\n print '# Script reloaded'\nscriptImport()"
-enableBackground 0
-align "center"
-label "def scriptImport():\n from sequence.maya.tools.clayblast impor..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "rLayers"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "def scriptImport():\n from sequence.maya.scripts.util import rs_setupRenderLayers\n reload(rs_setupRenderLayers)\n print '# Script reloaded'\n rs_setupRenderLayers.SetupRedshiftRenderLayers()\nscriptImport()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\ncmds.orientConstraint( w=1, mo=False );\ncmds.delete( cn=True );"
-enableBackground 0
-align "center"
-label "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\n..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "cnstDel"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "import maya.cmds as cmds\ncmds.pointConstraint( w=1, mo=False );\ncmds.orientConstraint( w=1, mo=False );\ncmds.delete( cn=True );"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Relax Tool: Smooth the surface of a mesh without affecting its shape"
-enableBackground 0
-align "center"
-label "Relax Tool"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "Relax.png"
-image1 "Relax.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "SetMeshRelaxTool"
-sourceType "mel"
-doubleClickCommand "ShowMeshRelaxToolOptions"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Sculpt Tool: Lift a surface"
-enableBackground 0
-align "center"
-label "Sculpt Tool"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "Sculpt.png"
-image1 "Sculpt.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "SetMeshSculptTool"
-sourceType "mel"
-doubleClickCommand "ShowMeshSculptToolOptions"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "Slide edge loops or paths along their neighbouring edges"
-enableBackground 0
-align "center"
-label "Slide Edge"
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "slideEdgeTool.png"
-image1 "slideEdgeTool.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "SlideEdgeTool"
-sourceType "mel"
-doubleClickCommand "SlideEdgeToolOptions"
-commandRepeatable 1
-flat 1
;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 35
-height 35
-manage 1
-visible 1
-preventOverride 0
-annotation "from sequence.maya.tools import preRendCheck\nreload(preRendCheck)\npreRendCheck.main()"
-enableBackground 0
-align "center"
-label "from sequence.maya.tools import preRendCheck\nreload(preRendCheck..."
-labelOffset 0
-rotation 0
-flipX 0
-flipY 0
-useAlpha 1
-font "plainLabelFont"
-imageOverlayLabel "rename"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.5
-image "pythonFamily.png"
-image1 "pythonFamily.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "from sequence.maya.tools import renameTool\nreload(renameTool)\nrenameTool.renameTool()"
-sourceType "python"
-commandRepeatable 1
-flat 1
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment