Alright I'm cranking out Maya scripts left and right. This stuff is COOL. I've made about four or five so far but I'll show you arguably the most useful one.
Most of the time—about 99% of the time, in fact—I model all my assets before moving on to UVing. And yes, I do a lot of copy-pasting when it comes to meshes! But when it’s time to UV all those duplicates, things get tricky. While you can transfer attributes, Maya doesn’t let you apply them to multiple meshes at once. That’s exactly what this script is designed to solve.
This code snippet automates UV transfer from a source mesh to multiple selected target meshes. It uses cmds.transferAttributes to copy only the UVs (not vertex positions, normals, or colors), based on world space and closest-point matching. After the UVs are transferred, it deletes the construction history on each target object to clean up the scene. Deleting history is necessary or it will not work, trust me.
Here I added another simple UI with some no-fail instructions included - free of charge.
This script may seem tiny but it's a MASSIVE time saver when you're in a crunch!
Python to Maya: https://help.autodesk.com/view/MAYAUL/2024/ENU/?guid=GUID-55B63946-CDC9-42E5-9B6E-45EE45CFC7FC
Copilot: Code Debugging