3/8/18

MAYA - PYTHON - WINDOWS // rename file with replace string

# rename files in directory replace string by another
import os

#r at the beginning of the path so the filename starting with a number sont bien reconnu - raw string literals
renamePath = r"O:\_WORK\PERSO\__SCRIPTS\01_MAYA\_SHELF_custom\shelf_geo_icons"
renamePath = renamePath.replace('\\','/')

# loop and rename
if (renamePath != '') :
    for filename in os.listdir(renamePath):
        if (len(filename.split('.'))==2): # check if file is not a folder (if it contains an extension)
            print filename
            newName = filename.replace("ttt","") # replace
            os.rename(os.path.join(renamePath, filename), os.path.join(renamePath, newName))

3/7/18

MAYA // toggle pan Zoom shortcut

Very handy, set the same shortcut for these commands :
while pressing in continue you can 2D zoom and pan in the camera.
while pressing quickly it enbale/disable the 2D pan zoom