Detach Using Material IDs

This script detaches faces as new objects, using Material ID property of the faces. Most of the cases, matIDs are used to assign multiple materials on one object. Sometimes you might want to detach these as new objects.

Download Detach Using Material IDs Maxscript

It is possible to detach every matID as object, or simply a range, or just one with Min ID and Max ID ranges. If you keep the default settings, every matID becomes a new poly object. The remainder will be a faceless poly, script deletes this poly if this is the case. Naming will be done by adding the ID number at the end of the original name of the selected object (originalname_ID_#). Wirecolor will also be randomly changed. The pivots of the detached objects will be the same as the original object.

Before using the script please keep these in mind :

  • Script only works with polys. If you have a mesh or patch, you’ll need to convert it to poly mesh, or add an “edit poly” modifier on the stack.
  • Do not detach instanced objects, as this will cause deletion of the faces on the instances.
  • For objects with high poly count, it may take some time to process all the faces. I tried the script with a million poly object, it took 30 seconds or something close to detach every matID available. It might be better to detach some of the matID’s by hand, and then using the script.
  • Why is it slow with high poly objects ? There is no method in 3dsmax for detecting the matID count directly. Script goes through every face and count unique matID channels. Then detaches these if desired.

This slideshow requires JavaScript.

2 thoughts on “Detach Using Material IDs”

Leave a Reply