Skip to content

Instantly share code, notes, and snippets.

@boredstiff
boredstiff / selectSkinnedBones.py
Created November 5, 2014 03:31
Maya: Run through a directory of skinned maps, grab their names and output to a file with the proper commands.
#python
"""
Forgot to make a selection set of skinned bones before detaching the weights so I figured why waste 10 minutes
figuring out which bones to grab when I can just make Python do it in less than 2 minutes?
"""
import os
myDir = '/Users/alexwidener/projects/rigging/Ruslan/skins/skin1'
f = []
@boredstiff
boredstiff / picker.py
Last active August 29, 2015 14:08
Picker
# Extremely old from a project that got canceled.
# This is not a great method of creating a picker as it does not work cross-OS
# due to an indexing issue with Maya on OS X(and maybe Linux).
# When I was originally writing this, I was on Windows only at the time
# Anyway, I would write PySide/Qt and not this.
import maya.cmds as cmds
from functools import partial
@boredstiff
boredstiff / gist:043d2ffc799d2335bb77
Last active August 29, 2015 14:10
AwAddAttributes
"""
"""
import maya.cmds as cmds
import pymel.core as pmc
w=150
class awAttributeAdder():
import csv
import pymel.core as pm
import math
import random
import re
import maya.mel
pm.setAttr('perspShape.farClipPlane', 10000000)
file = '/Users/widenale/Desktop/MayaProject/NewYorkSorted.csv'
@boredstiff
boredstiff / importPaths.py
Last active August 29, 2015 14:11
importPaths.py
#python
"""
Modo: print all import paths to the event log.
"""
import lx
platform = lx.service.Platform()
pathCount = platform.ImportPathCount()
@boredstiff
boredstiff / disemvowel.py
Last active August 29, 2015 14:12
disemvowel.py
"""Pass in a string to remove the vowels and spaces"""
def disemvowel(t):
v = 'aeiou '
print "".join([l for l in t.lower() if l not in v])
@boredstiff
boredstiff / yupzup.py
Created January 15, 2015 02:35
For Simon Unger
import maya.cmds as cmds
getaxis = cmds.upAxis(ax=True, q=True)
if getaxis == 'y':
cmds.upAxis(ax='z', rv=True)
elif getaxis == 'z':
cmds.upAxis(ax='y', rv=True)
@boredstiff
boredstiff / isVisible.py
Created February 4, 2015 23:20
Modo Is Object Visible?
#python
import lx
import lxu.select
def isVisible():
scn_svc = lx.service.Scene()
curScn = lxu.select.SceneSelection().current()
chan = curScn.Channels(None, 0.0)
chanRead = lx.object.ChannelRead(chan)
@boredstiff
boredstiff / meshSelListener.py
Created March 17, 2015 02:52
meshSelListener.py
#python
import lx
import lxu.object
import lxu.command
import lxifc
class AwSelListener(lxifc.SelectionListener):
running = False
@boredstiff
boredstiff / sublimeMaya.sublime-project
Created June 21, 2015 07:02
Sublime Maya Project Backup
{
"settings": {
"python_interpreter": "C:\\Program Files\\Autodesk\\Maya2016\\bin\\mayapy.exe",
"auto_complete_triggers": [{"selector":"source.python", "characters":"."}],
"auto_complete_function_params":"all",
"sublime_completions_visibility":"list",
"show_errors_on_save":true,
"lint_mode":"background",
"mark_style":"outline",
"keys": ["ctrl+alt+d"], "command": "sublime_jedi_docstring",