Guest User

Untitled

a guest
Aug 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import maya.cmds as cmds
  2. import os
  3. from os import listdir
  4.  
  5. def UI(*args):
  6.  
  7. if cmds.window("Test", exists = True):
  8. cmds.deleteUI("Test")
  9. mainwindow = cmds.window("Test", t="Test Window", sizeable = 1)
  10.  
  11. cmds.scrollLayout('srcoll', p = "Test")
  12. cmds.rowColumnLayout("ColLayout", p = "Test", nc = 3)#I imagine the "nc" command is probably useless here, I am just leaving it for testing purposes
  13.  
  14. cmds.showWindow("Test")
  15.  
  16. customPath = "C:Users$username$Desktop"
  17. customPathItems = listdir(customPath)
  18.  
  19.  
  20. def popUI(*args):
  21. for item in customPathItems:
  22. if item.endswith("_icon.png"):
  23. cmds.iconTextButton(l = item, p = "ColLayout", i = customPath + "/" + item, w = 128, h = 128)
  24.  
  25.  
  26. def buildUI(*args):
  27. UI()
  28. popUI()
  29.  
  30. buildUI()
Add Comment
Please, Sign In to add comment