- Home /
Combine Children In-Editor?
Is it at all possible to combine the child meshes/materials of a GameObject in the editor, rather than at runtime? I'd like to assemble level design "building blocks" into things like rooms and hallways, and then combine them into prefabs.
Answer by superpig · May 03, 2011 at 07:00 PM
Wow, thanks! Can't believe I didn't come across this in my searching endeavors. Have you used this recently? Does it work in 3.x? Could I conceivably do what I described in my question?
Yep, I used it last weekend - works fine in 3.0, though you need to make sure that you save the file as 'CombineChildren.cs' and not the combinechildren_c295.cs or whatever the default file name is. The one big limitation the script has is that it generates one mesh per material, ins$$anonymous$$d of combining all the materials into a single mesh with submeshes; I've got a modified version that does that which I'm preparing to post quite soon, if that's what you need.
Nice! Yeah, I was playing with it last night. Pretty neat stuff, but yeah I noticed the materials issue. Any ETA on when you'll have that prepared? :)
In a perfect world it would also automatically somehow uv-unwrap the combined mesh and merge the materials into a texture atlas or something; but I imagine that's outside the realm of possibility, hehe.
Waaait a $$anonymous$$ute, once your script is completed, couldn't you export the .obj with sub-meshes and the materials, and bring it into ultimate unwrap and maybe combine all the materials into 1?
Answer by marcos4503 · Feb 20, 2019 at 02:45 PM
Hi!
If it is an option, you can use the Easy Mesh Combiner tool. It can combine your meshes quickly and very easily, 100% through the editor. It's a wonder to combine the meshes of the scenery and even get more performance! You simply select which GameObjects or children that should have the meshes combined, right-click and combine everything!
Worth a try. Here is the tool link (Available in the Asset Store) https://assetstore.unity.com/packages/templates/systems/easy-mesh-combiner-mt-138805
you think it is necessary to post on a 9 year old post...? just sayin..
I was just walking the internet, and since I recently got a lot of experience with the subject, I thought it would be useful for anyone who is currently reading!
looks like we have been on here about the same amount of time ;)