jeffwincek Oct 5th, 2011 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # select one object
- # This object will sub-divide the object in the X and Z directions so that
- # there are divisions approximately as often as the object is tall.
- # requires import maya.cmds as plg
- whichOne= plg.ls(selection = True)
- active = plg.polyEvaluate(whichOne, boundingBox = True)
- sizeX = active - active
- sizeY = active - active
- sizeZ = active - active
- hardPart = ''
- largerFactor = howMuch - 1
- if sizeX > sizeY:
- largerFactor = float(sizeX/sizeY)
- hardPart += ', sx = ' + str(largerFactor)
- if sizeZ > sizeY:
- largerFactor = float(sizeZ/sizeY)
- hardPart += ', sz = ' + str(largerFactor)
- if largerFactor > howMuch:
- print 'true'
- thingsToCall = "plg.polyCube(\'" + whichOne + "\', e=True " + hardPart + ")"
- print thingsToCall
- print 'false'
RAW Paste Data