This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
def getYYMMDD(filepath): | |
statbuf = os.stat(filepath) | |
date = time.localtime((statbuf.st_mtime)) | |
# Debug | |
#print str(date) | |
# Extract out the year, month and day from the date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def disableUnselectedWriteNodes(): | |
selectedNodes = nuke.selectedNodes() # Get all selected nodes | |
allWriteNodes = nuke.allNodes('Write') # Get all write nodes | |
for node in allWriteNodes: | |
nuke.toNode(node.name()).knob('disable').setValue(True) | |
for node in selectedNodes: | |
nuke.toNode(node.name()).knob('disable').setValue(False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
def removeVrayEnvironmentPreviewTm(): | |
# Are there any vrayEnvironmentPreviewTm nodes? | |
try: | |
cmds.select('vrayEnvironmentPreviewTm*', r=True) | |
nodesFound = cmds.ls( selection=True ) | |
textMessage = 'Nodes found:\n\n' | |
for node in nodesFound: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
for attribute in (cmds.listAttr("vraySettings")): | |
print attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
def bevelSelected(): | |
selection = cmds.ls( selection=True ) | |
for select in selection: | |
cmds.polyBevel(mesh, offset=0.1, angleTolerance=0) | |
def unBevelSelected(): | |
selection = cmds.ls (selection=True) | |
for select in selection: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get Maya scene filepath and name | |
sceneFilepath = cmds.file(q=True, sn=True) | |
sceneName = os.path.basename( sceneFilepath ) | |
sceneNameNoExtension = os.path.splitext(sceneName)[0] | |
sceneNameExtensionOnly = os.path.splitext(sceneName)[1] | |
# Get Maya project | |
mayaProject = cmds.workspace(q=True, rd=True) | |
# internalVar returns internal variables on a user level, more info: http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/internalVar.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
def toggleOrthoPersp(): | |
if cmds.getAttr('perspShape.orthographic') == 1: | |
cmds.setAttr('perspShape.orthographic', 0) | |
print('Orto disabled on Persp view.') | |
else: | |
cmds.setAttr('perspShape.orthographic', 1) | |
print('Orto enabled on Persp view.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import maya.mel as mel | |
import sys | |
input = sys.stdin.readline() | |
selection = cmds.ls( selection=True ) | |
for object in selection: | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example(object): | |
def run(self): | |
print "Hello, world!" | |
if __name__ == '__main__': | |
Example().run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!`about -batch`) { | |
// GUI commands go in here and are skipped in batch mode | |
} |