Skip to content

Instantly share code, notes, and snippets.

@timborrelli
timborrelli / SmoothInfiniteKeys.py
Last active September 25, 2017 19:49
Smooth out keys on infinite cycled controls in Maya's graph editor
import maya.cmds as cmds
import math
def getVector(val1, val2):
v1_theta = math.atan2(val1[1], val1[0])
v2_theta = math.atan2(val2[1], val2[0])
myAngle = math.degrees((v2_theta - v1_theta))
@timborrelli
timborrelli / ExportFBX.py
Last active June 21, 2024 09:23
FBX Animation Exporter from Mesh Selection
import maya.cmds as cmds
import os as os
import maya.mel as mel
# Description
# This tool will export selected mesh(es) as an FBX
# It will name each export the same as the Maya file you export from, but with the character's namespace replacing the first part of the file name.
# File naming is expected to be "<name of character>_alltheothershit.extension" like "male_idleToWalk.ma"
@timborrelli
timborrelli / rangeFinder.py
Created September 18, 2020 19:15
Script to center current time in time slider to a frame range, with a +/- buffer set by the user.
import maya.cmds as cmds
import maya.mel as mel
def swapToRange(buffer):
print 'swap to range'
#get all dem frames
curRangeStart = cmds.playbackOptions(q=True, min=True)
@timborrelli
timborrelli / gist:91d105da12a370cd6c810c17697f1325
Last active February 6, 2021 22:03
Google Sheet Read & Write for Maya
#NOTE- I had to disable the MASH plugin to get this to work in Maya. MASH uses a different version of the Google Client API that causes this to not work.
# Useful links:
# https://developers.google.com/sheets/api/quickstart/python
# https://medium.com/analytics-vidhya/how-to-read-and-write-data-to-google-spreadsheet-using-python-ebf54d51a72c
# https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html
def getCredsGoogle():
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is