private string ImportMaterial(GrnMaterial mat)
{
Maxscript.Command("mat = StandardMaterial()");
Maxscript.Command("mat.name = \"{0}\"", mat.Name);
Maxscript.Command("mat.adLock = false");
Maxscript.Command("mat.useSelfIllumColor = true");
Maxscript.Command("mat.diffuse = color {0} {1} {2}", mat.DiffuseColor.R * 255f, mat.DiffuseColor.G * 255f, mat.DiffuseColor.B * 255f);
Maxscript.Command("mat.ambient = color {0} {1} {2}", mat.AmbientColor.R * 255f, mat.AmbientColor.G * 255f, mat.AmbientColor.B * 255f);
Maxscript.Command("mat.specular = color {0} {1} {2}", mat.SpecularColor.R * 255f, mat.SpecularColor.G * 255f, mat.SpecularColor.B * 255f);
Maxscript.Command("mat.selfIllumColor = color {0} {1} {2}", mat.EmissiveColor.R * 255f, mat.EmissiveColor.G * 255f, mat.EmissiveColor.B * 255f);
Maxscript.Command("mat.opacity = {0}", mat.Opacity * 100f);
Maxscript.Command("mat.specularLevel = {0}", mat.SpecularExponent);
Maxscript.Command("tex = BitmapTexture()");
Maxscript.Command("tex.name = \"{0}\"", mat.DiffuseTexture.Name);
Maxscript.Command("tex.filename = \"{0}\"", Path.GetFileName(mat.DiffuseTexture.FileName));
Maxscript.Command("mat.diffusemap = tex");
return "mat";
}