Jump to content
  • Advertisement
Sign in to follow this  
stu_pidd_cow

Max Script Exporter

This topic is 2901 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

I'm trying to make a simple exporter in 3ds max 2009 with max script. To plug the data into my d3d engine, I need to have the normal and texture UV for each vertex, though 3ds max seems to only have a normal and texture UV for each index (or face). So I'm wondering if anyone has gotten around this before and if you could show me a tutorial/example of how I can convert it.


BTW my version of 3DS Max does not come with the API, so that is not an option.

Cheers.

Share this post


Link to post
Share on other sites
Advertisement
Having done an exporter using plugins with visual studio, im pretty sure that 3ds max dosen't export normals data. That being said, i had to add some code to generate them, then export them in my game, so you might have to do it yourself, either in the exporter script or generate them on the fly while importing.

Good Luck!

Share this post


Link to post
Share on other sites
-- this works on editableMeshes
-- for editablePolys look for 'polyop' documentation in MAXScript Reference

obj = $

nFaces = getNumFaces obj
for f = 1 to nFaces do
(
fc = getFace obj f -- returns array of vertex indicies #(0,2,3)
for v = 1 to 3 do
(
vOn = fc[v] as integer -- current vertex
p = getVert obj vOn -- returns world vertex position
n = getNormal obj vOn -- returns world vertex normal
uv = meshop.getMapVert obj 1 vOn -- return UV coord for vertex from mapChannel 1

format "F:% V:% % % %\n" f vOn p n uv
)
)

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!