when I tryed it in 3d max I got the error = --Unknown property;"filename"in undefined
in Gmax
-- BRG EXPORTING SCRIPT (version 0.01)
-- for Age of Mythology models
-- by Ykkrosh (ykkrosh@zaynar.demon.co.uk)
--
-- Requires 3ds max
--
-- TO DO:
-- * Make it work in gmax (printing all the data to the Listener window)
-- (if anybody actually uses gmax)
fn BRGExport = (
local time_scale = 2
clearListener()
-- output numbers of faces, verts, and frames, then the list of faces and texture coordinates
at time 0 (
main_mesh = $Animated.mesh
format "**START**\n" to: Listener
format "%~%~%~" main_mesh.numverts main_mesh.numfaces (if animationRange.end == 0 then "0f" else (animationRange.end+1)/time_scale) to: Listener
format "\n{FACES}\n" to: Listener
for f = 1 to main_mesh.numfaces do (
format "%" (getFace main_mesh f) to: Listener
)
format "\n{TVERTS}\n" to: Listener
for v = 1 to main_mesh.numverts do (
format "%~" (getTVert main_mesh v) to: Listener
)
)
-- output the vertices at every keyframe (or frame 0, if it's unanimated)
format "\n{VERTS}\n" to: Listener
for t = 0 to (if animationRange.end == 0 then 0 else (animationRange.end+1)/time_scale-1) do (
at time(t*time_scale) (
main_mesh = $Animated.mesh
for v = 1 to main_mesh.numverts do (
vert = getVert main_mesh v
normal = getNormal main_mesh v
format "% % %/% % %~" vert.x vert.y vert.z normal.x normal.y normal.z to: Listener
)
)
)
-- then the material IDs assigned to each face
format "\n{FMATS}\n" to: Listener
for f = 1 to main_mesh.numfaces do (
format "%~" (getFaceMatID main_mesh f) to: Listener
)
-- and some info on what the materials actually *are* format "\n**END**\n" to: Listener messageBox "Completed" BRGExport()
format "\n{MATS}\n" to: Listener
for m = 1 to $Animated.material.count do (
format "%=%~" m $Animated.material
)
return 0
)
this line was highlighted= format "%=%~" m $Animated.material