I have been working with the materials script to export materials to a .a8s file.
http://homepage.ntlworld.com/w.watson3/main/files/export_materialv1.a8sI notice that when I import my exported script, it imports them to the object tab (rather than the file tab) of the material editor.
I would prefer my palet to be global so that I can import it once and use it for any object.
So, when I export my materials in the "File" tab, I don't get any material, but, I do if it's attached to the object tab.
Her's what I get.
<code>
/* basic Material script for Anim8or 0.97d beta
*/
object $obj;
material $mat;
$obj = project.curObject;
$mat = $obj.NewMaterial ( "Gold");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.957 , 0.831 , 0.498 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.957 , 0.831 , 0.498 ));
$mat.Kd = 1.000;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.500;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 3.00;
$mat.brilliance = 10.000;
$mat.alpha = 1.00;
$mat = $obj.NewMaterial ( "Brass");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.929 , 0.725 , 0.192 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.929 , 0.725 , 0.192 ));
$mat.Kd = 1.000;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.500;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 3.00;
$mat.brilliance = 10.000;
$mat.alpha = 1.00;
$mat = $obj.NewMaterial ( "Copper");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.875 , 0.353 , 0.129 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.875 , 0.353 , 0.129 ));
$mat.Kd = 0.700;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.600;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 0.60;
$mat.brilliance = 1.800;
$mat.alpha = 1.00;
$mat = $obj.NewMaterial ( "Silver");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.714 , 0.714 , 0.8 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.714 , 0.714 , 0.8 ));
$mat.Kd = 1.000;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.500;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 3.00;
$mat.brilliance = 6.000;
$mat.alpha = 1.00;
$mat = $obj.NewMaterial ( "Steel");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.878 , 0.878 , 0.878 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.878 , 0.878 , 0.878 ));
$mat.Kd = 0.700;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.400;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 8.00;
$mat.brilliance = 2.000;
$mat.alpha = 1.00;
$mat = $obj.NewMaterial ( "Alien Green");
$mat.LockAmbiantDiffuse = 0;
$mat.SetAmbiantColor ((0.00392 , 0.408 , 0.00392 ));
$mat.Ka = 0.300;
$mat.SetDiffuseColor ((0.0118 , 0.851 , 0.0118 ));
$mat.Kd = 0.700;
$mat.SetSpecularColor ((1 , 1 , 1 ));
$mat.Ks = 0.400;
$mat.SetEmissiveColor ((0 , 0 , 0 ));
$mat.Ke = 0.000;
$mat.roughness = 3.00;
$mat.brilliance = 10.000;
$mat.alpha = 1.00;
</code>
Is there anything I can change in this to get it to send to the file tab in the script editor? I tried changing the first line "object $obj;" to read "file $obj;"
I am assuming that $obj is a variable and this line would be like saying $obj = object;
Thanks
Sage