Advertisement
Hdotofwgkta

uI

May 23rd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. import maya.cmds as cmds
  2.  
  3. #class
  4. class HP_BuildingGenerator(object):
  5.  
  6. #constructor function
  7. def __init__(self):
  8. self.window = 'BuildingWindow'
  9. self.title = 'Building Generator'
  10. self.size = (600, 350)
  11. self.createWindow()
  12.  
  13. #create window function
  14. def createWindow(self):
  15.  
  16. if cmds.window(self.window, exists=True):
  17. cmds.deleteUI(self.window, window=True)
  18.  
  19. self.window = cmds.window(self.window, title=self.title, widthHeight=self.size)
  20.  
  21. # define window UI
  22. self.mainForm = cmds.formLayout(numberOfDivisions = 100);
  23.  
  24. self.titleDisplay = cmds.text(label = self.title, align="center", font='boldLabelFont')
  25. cmds.formLayout(self.mainForm, edit=True, attachForm=( [self.titleDisplay, 'top', 5],
  26. [self.titleDisplay, 'left', 5],
  27. [self.titleDisplay, 'right', 5] ))
  28.  
  29.  
  30. self.titleSeperator = cmds.separator();
  31. cmds.formLayout(self.mainForm, edit=True, attachControl=[self.titleSeperator, 'top', 10, self.titleDisplay],
  32. attachForm=([self.titleSeperator, 'left', 5],
  33. [self.titleSeperator, 'right', 5] ))
  34. cmds.showWindow();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement