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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Poly Separate | |
// Copyright (C) 2012 Basenji Games | |
// Licensed under the MIT license | |
string $selection[] = `ls -sl`; | |
sepMat($selection[0]); | |
global proc sepMat(string $object){ | |
string $shadingGroups[] = getSGsFromShape($object); | |
string $ParentName = ($object + "_lightMap_Group"); |
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
from PySide import QtCore, QtGui | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as mui | |
mainWin = wrapInstance(long(mui.MQtUtil.mainWindow()), QtGui.QWidget) | |
action = QtGui.QAction(mainWin) | |
action.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Tab)) | |
action.setShortcutContext(QtCore.Qt.ApplicationShortcut) |
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
# -*- coding: utf-8 -*- | |
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
def _findFlippedUVs(nodesOnly=True): | |
ret = [] | |
selList = om.MSelectionList() |
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
# -*- coding: utf-8 -*- | |
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
def _findFlippedUVs(nodesOnly=True): | |
ret = [] | |
selList = om.MSelectionList() |
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 mc | |
import maya.OpenMaya as om | |
def softSelection(): | |
selection = om.MSelectionList() | |
softSelection = om.MRichSelection() | |
om.MGlobal.getRichSelection(softSelection) | |
softSelection.getSelection(selection) | |
dagPath = om.MDagPath() |
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
def findSkinClusters (): | |
skins = [] | |
shapes = pm.listRelatives(shapes=True, noIntermediate=True) | |
for shape in shapes: | |
skinClusters = pm.ls(type=pm.nodetypes.SkinCluster) | |
for skin in skinClusters: | |
mesh = pm.skinCluster(skin, q=True, g=True) | |
if mesh[0] == shape: | |
relatedSkinCluster = sc | |
skins.append(skin) |
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
#---------Reconstruct Subdiv Script for Maya---------- | |
#Script by - Kanishk Chouhan | |
#Email - kanishk2391@gmail.com | |
#Blog - www.pixel-architect.blogspot.com | |
#Description - | |
#This script allows u to reverse the result of smooth operation in maya after deleting the history | |
#It also preserves the original UV of the mesh | |
#Select the mesh u want to unsmooth and execute the script | |
#Script might take some time to execute depending on the polycount... |
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 maya.mel as mel | |
from maya.utils import executeDeferred | |
from functools import wraps | |
import re | |
def defer(fn): | |
'''Delays execution of the decorated function until Maya is available.''' | |
@wraps(fn) |
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
"""Illustration of how to retrieve the shape under the mouse cursor | |
Usage: | |
Run `start()` to start listening for when the mouse stops and to display a tooltip | |
Run `stop()` to stop listening | |
""" | |
from PySide import QtGui, QtCore |
OlderNewer