This file contains 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 |
This file contains 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
// 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"); |
This file contains 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
''' | |
Align pivots by Serge Scherbakov. | |
Usage: | |
1. Select source object(s) | |
2. Add to selection target object | |
3. Run script by 'import copyPivot\n copyPivot.copyPivot() | |
''' | |
import maya.cmds as cmds | |
import maya.mel as mel |
This file contains 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
''' [Crease To Normal] | |
Created on 23.07.2012 | |
edgeCreaser - uses edge Crease info to make it hard edge, or use Hard edge info to make edge crease. | |
@author: Serge Scherbakov | |
''' | |
import maya.cmds as cmds | |
class edgeCreaser(): | |
@staticmethod | |
def apply(mode = 'c2n'): |
This file contains 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 math | |
import maya.api.OpenMaya as om | |
from pymel.core import * | |
from pymel.core.datatypes import * | |
def createBoundingCircle(meshfn): | |
"""Parameter: meshfn - MFnMesh | |
Represent a face by a center and radius, i.e. | |
center = [center1u, center1v, center2u, center2v, ... ] | |
radius = [radius1, radius2, ... ] |
This file contains 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 * | |
sel = ls( selected(), fl=1 ) | |
aCe = [] | |
while len( sel ): | |
ce = [] | |
for e in sel: | |
if ce == []: ce.append( e ) | |
else: |
This file contains 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 as mel | |
import maya.OpenMayaUI as omui | |
from PySide.QtGui import * | |
from PySide.QtCore import * | |
from shiboken import wrapInstance as wrap | |
qMaya = wrap(long(omui.MQtUtil.mainWindow()), QMainWindow) | |
# find chennelbox | |
gChannelBoxName = mel.eval('$temp=$gChannelBoxName') | |
table = qMaya.findChild(QTableView, gChannelBoxName) |
This file contains 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
exec( 'global %s' % 'food' ) | |
vars()['food'] = 0 | |
print( vars()['food'] ) |
This file contains 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 pymel.core as pm | |
import maya.api.OpenMaya as om | |
import maya.api.OpenMayaUI as omui | |
class SamsClass(): | |
def __init__(self): | |
pass |
This file contains 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.api.OpenMaya as om | |
import maya.api.OpenMayaUI as omui | |
class SamsClass(): | |
def __init__(self): | |
pass |
OlderNewer