import win32com
xsi = Application

matColl =  win32com.client.Dispatch( "XSI.Collection" )
matColl.AddItems (xsi.Selection)

for eachMat in matColl:
    if eachMat.UsedBy.Count == 0:
        print eachMat.UsedBy.Count
        matColl.RemoveItems (eachMat)

xsi.SelectObj (matColl)
matColl.RemoveAll()

From: [email protected]
To: [email protected]
Subject: RE: Py: Testing if shader is assigned
Date: Tue, 15 Apr 2014 11:52:56 +0000




http://xsisupport.com/tag/materials/

From: [email protected]
Date: Tue, 15 Apr 2014 13:47:46 +0200
Subject: Py: Testing if shader is assigned
To: [email protected]

Hi guys, heres a quick one.

I have all my materials in a selection, is there a way to iterate the selection 
and test if the material is assigned to anything and drop it if its not?



Thanks in advance.
                                                                                
  

Reply via email to