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 | |
#cube = cmds.polyCube(h=5, w=5, d=5) | |
#cubeName = cube[0] | |
#cmds.setAttr(cubeName + '.translateX', 5) | |
#cmds.setAttr(cubeName + '.translateY', 5) | |
#cmds.setAttr(cubeName + '.translateZ', 5) | |
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
# STILL NOT QUITE THERE YET | |
import maya.cmds as cmds | |
#cube = cmds.polyCube(h=5, w=5, d=5) | |
#cubeName = cube[0] | |
#cmds.setAttr(cubeName + '.translateX', 5) | |
#cmds.setAttr(cubeName + '.translateY', 5) | |
#cmds.setAttr(cubeName + '.translateZ', 5) |
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
# 1. Select the object you want to randomly extrude | |
# or use the "Make eCube" button to make one. | |
# 2. Press Check Selection. | |
# 3. Select the amount of random extrusion loops | |
# you would like to make and click Random Extrude | |
# 4. Click Keyframe to key the current frame for all | |
# vertices | |
import maya.cmds as cmds | |
import random |
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
# 1. Select the object you want to randomly extrude | |
# or use the "Make eCube" button to make one. | |
# 2. Press Check Selection. | |
# 3. Select the amount of random extrusion loops | |
# you would like to make and click Random Extrude | |
# 4. Click Keyframe to key the current frame for all | |
# vertices | |
import maya.cmds as cmds | |
import random |
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 | |
class FlckUi(): | |
def __init__(self): | |
flckUi = 'flckUi' | |
if cmds.window(flckUi, exists=True): | |
cmds.deleteUI(flckUi) | |
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 here - http://stackoverflow.com/questions/12309634/maya-python-how-to-close-a-custom-ui-window-after-the-user-has-pressed-enter | |
import maya.utils # you need this line! | |
class ReUI(): | |
def __init__(self): | |
renUI = 'renUI' | |
if cmds.window(renUI, exists = True): | |
cmds.deleteUI(renUI) |
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
# Boids Simulation | |
# Basic outline of the functionality of the boid simulation | |
# This example does not include the user interface and is | |
# stripped back to it's core functionality for documentation | |
# purposes. | |
import maya.cmds as cmds | |
import random | |
from maya.OpenMaya import MVector |
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 pymel.core.runtime as pm | |
import maya.cmds as cmds | |
# Needs a series of crow models with progressively smaller level of detail | |
# Check if there is already a LevelOfDetail group (for testing reasons) | |
lodList = list() | |
lodList = cmds.ls('lodGroup*') | |
if len(lodList) > 0: | |
cmds.select('lodGroup1') |
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 pymel.core.runtime as pm | |
import maya.cmds as cmds | |
lodList = list() | |
lodList = cmds.ls('lodGroup*') | |
if len(lodList) > 0: | |
cmds.select('lodGroup1') | |
pm.LevelOfDetailUngroup() | |
else: | |
print('no group to ungroup') |
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
Pymel documentation | |
http://download.autodesk.com/us/maya/2011help/PyMel/genindex.html | |
Level of Detail instancing work around: | |
http://mayastation.typepad.com/maya-station/2010/05/instance-your-lod-groups.html |