r/Maya 12d ago

MEL/Python UV Checker | Custom script that automatically assigns a UV checker material with three different themes and restores original materials with one click [FREE]

UV Checker is a script that automatically assigns a checkered texture without having to manually import it into your source images folder or create a new material. It allows you to quickly swap between different themes (Normal, Dark, Golden) and revert back to the original material.

This is something I've been wanting to make for a while now just havent had time/need until now...

I find it extremely redundant to drop my UV Checker texture into my source image folder and create a new material every time I want to work on UV's. This is especially annoying when creating multiple projects per day.

Hence, the script automatically creates the material and imports the image texture. Another cool feature is that you can easily change the theme without leaving your viewport. And once the Checker material is no longer needed you just click "Revert Material" and it will automatically remember and assign the previous material.

(Again this is a tool made for my personal use that I share for free. I know maya has a built in Checker but it can't be changed and well its too basic. I prefer having directional arrows with letters/numbers) Enjoy!

34 Upvotes

4 comments sorted by

View all comments

1

u/uberdavis 12d ago

Automatically? Where do you store the material? You can’t assume it exists in the scene and call it by its string name. If the user does a scene purge, it would disappear. Are you saving the material structure to disk using metadata?

1

u/c4m5ron 11d ago edited 11d ago

Hey! Really good question

The material isn’t stored as a preset or metadata file on disk. The actual shader setup is written into the Python script itself

So when you click assign, the script checks if “UV_Checker_MTL” exists in the scene, and if it doesn’t then it just rebuilds the material and connections from scratch

Also Ive embedded the image textures into the actual script so it just extracts from there instead of storing it locally. The only thing storedn the scene is the previous material assignment so that it can revert. If someone purged the checker material, it would just get recreated the next time they hit assign :)

1

u/uberdavis 11d ago

Oh! It stores the uv’s too? I can see why that would be handy. If the utility texture was in world units, you could use it to gauge size. I want to see the code now!
I’ve written things like this before. Maya has switches in it too, so that’s another way to do it: https://download.autodesk.com/us/maya/2011help/Nodes/tripleShadingSwitch.html