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
''' | |
_______________________________________ | |
Name: magicSave | |
Version: 1.1 | |
Author: Alexander Smirnov | |
e-mail: [email protected] | |
site: fabis.xyz | |
_______________________________________ | |
Instructions: |
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
# Transfer current UV to the default one | |
import maya.cmds as mc | |
import maya.mel as mel | |
x=0 | |
if not mc.selectMode( q=1, object=True ): | |
x=1 | |
mel.eval('toggleSelMode; ') | |
mel.eval('changeSelectMode -object;') | |
selO=[] |
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.api.OpenMaya as om2 | |
#get vertices ID of selected faces | |
sel = om2.MSelectionList() | |
sel = om2.MGlobal.getActiveSelectionList() | |
dp, comp = sel.getComponent(0) | |
mItVtx = om2.MItMeshPolygon(dp,comp) | |
idx = [] | |
while not mItVtx.isDone(): | |
point = mItVtx.getVertices() |
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 QtGui,QtCore | |
import maya.OpenMayaUI as mui | |
import shiboken | |
import sys | |
class AttrFieldGroup(QtGui.QWidget): | |
valueChanged = QtCore.Signal(float) | |
def __init__(self, parent=None): | |
super(AttrFieldGroup, self).__init__(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
// 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 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 | |
layers = cmds.ls( type='displayLayer') | |
global chLayViz | |
try: | |
chLayViz | |
except NameError: | |
chLayViz = None | |
if chLayViz == 0 : | |
chLayViz = 1 |
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 | |
from functools import partial | |
class skinTweakTool( object ): | |
def __init__( self ): | |
global stInfluenceObjects | |
try: | |
stInfluenceObjects | |
except: | |
stInfluenceObjects = None |
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 | |
import maya.mel as mel | |
selObj = mc.ls( sl=1 ) | |
aPl = mel.eval('$tmpVar=$gPlayBackSlider') | |
trg = mc.timeControl( aPl, q=1, ra=1 ) | |
if( trg[1]-trg[0]>1 ): | |
sttr = trg[0] | |
endtr = trg[1] | |
else: |
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
clst = mc.cluster() | |
pos = mc.xform( clst[1], q=1, ws=1, rp=1 ) | |
mc.joint( p=pos, a=1 ) | |
mc.select( cl=1 ) | |
mc.delete( clst[0] ) |
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
name = mc.keyframe( q=1, n=1, sl=1 ) | |
objs = mc.ls( sl=1, l=1 ) | |
global glAnCurves | |
try: | |
glAnCurves | |
except: | |
glAnCurves = [] | |
if len( glAnCurves ) >0 : | |
mc.selectionConnection( 'graphEditor1FromOutliner', e=1, clr=1 ) | |
allCh = [ g.rsplit( '.', 1 )[0] for g in glAnCurves ] |