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
''' | |
FBXWrapper | |
This module provides a python wrapper for every method exposed in the FBX plugin. | |
The arguments for the calls are the same as for the equivalent mel calls, however they can be passed with typical | |
python syntax, which is translated to mel-style flags and arguments under the hood. The actual flags and arguments | |
are documented here: | |
usage: |
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 edgeLord | |
#edgeLord.run() | |
def run(): | |
#get selected edgeloop | |
edgeLoop = cmds.ls(selection=True) | |
#get verticles in the edge loop | |
vertLoop = cmds.polyListComponentConversion(edgeLoop, fromEdge=True, toVertex=True) |
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
# Mirror transform | |
from maya import cmds | |
def mirror_transforms(nodes): | |
"""Mirror transforms `nodes` across the YZ axis | |
Arguments: | |
nodes (list): Transforms to be mirrored |
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 -*- | |
## last updated:<2013/12/06 11:57:06> | |
## Megumi Ando | |
#MayaModlue-----------------------------------## | |
import pymel.core as pm | |
import pymel.util as pmUtil | |
import maya.mel as mm | |
#----------------------------------------------# | |
import os.path |
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: Webber Huang | |
# E-mail: [email protected] | |
# Website: http://riggingtd.com | |
# Purpose: Find the closest edge on mesh from any position | |
# Created: 2014/6/17 | |
#======================================================================== | |
import heapq | |
import maya.cmds as cmds |
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 pymel.core as pm | |
def is_mesh(trans): | |
if type(trans.getShape()) == pm.nodetypes.Mesh: | |
return True | |
return False |
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.mel | |
import pymel.core as pm | |
def beginDrag(*args): | |
mods = pm.getModifiers() | |
update = pm.timeControl( aPlayBackSliderPython, query=True, globalTime=True) | |
print update | |
if (mods & 1) > 0: print ' Shift' | |
if (mods & 2) > 0: print ' CapsLock' | |
if (mods & 4) > 0: print ' Ctrl' |
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 om | |
import pymel.core as pm | |
def intersect_mesh(pos, vec, mesh_name): | |
selectionList = om.MSelectionList() | |
selectionList.add(mesh_name) | |
dagPath = selectionList.getDagPath(0) | |
fnMesh = om.MFnMesh(dagPath) |
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 Dicer(xmany, ymany, zmany): | |
cs = cmds.ls(sl=True) | |
cpc = cmds.objectCenter(cs, gl=True) | |
cpcx = cpc[0] | |
cpcy = cpc[1] | |
cpcz = cpc[2] | |