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 functools import wraps | |
from maya import cmds | |
def undo(func): | |
""" Puts the wrapped `func` into a single Maya Undo action, then | |
undoes it when the function enters the finally: block """ | |
@wraps(func) | |
def _undofunc(*args, **kwargs): | |
try: | |
# start an undo chunk |
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 PySide import QtCore | |
from PySide import QtGui | |
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin | |
class MainWindow(MayaQWidgetDockableMixin, QtGui.QMainWindow): | |
def __init__(self, parent=None): | |
super(MainWindow, self).__init__(parent=parent)\ |
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
script_dir = os.path.dirname(os.path.realpath(__file__)) |
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 logging | |
logging.basicConfig(format='%(levelname)s: %(message)s') | |
log = logging.getLogger(__file__) | |
log.setLevel(logging.INFO) |
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 | |
# author: Kirill Kovalevskiy | |
# e-mail: [email protected] |
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 bash | |
# Get this scrip directory | |
CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# Set basic environmental variables | |
export PYTHONPATH="$PYTHONPATH:$CURDIR/lib/python2.7/site-packages" | |
# Dependencies | |
DEPENDENCIES=(\ |
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 get_maya_location(): | |
""" | |
Return maya install location on Windows | |
Source: https://github.com/JukeboxPipeline/jukebox-core/blob/master/src/jukeboxcore/ostool.py | |
:returns: path to maya | |
:rtype: str | |
:raises: errors.SoftwareNotFoundError | |
""" | |
# The supported maya versions |
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
platform = {'linux2': 'linux', 'darwin': 'mac', 'win32': 'windows'}[sys.platform] |
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 cmds | |
import maya.OpenMaya as OpenMaya | |
import math | |
# Find if object located within camera frustum | |
# Usage: | |
# from obj_in_frust import in_frustum | |
# in_frustum('camera1', 'pCube1') | |
class Plane(object): |
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
# This is a safe way to append a line to your sudoers file | |
# The validation will be performed with "visudo -c" | |
# before replacing the sudoers file | |
if [[ -z $1 ]]; then echo "No line provided to append"; return 1; fi | |
# Include directive to be appended to sudoers file | |
include_line=$1 | |
su_bac_file="/var/tmp/sudoers.bac" |
OlderNewer