>
> This is what I have so far:
import maya.cmds as cmds
from os import listdir
class Material_library():
def __init__(self):
UI=cmds.window(title="Material Library", widthHeight =(300,150),
s=True)
cmds.rowColumnLayout(numberOfColumns = 1)
cmds.button(label= "Select texture folder", command=
self.select_folder)
cmds.separator(h=20)
cmds.showWindow()
def select_folder(self, *args):
myFilter= "Image Files (*.jpg *.jpeg *.tga *.png *.tiff *.bmp
*.psd)"
self.myDirectory = cmds.fileDialog2(fileFilter=myFilter,
dialogStyle=1, fm=3)
myFiles= listdir(self.myDirectory[0])
for textures in myFiles:
fileEndings =
('.psd','.PSD','.jpg','JPG','.jpeg','.JPEG','.tga','.TGA','.png','.PNG','.tiff','.TIFF','.bmp','.BMP')
if textures.endswith(fileEndings):
myTexture = textures
shader=cmds.shadingNode("AiStandardSurface",asShader=True)
else:
cmds.warning(textures + 'This is not a valid image type')
print myFiles
Material_library()
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/f97b1d99-59e8-4f7b-8879-9750cdaa1ccd%40googlegroups.com.