- Home /
How to work with submeshes in editor
As it is, if I click on the object in the 3D view, it will refer to the object itself and display no information specific to the submesh I clicked on. However, if I do the reverse and drag a material to the object, it will be placed on a specific submesh. So, I know there is some functionality that is particular to submeshes, but I wonder if there is any functionality I'm missing. I find it can be problematic when dealing with an object with over 50 submeshes and you are trying to refer to the material you see in the 3D view but you forgot what the name of the material was or where the file was located. And on top of all of this, the material preview window is displaying my BakedLit materials too dark to be able to differentiate between materials when browsing. I'm just wondering if anyone knows any hotkeys or workarounds that will make material and submesh management take less time. If there is no such functionality, does anyone know what functions I would use to make a material eyedropper tool for the editor?
Answer by Bunny83 · May 30, 2021 at 10:26 PM
Submeshes are just referred to by their index. They do not have any names. The materials array has a 1-to-1 relationship to the submeshes. There is no particular order of your submeshes. They will just appear as they have been imported.
Usually when you import a mesh with submeshes, you don't really "work" with individual submeshes. Each submesh has its own material and that's it. As I said, there is no identification for the individual submeshes.
You could try using my UVViewer which allows you to view the UV maps for a mesh and all submeshes. You can even somewhat inspect individual triangles and vertices. Though I'm not sure how well my viewer would work with 50 submeshes as there would be 50 buttons in a row, one for each submesh -.-
Actually the question is, why do you even have that mans submeshes? There isn't really any benefit having submeshes. It just makes splitting and handling the meshes more complicated. Since each submesh has its own material, each submesh has its own drawcall anyways
So, I guess the solution would be a material eyedropper tool in the user interface that would highlight the material. This is something I would need to create?
The reason I have 50 or more submeshes is a long story and has a very good reason, but it has to do with the modeler.
Well, I need to ping object
I guess next thing I need is a raycast to find what submesh I'm clicking on.
Okay, I think I've got it now. Might put the solution on the asset store as I had to write a custom editor tool.
Your answer
