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
| """ | |
| MayaPy.py | |
| Remote control of a mayapy session with a simple proxy interface. This is not intended as a complete RPC server or anything of the sort; the primary use case is as an isolation chamber (since you can manipulate paths and environment variables) for use in testing. | |
| """ | |
| import subprocess | |
| import cPickle as pickle | |
| import os |
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
| alias subs=subs | |
| function subs() { | |
| movie="${1}" | |
| filename="${1%.*}" | |
| mappings=`ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "${movie}"` | |
| OLDIFS=$IFS | |
| IFS=, | |
| ( while read idx lang | |
| do |
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 seq_to_glob(path): | |
| """Takes an image sequence path and returns it in glob format, | |
| with the frame number replaced by a '*'. | |
| Image sequences may be numerical sequences, e.g. /path/to/file.1001.exr | |
| will return as /path/to/file.*.exr. | |
| Image sequences may also use tokens to denote sequences, e.g. | |
| /path/to/texture.<UDIM>.tif will return as /path/to/texture.*.tif. |
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 module's docstring summary line. | |
| This is a multi-line docstring. Paragraphs are separated with blank lines. | |
| Lines conform to 79-column limit. | |
| Module and packages names should be short, lower_case_with_underscores. | |
| Notice that this in not PEP8-cheatsheet.py |
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 pymel.core as pm | |
| import re | |
| def parseVtxIdx(idxList): | |
| """convert vertex index list from strings to indexes. | |
| idxList : [u'vtx[1]', u'vtx[3]', u'vtx[6]', u'vtx[8]', u'vtx[12:13]'] | |
| return : [1,3,6,8,12,13] | |
| """ | |
| parseIdxList = [] |
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
| ''' | |
| Ryan Roberts - Wrap Deformer | |
| rr_wrap.py | |
| Description: | |
| Ryan Robers created a simple function to create a wrap deformer. | |
| The wrap deformer needs a little more than the deform command to get working. | |
| Michael Clavan | |
| I wanted to have the function also return the deformer to the user. So, my contributions are pretty minor. | |
| I converted the wrap deformer into a pynode object type pm.nt.Wrap. |
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
| """ | |
| Original example reformatted from: | |
| http://blog.3dkris.com/2011/08/python-in-maya-how-to-make-commands.html | |
| python_inside_maya discussion: | |
| https://groups.google.com/d/topic/python_inside_maya/xfuCYBO6aLg/discussion | |
| """ | |
| import maya.cmds as cmds |
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 PySide.QtCore as QtCore | |
| import PySide.QtGui as QtGui | |
| from nukescripts import panels | |
| class PanelTest(QtGui.QWidget): | |
| def __init__(self, parent=None): | |
| QtGui.QWidget.__init__(self, parent) | |
| self.setLayout(QtGui.QVBoxLayout()) | |
| self.myTable = QtGui.QTableWidget() | |
| self.myTable.header = ['Date', 'Files', 'Size', 'Path' ] |
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 math | |
| class Vector(object): | |
| def __init__(self, *args): | |
| """ Create a vector, example: v = Vector(1,2) """ | |
| if len(args)==0: self.values = (0,0) | |
| else: self.values = args | |
| def norm(self): | |
| """ Returns the norm (length, magnitude) of the vector """ |
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
| from collections import namedtuple | |
| def convert(dictionary): | |
| return namedtuple('GenericDict', dictionary.keys())(**dictionary) | |
| """ | |
| >>> d = dictionary(a=1, b='b', c=[3]) | |
| >>> named = convert(d) | |
| >>> named.a == d.a | |
| True | |
| >>> named.b == d.b |
NewerOlder