After fishing around it seemed like I was overthinking the problem and looking at the wrong thing. I could have / should have done this:
colorSets = pm.polyColorSet((obj), query=True, allColorSets=True) for i in range (len(colorSets)): which behaves similiarly to: UVsets = pm.polyUVSet(obj, query=True, allUVSetsIndices=True) for i in UVsets[:] Don't I feel dumb :/ On Tuesday, August 11, 2015 at 4:41:47 PM UTC-7, Farhan Noor wrote: > > Heya, > > I recently made a cleanup script that would go through a bunch of specific > things including UVsets and colorsets and remove any extraneous ones on > selected meshes. > > While I wrote a working function to check / remove colorsets, can't help > but feel there was a better way. > > With UVsets I can get a list [0,1,2,3, etc] returned with > pm.polyUVSet(obj, query=True, allUVSetsIndices=True) and then iterate > through each one. > > I ended up using a while loop along with try/except to iterate through all > existing colorsets on a mesh, which works but feels kinda messy compared to > what I had to do for UVsets. > > Is there an equivalent of allUVSetsIndices for pm.polyColorSet? I couldn't > seem to find any in the pymel documentation and I feel like I'm missing out > on something obvious here. > > > > -- 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/f0545bbc-64c9-485e-8cb1-8e59e62f658b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
