Maya UV dag path with UV Set?

I’m looking to store the UV ids of a specific UV Set into a MSelectionList. I thought I could just do it through a text dag path, but I’m running into the issue when there’s multiple UV sets on a mesh. Is there a format for UV dag paths that can specify the UV set as well?

UV sets in maya are extra data associated with a shape node (or MFnMesh) - getting to that node is as far as MDagPath can take you. I believe the echoed selection paths in the script editor just work on whichever is set as the current uv set for editing.
You’ll need to query MFnMesh.currentUVSetName() and store that - either you can take over the full operation in python, or you could set the current name to the stored value before doing your dag access, since it will default to the new current one.

1 Like