TB1 Week 8
This week we carried on with the pyramid script I started again with the code, and I asked people in my class for help this is the code they subjected to use
import maya.cmds as cmds
def Make_pyramid(height, size):
if size == 'OK':
textl= cmds.promptDialog(query=True, text=True)
print(text1)
i = int(text1)
for x in range(i):
cmds.polyCube(width =i, depth =i)
cmds.move(0, height,0)
height = height+1
i = i-1
def showUI():
myWin = cmds.window(title="summoing Winow", widthHeight=(300, 200))
cmds.columnLayout()
cmds.button( label='Summon Pyraimd', c = "Make_pyramid(1, cmds.promptDialog( title='input cube amount', message='Amount:',button=['OK', 'Cancel'], defaultButton='1',cancelButton='Cancel',dismissString='Cancel',))")
cmds.button( label='Close', command=('cmds.deleteUI(\"' + myWin + '\", window=True)') )
cmds.showWindow(myWinshowUI()
this code works slightly differently then my original script with this code you can set how many cubes the pyramid is with the GUI that is created when you run the script it does this by asking the user for how many cube they want the sets the with a variable "text1" this forms how long the loop will run for, by turning the user input to an integer.
Programming for Animation
Status | In development |
Author | TheWigum |
More posts
- TB1 Week 9Dec 12, 2022
- TB1 Week 7Dec 11, 2022
- TB1 Week 5Dec 11, 2022
- TB1 Week 4Dec 10, 2022
- TB1 Week 3Dec 10, 2022
- TB1 Week 2Oct 10, 2022