This file contains 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
REM Export all data from this database | |
cd C:\Program Files\MySQL\MySQL Server 5.6\bin | |
REM To export to file (structure only) | |
mysqldump --no-data [DATABASENAME] -h localhost -u [USER] -p[PASSWORD] > C:\databackup\database_ddl_backup.sql | |
mysqldump --no-create-info --no-create-db [DATABASENAME] -h localhost -u [USER] -p[PASSWORD] > C:\databackup\database_data.sql |
This file contains 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 traverseBackwardsAndFindFolder( startPath, searchForFolder ): | |
# Usage example: traverseBackwardsAndFindFolder( nuke.root().name(), 'render' ) | |
returnPath = '' | |
for i in range(len(startPath.split('/'))): | |
startPath = startPath[:startPath.rfind('/')] | |
# Check if it exists | |
if (os.path.isdir(startPath + '/' + searchForFolder)): | |
returnPath = startPath + '/' + searchForFolder |
This file contains 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
# List Nuke's environment settings | |
print( nuke.root() ) | |
# Nuke script's filename | |
print( os.path.basename( nuke.root().name() ) ) | |
# Nuke script's directory | |
print( os.path.dirname( nuke.root().name() ) ) |
This file contains 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 getSubdirs( directory ): | |
for item in os.listdir( directory ): | |
# print path to all subdirectories first. | |
if os.path.isdir( os.path.join( directory, item ) ): | |
print item |
This file contains 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
# This searches for a sequence of characters | |
import os | |
def checkForDir(searchDirs, partialOrFullDirNameToFind): | |
for searchDir in searchDirs: | |
for directory in os.listdir(searchDir): | |
if partialOrFullDirNameToFind in directory.lower(): | |
foundDirectories.append(searchDir + directory) | |
return str(foundDirectories[len(foundDirectories)-1]) |
This file contains 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 | |
startDirectory = "c:/temp/" | |
searchString = "maya2012" | |
replacement = """multiline | |
string""" | |
for dname, dirs, files in os.walk(startDirectory): | |
for fname in files: | |
if ".ma" in fname: | |
fpath = os.path.join(dname, fname) |
This file contains 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 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 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 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 |
OlderNewer