Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
SEVEZ / FBX Wrapper.py
Last active September 5, 2017 14:59 — forked from theodox/FBX Wrapper.py
FBXWrapper #starred
'''
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:
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)
@SEVEZ
SEVEZ / createMenu.py
Created May 11, 2016 20:40
Windowにメニューとツールバーを追加するサンプル
## -*- coding: utf-8 -*-
import sys
from PySide import QtCore, QtGui
from PySide.QtUiTools import QUiLoader
import remitools.lib.qt as remiQt
"""
iconの読み込み。
QtDesignerで、Iconを読み込んで、リソースファイルを作成する(qrcファイル)
# Mirror transform
from maya import cmds
def mirror_transforms(nodes):
"""Mirror transforms `nodes` across the YZ axis
Arguments:
nodes (list): Transforms to be mirrored
@SEVEZ
SEVEZ / floatingShelf.py
Last active September 5, 2017 15:00
Floating shelf #starred
## -*- 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
@SEVEZ
SEVEZ / closestEdgeOnMesh.py
Last active September 7, 2017 17:48 — forked from WebberHuang/closestEdgeOnMesh.py
find the closest edge on mesh from any position #Util
#!/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
@SEVEZ
SEVEZ / fitvertex.py
Created May 11, 2016 20:32 — forked from nrtkbb/fitvertex.py
OpenMaya版 2つのメッシュのバーテックスから、それぞれ一番近いやつを検索してきてフィットさせるやつ
# -*- 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
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'
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)
@SEVEZ
SEVEZ / dicer.py
Created May 11, 2016 20:15 — forked from lapaev/dicer.py
Dice It script for maya
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]