How To Second Uv-set From Material

Hello

I am programming Python in Maya and I need to get the (part of the)mesh from a given material. Like the command "Select Objects from Material" in the hypershape window does. I want to know if a material uses a second uv-set. So if i would have the mesh i could do this?!

mc.select( clear=True )
shaders = mc.ls( type = 'shadingEngine' )
for shader in shaders:

#mesh = get the mesh here!

mc.select( mesh )
uvSets = mc.polyUVSet( query=True, allUVSets=True )
if len(uvSet) >= 1:
    #has second uv set

Or does someone know how to access the relationship editor?
Has anybody a solution?

Greetings Chris

materials don't use UV sets directly...its the file nodes that get associated with the UV sets.
a material can have multiple file nodes feeding into it, and each file node can have its own UV set assignment.

so a material can point to more than one UV set.

you need to get the shape node and any UV Chooser nodes present in the Material's network.