Hi all :)

I'm currently learning Python by myself then I'm doing some tutorials on the 
web like this excelent one from Jeremy Ernst:

Building Maya Interfaces with Python: Video Four
http://vimeo.com/44707576

My window works pretty well but I would like to know if it's possible to store 
all Icons and frameLayout alphabetically ?

Here is the part of the code to create Icons :


"""""""""""

def populateIcons():

        IconPath = cmds.internalVar(upd = True) + "icons/m_Tools/"
        
        icons = os.listdir(IconPath)
        
        categories = []
        for icon in icons:
                categoryName = icon.partition("__")[0]
                categories.append(categoryName)
        

        categoryNames = list(set(categories))
        
        for name in categoryNames:
                # Create a frameLayout
                widgets[(name + "_frameLayout")] = cmds.frameLayout(label = 
name, collapsable = True, parent = widgets["mainLayout"])
                widgets[(name + "_mainLayout")] = cmds.rowColumnLayout(nc = 5, 
parent = widgets[(name + "_frameLayout")])
                
        
        for icon in icons:
                niceName = icon.partition(".")[0]
                category = icon.partition("__")[0]
                command = icon.partition("__")[2].partition(".")[0] # 
selectionne le nom apres les "__" et avant le "." de l'extension/ example : 
                
                widgets[(niceName + "_button")] = cmds.symbolButton (w = 40, h 
= 40, image = (IconPath + icon), parent = widgets[(category + "_mainLayout")], 
c = partial(runMethod, command))

"""""""""""

Many thanks !

P.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to