modify tmh script to output wavefront mtl file
rewrite pmo script for better compatability