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
crossDomainLoad: (url, callback)-> | |
$.get "http://query.yahooapis.com/v1/public/yql", { | |
q: "select * from json where url = \"#{url}\"" | |
format: "json" | |
}, (data)-> | |
if data.query.results | |
callback data.query.results.json |
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
############################################## | |
# Dockable window template | |
# Created: 15/4/15 | |
# Jason Dixon (jason.dixon.email[AT]gmail.com) | |
############################################## | |
import maya.cmds as cmds | |
from functools import wraps | |
import sys |
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 | |
import collections | |
import cPickle | |
class FileInfo(collections.MutableMapping): | |
""" | |
Dictionary style interface for fileInfo | |
""" | |
def _encode(s, txt): |
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
#References: | |
#http://forums.autodesk.com/t5/installation-licensing/installing-maya-on-ubuntu/td-p/4905036 | |
#http://askubuntu.com/questions/392806/installing-maya-on-ubuntu-linux | |
#https://gist.github.com/insomniacUNDERSCORElemon/5555214 | |
#http://nealbuerger.com/2013/05/ubuntu-13-04-maya-2014-install-script/ | |
#http://www.nkoubi.com/blog/tutorial/how-to-install-autodesk-maya-2011-on-debian-ubuntu/ | |
#http://help.autodesk.com/view/MAYAUL/2015/ENU/?guid=GUID-E7E054E1-0E32-4B3C-88F9-BF820EB45BE5 | |
#http://www.andrewhazelden.com/blog/2014/10/autodesk-nlm-licensing-issues-with-maya-2015-and-max-2015/ |
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
# Stick the following in the bottom of your __init__.py, then simply import the base package. Use submodules as you need them and they'll be imported as you go. | |
import sys as _sys | |
class Package(object): | |
def __init__(s, local): | |
import os.path | |
s.cache = {} | |
s.local = dict((k, local[k]) for k in local) | |
s.root = os.path.realpath(os.path.dirname(s.local["__file__"])) | |
def __getattr__(s, k): | |
if k in s.local: return s.local[k] |
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 collections | |
class Dict(collections.MutableMapping): | |
def __init__(s, *args, **kwargs): | |
s.fwd = dict(*args, **kwargs) | |
s.rev = dict((v, k) for k, v in s.fwd.items()) | |
def __delitem__(s, k): | |
if k in s.fwd: return s.rev.pop(s.fwd.pop(k)) | |
if k in s.rev: return s.fwd.pop(s.rev.pop(k)) | |
raise KeyError, "%s not found." % k | |
def __getitem__(s, k): |
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 sys | |
import traceback | |
try: | |
raise something | |
except: | |
traceback.print_exception(*sys.exc_info()) |
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 time | |
import threading | |
import maya.cmds as cmds | |
import maya.utils as utils | |
class Animation(object): | |
def __init__(s, frames): | |
s.frames = frames | |
s.img = cmds.iconTextStaticLabel(style="iconOnly") | |
s.frame = 0 |
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
# http://stackoverflow.com/questions/635483/what-is-the-best-way-to-implement-nested-dictionaries-in-python/19829714#19829714 | |
class Dict(dict): | |
def __missing__(s, k): | |
v = s[k] = type(s)() | |
return v |
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 collections | |
class Dict(collections.MutableMapping): | |
def __init__(s, *args, **kwargs): | |
s.data = dict(*args, **kwargs) | |
def __getitem__(s, k): return s.data[k] | |
def __setitem__(s, k, v): s.data[k] = v | |
def __delitem__(s, k): del s.data[k] | |
def __iter__(s): return iter(s.data) | |
def __repr__(s): return repr(s.data) |
OlderNewer