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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |