Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


How to get MaterialiD in MaxScript

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

Hello everybody. Im making and Exporter Script in MAX5 and I get all the geometry correctly, the UV of all the vertex and the textures used in the scene. But know i would like to know how to get the material im using in a specified triangle. I tried GetFaceMatID, but I get a diferent number for every two triangles I pick. Any idea?.

Share this post

Link to post
Share on other sites
Right, took me ages to figure this out and I hope it works properly in MAXScript (this was for the SDK).

Each individual mesh object has 1 material associated with it. If the material is a multimaterial (as opposed to a standard) then the GetFaceMatID will index into the list of sub-materials in the multimaterial. If the material is standard then the MatID''s don''t relate to texturing.

Now obviously it depends on how you constructed the mesh, max tends to allocate material ids based on orientation so you''ll need to go through the mesh and take a look at which faces are which material (if using a multi-material, otherwise don''t worry about it).

Share this post

Link to post
Share on other sites

  • 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!