Jump to content
  • Advertisement
Sign in to follow this  
NestorPL

MAXscript output.

This topic is 5098 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone. Im writing a little exporter for my own engine, but i've stumbled upon a little obstacle. I cant output the texture mapping. For some strange reason the already mapped object cannot be written to file with texture mappings because maxscript says that .numtverts is 'undefined', thus i cant obtain the uv mapping on vertices, and cant build texture faces. I found some meshops in the maxscript reference about bulding the default mapping mesh, but that doesnt help either. Thanks for any constructive help. Here's the code: MacroScript ExportMesh3 category:"HowTo" ( fn GetGeometry o = ( Superclassof o == Geometryclass and classof o != TargetObject ) obj = pickobject if isValidNode obj then ( tmesh = snapshotAsMesh obj out_name = GetSaveFileName() if out_name != undefined then ( out_file = createfile out_name num_verts = tmesh.numverts num_faces = tmesh.numfaces meshop.DefaultMapFaces tmesh 1 num_faces num_tverts = meshop.getNumTVerts tmesh num_tvfaces = tmesh.numtvfaces format "verts/normal here : \n" to:out_file format "%,%,%,%\n" num_verts num_faces num_tverts num_tvfaces to:out_file for v = 1 to num_verts do ( format "%," (getVert tmesh v) to:out_file format "\n" to:out_file format "%," (getNormal tmesh v) to:out_file format "\n" to:out_file ) format "tverts here : \n" to:out_file for v = 1 to num_tverts do ( -- error below this line (numverts is 'undefined') --- format "%," (getTVert tmesh v) to:out_file format "\n" to:out_file ) for f = 1 to num_faces do ( face = getFace tmesh f tvface = getTVFace tmesh f matid = getFaceMatId tmesh f format "%,%\n" face matid to:out_file ) format "tverts here : \n" to:out_file for f = 1 to num_tvfaces do ( tvface = getTVFace tmesh f matid = getFaceMatId tmesh f format "%,%,%,%,%,%\n" face matid to:out_file ) close out_file edit out_name ) ) )

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!