This file contains hidden or 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
# ------------------------------------------------------------------------- | |
# ------------------------------------------------------------------------- | |
# test.py | |
# This is a test | |
# version: 0.1 | |
# date: 5/23/2013 | |
# author: jGalloway | |
# ------------------------------------------------------------------------- | |
# ------------------------------------------------------------------------- |
This file contains hidden or 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 mc | |
########################################################################### | |
## This wraps commands in a maya UndoContext | |
# ------------------------------------------------------------------------- | |
class UndoContext(object): | |
def __enter__(self): | |
mc.undoInfo(openChunk=True) | |
def __exit__(self, *exc_info): | |
mc.undoInfo(closeChunk=True) |
This file contains hidden or 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
########################################################################### | |
## Code Block. This Class sets up a logger for debugging. | |
# ------------------------------------------------------------------------- | |
class SetupLogger(): | |
def __init__(self): | |
# Set up fresh logging | |
self.name = name | |
self.log = logging.getLogger(self.name) | |
# Set the logging level | |
self.log.setLevel(logging.DEBUG) |
This file contains hidden or 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 mc | |
# check if there are unsaved changes | |
fileCheckState = mc.file(q=True, modified=True) | |
# if there are, save them first ... then we can proceed | |
if fileCheckState: | |
print 'Need to save.' | |
# This is maya's native call to save, with dialogs, etc. | |
# No need to write your own. |
This file contains hidden or 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 foo(): | |
# a func can just make a call to itself and fetch the name | |
funcName = foo.__name__ | |
# print it | |
print 'Internal: {0}'.format(funcName) | |
# return it | |
return funcName | |
# you can fetch the name externally | |
fooName = foo.__name__ |
This file contains hidden or 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
//Maya ASCII 2011 scene | |
//Name: quad_sphere_unwrapped.ma | |
//Last modified: Wed, Oct 02, 2013 04:15:59 PM | |
//Codeset: 1252 | |
requires maya "2011"; | |
requires "stereoCamera" "10.0"; | |
currentUnit -l centimeter -a degree -t film; | |
fileInfo "application" "maya"; | |
fileInfo "product" "Maya 2011"; | |
fileInfo "version" "2011"; |
This file contains hidden or 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
#!/usr/bin/env python | |
''' | |
hogGenGradient.py | |
~~~ | |
A script built on PIL to convert an image to 8-bit heightmap and a | |
luminance sorted gradient map. | |
Requirements: PIL, numpy | |
Tested mainly in Python 2.7 (also limited tests in 2.6.4) |
This file contains hidden or 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
#!/usr/bin/env python | |
#coding:utf-8 | |
'''Loops selection to average RGBA on vertices.''' | |
__author__ = 'hogjonny' | |
import maya | |
from maya import cmds,mel | |
global gDebug |
This file contains hidden or 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
#!/usr/bin/env python | |
#coding:utf-8 | |
# -- This line is 75 characters ------------------------------------------- | |
# ------------------------------------------------------------------------- | |
# ------------------------------------------------------------------------- | |
# fileTemplate.py | |
# This is a template formatting for new files. | |
# version: 0.1 |
OlderNewer