Using pymel...
import pymel.core as pm
texture_types = ['.tga']
used_files = []
for file_node in pm.ls(type='file') :
for texture_type in texture_types :
file_path = file_node.fileTextureName.get()
if texture_type in file_path :
used_files.append(file_path)
continue
print used_files
or using cmds...
import maya.cmds as cmds
texture_types = ['.tga']
used_files = []
for file_node in cmds.ls(type='file') :
for texture_type in texture_types :
file_path = cmds.getAttr(file_node + ".fileTextureName")
if texture_type in file_path :
used_files.append(file_path)
continue
print used_files
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kinjal gajera
Sent: 27 March 2012 14:14
To: python_inside_maya
Subject: [Maya-Python] Re:- Generating texture list by python
Hi TEAM
Please note
I have one cg maya 2011 file,having various texture.
my task is to create a script through python,by we can get the complete used
texture list in maya file.
Expecting positive reply..
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe