About MatSaver
Building on the tip TVeyes posted a few days ago, here is a ZScript quickie that lets you save your custom materials for later reloading. The handy thing about it is that you save them all in one process.
Here’s how it works.
Whenever you save a DOCUMENT, it stores Pixol information including color, material and Z-depth. If a pixol uses custom materials, the DOCUMENT actually embeds the complete description of all those materials in the file. If you save your work as a DOCUMENT, you preserve the custom materials, but you also save all the other info which can end up being a big file.
What MatSaver.txt does is first check the materials actually being used courtesy of the nifty little routine TVeyes gave us. Then it creates a table of spheres consisting of only those materials that were found.
After MatSaver is finished, the sphere table index with labels can be SAVED AS a DOCUMENT.
Later, in another work session you can restore all the custom materials IN THEIR CORRECT SLOTS at once, by simply reloading the DOCUMENT. Then load your models and textures and proceed with modeling where you left off.
One Warning:
Before creating the table, the canvas is resized and erased, so whatever is on the canvas when you run MatSaver WILL BE LOST. Therefore, only run MatSaver after everything else is saved and you are ready to save your custom materials. When you run MatSaver, you are warned about the loss and must press YES to proceed.
Please, PLEASE EXPERIMENT WITH IT A FEW TIMES BEFORE YOU USE IT ON ANY SERIOUS PROJECT!
Feel free to modify the script and post improvements - I did this version quick and dirty.
To use, unzip matsaver.txt and 76materials.jpg into the same folder.
Sven
ps. Aminuts: I thought you might find this interesting, too.
…