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 pc | |
pann = pc.getPanel(wf=1) | |
if (pann == 'graphEditor1'): | |
fsfr = pc.findKeyframe(ts=1, w='first') | |
lsfr = pc.findKeyframe(ts=1, w='last') | |
graphEditorSelection = pc.selectionConnection('graphEditor1FromOutliner',q=1,obj=1) | |
st = pc.playbackOptions(q=1,minTime=1) | |
en = pc.playbackOptions(q=1,maxTime=1) | |
if (fsfr>st): | |
st=fsfr |
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 pc | |
pann = pc.getPanel(wf=1) | |
if (pann == 'graphEditor1'): | |
fsfr = pc.findKeyframe(ts=1, w='first') | |
lsfr = pc.findKeyframe(ts=1, w='last') | |
graphEditorSelection = pc.selectionConnection('graphEditor1FromOutliner',q=1,obj=1) | |
pc.selectKey(clear=1) | |
pc.selectKey(graphEditorSelection,add=1,k=1,t=(str(fsfr) + ":" + str(lsfr))) | |
elif(pann == 'hyperGraphPanel1' or pann == 'hyperGraphPanel2'): | |
pc.hyperGraph(pann+'HyperGraphEd',e=1,fg=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
class MayaRefParser(object): | |
''' | |
This parses .ma file and get refrenced files info, store them in itself | |
''' | |
def __init__(self , maFile=None): | |
self.header = '' | |
self.refHeader = '' | |
self.otherHeader = '' | |
self.contents = '' | |
self.contentsLineNum = 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
import maya.cmds as mc | |
window = mc.window(title="Joint Hierarchy Renamer", widthHeight=(500, 55)) | |
mc.columnLayout(adjustableColumn=True) | |
mc.text(label="Instructions: select top of joint hierarchy") | |
textField = mc.textFieldButtonGrp(label="New name prefix:", buttonLabel="Rename", buttonCommand="rename_joints()") | |
mc.showWindow(window) | |
def rename_joints(): |
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 | |
from pymel.core import * | |
from pymel.core.datatypes import * | |
import maya.OpenMaya as om | |
import maya.OpenMayaUI as omui | |
class SamsClass(): | |
ctx = cmds.currentCtx() | |
cto = cmds.contextInfo(ctx,c=1) | |
print cto |
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 pymel.all import * | |
import maya.mel as mel | |
import maya.OpenMaya as om | |
''' | |
def makeUnique( lst ): | |
result = list() | |
map( lambda x: not x in result and result.append(x), lst ) | |
return result |
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
# -*- coding: utf-8 -*- | |
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
def _findFlippedUVs(nodesOnly=True): | |
ret = [] | |
selList = om.MSelectionList() |
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
global proc string[] NinjaUV_CollectShells() | |
{ | |
PolySelectConvert 4; | |
$Selection =`ls -sl -fl`; | |
string $UVs[] = `ls -sl -fl`;//base uv's | |
string $Test_UVs[] = `ls -sl -fl` ; | |
string $Shell[]; | |
string $Shell_string; | |
string $Shell_array[]; | |
for ($s = 0; $s < `size $UVs`; $s++) |
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
layers = cmds.ls( type='displayLayer') | |
global chLayViz | |
#Checks if 'chLayViz' variable exists and if not - assign 'None' | |
try: | |
chLayViz | |
except NameError: | |
chLayViz = None | |
# Assign toggle value to 'chLayViz' var |
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 re | |
import maya.mel as mel | |
def MSpress(): | |
global initTS | |
initTS = cmds.timerX() | |
def MSrelease(): | |
global initTS |
OlderNewer