Created
June 13, 2014 20:15
-
-
Save gregtemp/a82292dff87c7348dc28 to your computer and use it in GitHub Desktop.
Level of detail demo - maya python pymel
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 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') | |
sphereList = list() | |
sphereList = cmds.ls('pSphere*') | |
if len(sphereList) > 0: | |
cmds.delete(sphereList) | |
else: | |
print('no spheres to unsphere') | |
cmds.polySphere(r=1, sx=20, sy=20, ax=(0,1,0), cuv=2, ch=1) | |
cmds.polySphere(r=1, sx=7, sy=7, ax=(0,1,0), cuv=2, ch=1) | |
cmds.polySphere(r=1, sx=5, sy=5, ax=(0,1,0), cuv=2, ch=1) | |
cmds.polySphere(r=1, sx=3, sy=3, ax=(0,1,0), cuv=2, ch=1) | |
cmds.select('pSphere1', 'pSphere2', 'pSphere3', 'pSphere4',r=True) | |
pm.LevelOfDetailGroup() | |
for i in range (0, 3): | |
myThr = (i+1)*10 | |
st = 'lodGroup1.threshold[%i]' %(i) | |
cmds.setAttr(st, myThr) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment