Get Used Material ID List from EditablePoly without face check
Hello,
Everybody on other forums use the check every face to read the Used Material IDs from an object, but there is a basic ID list in Editable Poly. I attached an image about it.
The only problem is that there is no chance to read this list from the Editable Poly.
Do somebody knows how can i read this list by script?
Attachment | Size |
---|---|
materialidlist.jpg | 77.43 KB |
Comments
.
You can also make an unsafe version of it and it will work at least two times faster.
jahman, you rock! i tried it
jahman, you rock! i tried it out on a 4.000.000 tri object and take 1 second! fantastic, thanks a lot!
furthermore it works on edit poly and edit mesh as well
.
Glad to hear that. It should work ok with anything convertible to mesh.
upd
Here're my numbers :)
Numfaces 4224000
Time: 0.293sec. Mem: 544L
Unsafe Time: 0.058sec. Mem: 544L
That only shows when MultiSubObject material is assigned (and only would display all the ids if the multimaterial had the right number of matching id materials).
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
Yes, you are right. When you
Yes, you are right. When you have more very high detailed objects, it's the fastest way to drop a multi material to the objects with 100+ sub material, and read the ID-s, and restore the materials - instead of check every face with ID information.
For personal use where you're pretty sure you don't exceed that, I agree; for a production-ready tool, you'd need 65536 submaterials (some pipelines use fixed id per material). But unless you're working with extra dense meshes, getting the ids used by ~10k mesh shouldn't take more than tenth of a second anyway.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
This tool works for specific
This tool works for specific workflow, you are right it's not a production-ready tool for everybody. Just for personal workflow.
One object is 5-10.000.000 polygon unfortunately.
.
There's also <IGameMesh>.GetActiveMatIDs method available, but unfortunately I couldn't find a way to use it from maxscript.
Wow, i think this is the
Wow, i think this is the right way, thanks!
It should be work somehow... I will read about it, hope can solve.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters