[Maya] Get all meshes being rendered in the UV editor

To reproduce the issue:

  • create a mesh (e.g. cone)
  • set selection mode to Component Face
  • open the UV editor
  • select the mesh in the Outliner (so its UV will appear in the UV editor)
  • now press LMB once in the UV editor area in a place outside the UVs of the mesh.

After the last step, the mesh will not be selected in the Outliner but its UVs still will be shown in the UV editor.

Running cms.ls(selection=True) will return nothing. So the object UVs are shown in the UV editor, despite the object not being selected anymore.

The question is: how to detect which meshes are currently rendered in the UV editor using the Maya API?

Thanks!

The object transform is not selected, but the mesh is still hilited. try this:

cmds.ls(hilite=True)
1 Like

Yes, that did the trick. Thank you!

After performing the steps you described, you can see that the Script Editor clearly displays the command being executed: hilite pCone1;

1 Like