Best Practice for single mesh multiple materials?

Hello there !

I have this .OBJ file that I want to render with a toon look, I also have the .MTL file and everything loads fine although without the look im aiming to get. I am aware of MeshToon Material and it is ideal for my use case however I don’t know how to assign the various materials to their respective part of my mesh. what are the accepted best practices in this scenario ? exporting the mesh as multiple parts (one per material) and then importing everything ? stacking my .MTL retrieved information with a MeshToonMaterial to achieve the effect ? using GLTF instead of OBJ ? I haven’t found much information on retrieving uv map coordinates either, so I’m assuming I cant just take the .MTL info and pass it to a MeshToonMaterial either…

The importers will usually default in Standard, Phong or Basic material, while GLTF supports most features for PBR materials. A toon material is very specific, so yes, you can basically make a simple routine that will traverse your imported object and create a MeshToonMaterial with all properties you like to transfer like color, maps etc whatever is supported by MeshToonMaterial.

Basically like


myObject.traverse( object => {

	if ( object.material ) object.material = new THREE.MeshToonMaterial( object.material );

});