Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
SEVEZ / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Poly Separate
// Copyright (C) 2012 Basenji Games
// Licensed under the MIT license
string $selection[] = `ls -sl`;
sepMat($selection[0]);
global proc sepMat(string $object){
string $shadingGroups[] = getSGsFromShape($object);
string $ParentName = ($object + "_lightMap_Group");
from PySide import QtCore, QtGui
from shiboken import wrapInstance
import maya.OpenMayaUI as mui
mainWin = wrapInstance(long(mui.MQtUtil.mainWindow()), QtGui.QWidget)
action = QtGui.QAction(mainWin)
action.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Tab))
action.setShortcutContext(QtCore.Qt.ApplicationShortcut)
@SEVEZ
SEVEZ / MAYA_findFlippedUVs.py
Created May 10, 2016 20:16 — forked from Onefabis/MAYA_findFlippedUVs.py
[Maya, python] _findFlippedUVs
# -*- coding: utf-8 -*-
import maya.OpenMaya as om
import maya.cmds as cmds
def _findFlippedUVs(nodesOnly=True):
ret = []
selList = om.MSelectionList()
@SEVEZ
SEVEZ / MAYA_findFlippedUVs.py
Created May 11, 2016 18:52 — forked from hmasato/MAYA_findFlippedUVs.py
[Maya, python] _findFlippedUVs
# -*- coding: utf-8 -*-
import maya.OpenMaya as om
import maya.cmds as cmds
def _findFlippedUVs(nodesOnly=True):
ret = []
selList = om.MSelectionList()
@SEVEZ
SEVEZ / softCluster.py
Created May 11, 2016 18:53 — forked from jhoolmans/softCluster.py
Maya create soft cluster
import maya.cmds as mc
import maya.OpenMaya as om
def softSelection():
selection = om.MSelectionList()
softSelection = om.MRichSelection()
om.MGlobal.getRichSelection(softSelection)
softSelection.getSelection(selection)
dagPath = om.MDagPath()
@SEVEZ
SEVEZ / findskin.py
Created May 11, 2016 18:54 — forked from robomojo/findskin.py
find maya skincluster
def findSkinClusters ():
skins = []
shapes = pm.listRelatives(shapes=True, noIntermediate=True)
for shape in shapes:
skinClusters = pm.ls(type=pm.nodetypes.SkinCluster)
for skin in skinClusters:
mesh = pm.skinCluster(skin, q=True, g=True)
if mesh[0] == shape:
relatedSkinCluster = sc
skins.append(skin)
@SEVEZ
SEVEZ / unsmoothMesh.py
Created May 11, 2016 18:55 — forked from kanishk2391/unsmoothMesh.py
Reconstruct Subdiv for Maya
#---------Reconstruct Subdiv Script for Maya----------
#Script by - Kanishk Chouhan
#Email - kanishk2391@gmail.com
#Blog - www.pixel-architect.blogspot.com
#Description -
#This script allows u to reverse the result of smooth operation in maya after deleting the history
#It also preserves the original UV of the mesh
#Select the mesh u want to unsmooth and execute the script
#Script might take some time to execute depending on the polycount...
@SEVEZ
SEVEZ / hotkeys.py
Created May 11, 2016 18:58 — forked from danbradham/hotkeys.py
Autodesk Maya hotkeys with Python
import maya.cmds as cmds
import maya.mel as mel
from maya.utils import executeDeferred
from functools import wraps
import re
def defer(fn):
'''Delays execution of the decorated function until Maya is available.'''
@wraps(fn)
@SEVEZ
SEVEZ / object_under_cursor.py
Created May 11, 2016 19:01 — forked from mottosso/object_under_cursor.py
Get object under cursor - Autodesk Maya
"""Illustration of how to retrieve the shape under the mouse cursor
Usage:
Run `start()` to start listening for when the mouse stops and to display a tooltip
Run `stop()` to stop listening
"""
from PySide import QtGui, QtCore