In order not to flood the user manual with technical explanations, this page is specifically dedicated to practical examples and what to expect of AutoMAT's name matching.

What does AutoMAT actually look for?

Toolbag stores texture sets information as "Submeshes". They represent the parts of the model to which different Materials are assigned, and basically match your assigned materials.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/56c6fb54-583f-42a3-8926-15ae8ed04d22/asd.png

The only thing AutoMAT cares about is the Submesh names: everything else in the model is pretty much irrelevant. In fact, to avoid confusion, the plugin reads the assigned Material from each Submesh, and sneakily renames the former in case names aren't matching. (This actually happens only after you select a preset).

What is $textureSet?

To perform texture matching on multiple materials at once, AutoMAT needs to know the name of said materials; then, for each image file in the given folder, it looks at each filename and see if something lines up.

$textureSet is just a special term that reads all the submeshes names one by one. Basically, it's a placeholder name that becomes the name of each submesh in the scene, as the plugin processes all the files in the folder and looks for matches.

A simplified view of what happens. $textureSet becomes the current Submesh name and looks in the folder. Each matching cluster is the assigned to the proper material.

A simplified view of what happens. $textureSet becomes the current Submesh name and looks in the folder. Each matching cluster is the assigned to the proper material.

What happens when you DON'T use $textureSet, then? Well, the plugin ignores the Submesh names, and searches straight for matching images. The problem however, is that you're likely to end up with something like this: