source: OGRE/trunk/ogrenew/Tools/3dsmaxExport/scripts/ogre/lib/OgreSkeletonLib_mtlfns.ms @ 657

Revision 657, 1000 bytes checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1function writeMaterial material outFile =
2(
3        local t, matname, mat;
4
5        mat = material ;
6       
7        if (mat != undefined) then
8        (
9                matname = material.name ;       
10                format "3ds/%\n" matname to:outFile ;
11                format "{\n" ;
12        format("   ambient % % %\n") (mat.ambient.r/255.0) (mat.ambient.g/255.0) (mat.ambient.b/255.0) to:outFile ;
13            format("   diffuse % % %\n") (mat.diffuse.r/255.0) (mat.diffuse.g/255.0) (mat.diffuse.b/255.0) to:outFile ;
14        format("   specular % % % %\n") (mat.specular.r/255.0) (mat.specular.g/255.0) (mat.specularLevel*100.0) to:outFile ;
15                format("   emissive % % % %\n") (mat.selfIllumColor.r/255.0) (mat.selfIllumColor.g/255.0) (mat.selfIllumColor.b/255.0) (mat.selfIllumAmount) to:outFile ;
16               
17            -- if mesh has a material: reading the diffuse map:
18                if ((mat.diffusemap != undefined) and (iskindof mat.diffusemap Bitmaptexture)) then
19                (       
20                        t = filterstring mat.diffusemap.filename "\\" ;
21                        format "{\n  texture % \n}" t[arrayLength t] to:outFile ;
22                )
23                format "}\n" ;
24        )
25)
Note: See TracBrowser for help on using the repository browser.