Search Unity

Mesh Baker by Digital Opus [RELEASED]

Discussion in 'Assets and Asset Store' started by Phong, Nov 20, 2012.

  1. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Yes. MeshBaker should be able to do what you describe with the obvious limitation that when tiling is baked you may end up with a very large atlas. It does a lot more too: creating skinned meshes, adding meshes to skinned meshes, creating multiple meshes with adjusted UVs so they can share a material (for static/dynamic batching and more!
     
  2. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Hey Phong! We're giving Mesh Baker a try for a current project. Still wrapping our heads around the workflow and come across a snag that I was hoping you could advise on.

    In our game, the user is able to spawn objects during gameplay. These objects get attached to another object. (Think of it like decorating a Christmas tree). We have a large collection of these 'decoration' objects. Our problem originally was that - as the objects are instantiated - each one created a new draw call. That of course won't work, so we picked up Mesh Baker to work on merging things.

    What we have so far done is created 2 scenes. One is just for baking our materials, and the other is the gameplay scene.

    In the material baking scene, we have a MaterialBaker, and some of our test decorations. We bake all the materials into one combined mesh material.

    In our gameplay scene, we then have a MeshBaker object. The idea now is that we add the decorations at runtime to a baked mesh. During play, we now instantiate the decoration and attach it to the target model. We then use the following code to bake the mesh (objsInCombined is a List that contains the full list of decoration objects):

    Code (csharp):
    1.  
    2.         objsInCombined.Add(thisObject);
    3.         mbd.AddDeleteGameObjects(objsInCombined.ToArray(), null, false, false);
    4.  
    This is where we hit the snag. The first object added causes no problems. It's then each additional object that causes a problem. For each one added, I get the following warning:

    Object Cube has already been added to MeshBaker0

    With that, I don't think things are working as expected, as I'm still getting one draw call per additional decoration. Please also note that for this test, there is only 1 decoration in use.

    Thank you for any help you can give us! :)
     
  3. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I think your approach is good. The problem is that the objsInCombined.ToArray() call. The array of objects to combine can only contain new objects that are not already in the combined mesh. It is also necessary to call Apply() after adding to update the mesh with your changes.
     
    Last edited: Feb 23, 2013
  4. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Phong,

    Ah! Ok. Doing that did fix the error. However I'm not seeing any change in the drawcalls... there is still one draw call being added for each decoration instantiated. Any thoughts?
     
  5. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Try using mbd.AddDeleteGameObjects(objsInCombined.ToArray(), null, false, true); (last argument should be true if you want to disable renderers in source.). You can check in the inspector to see that the renderers on the source objects are actually disabled.
     
  6. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Hrm... no luck with that either. Still +1 draw call per object...
     
  7. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Ooops my bad. Should have been:

    mbd.AddDeleteGameObjects(objsInCombined.ToArray(), null, true, false);
     
  8. SimtropBuggi

    SimtropBuggi

    Joined:
    Feb 15, 2013
    Posts:
    98
    I have a question for you. Lets say I model a skyscraper that is made up of three meshes, a bottom, middle, and top where the middle can be tiled to make the building taller and each section (bottom, middle, and top) has it's own UV wrap texture. So if I tiled the middle 3 times, for example, and then bake the mesh and textures will your scripts create one mesh with three textures or one mesh with 5 textures? I'm trying to limit my drawcalls naturally.
     
  9. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    There are two ways to do this:

    1) The way you describe.
    • A bottom mesh with one texture
    • A middle mesh with a texture tiled three times
    • A top mesh with one texture
    Meshbaker will create a single atlas texture containing three textures. The middle texture will consist of three copies of your original texture.

    2) You could build it this way instead
    • A bottom mesh with one texture
    • Repeated middle meshes, each one with one texture (not tiled texture)
    • A top mesh with one texture
    Meshbaker will create an a single atlas texture with three textures. The middle texture will be your original texture. The UVs will repeat to re-use the same texture. Your mesh will be bigger but the atlas be smaller.

    With both methods the building will look the same and you will end up with one draw call. If you have other buildings you can bake them into the same draw call too!
     
    Last edited: Feb 23, 2013
  10. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Phong, I'd like to have customizable armour for a character mesh and noticed mention of support for something of this nature from MB2. So here are a few questions regarding how MB2 handles these aspects:

    1. If I want to swap out one set of gloves for another, will MB2 support this? I mean, my rig has joints for the fingers, et al - so does MB2 re-weight on the fly or do I need to rig my gloves beforehand, snap their joints to match my hand joints and THEN get MB2 to replace the hand mesh?

    2. As above, does MB2 actually have the ability to replace a portion of a mesh or would this be handled by swapping out a "torso" mesh for a chest armour piece?

    3. Does MB2 support blending neighboring textures, so if you put a breastplate on - will it ensure that the neck blends nicely to merge with the new mesh below?

    Maybe I'm misreading how far MB2 will go, but there seem to be some exciting possibilities wrt armour customization.
     
  11. SimtropBuggi

    SimtropBuggi

    Joined:
    Feb 15, 2013
    Posts:
    98
    I thought drawcalls were determined by the number of textures. Wouldn't a mesh using three textures in an atlas require three drawcalls?

    I've dug and dug and still haven't found a reference to a texture atlas, can someone point me to some sort of documentation?
     
  12. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I think you would need to do it this way.

    Create three skinned meshes. One for each hand and one for the main body (handless). The "hand" skinned mesh game objects would be parented to the forarm transforms of the main body. Use meshbaker to combine the three into a single skinned mesh. To switch the hands you could remove the hand skinned meshes from the combined mesh and add different skinned meshes for the new hands then update the combined mesh. You would need a separate hand skinned mesh for each kind of glove you wanted. I think they could all share the same bones.

    It can only do this if "torso" is a separate mesh from the rest of the body parts then yes it can swap meshes in at out. It is fast enough to do at runtime.
     
  13. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Drawcalls are determined by the number of Materials not the number of textures. Not quite the same.

    An atlas is an image (a single png file for example) that contains other images.

    Consider this example. Imagine a cube mesh with a material and texture that makes it look like a blue dice and another cube mesh with a material and texture that makes it look like a red dice. Each cube mesh has UV coordinates (one coordinate for each vertex) that map parts of the textures to triangles on the mesh. The bottom left corner of the texture has UV coordinate 0,0 and the top right corner has UV coordinate 1,1.

    Unity would need two drawcalls to draw these cubes. One for each cube. Wouldn't it be nice if we could combine those. This is what atlases are for.

    We could create one big image file in photoshop and put the blue dice texture on the left and the red dice texture on the right. This big texture is called an "atlas". However we can't use it with our cubes. The UV coordinates in the meshs are wrong. They map to the whole image not just half. Each dice would be half blue and half red. We need to adjust the UVs in the meshs. They blue mesh needs its UVs scaled so they are in the range 0,0 to .5,1. The red mesh needs its UVs scaled so they are in the range .5,0 to 1,1. If we do this then both cubes can use the same texture/material and both would still look correct. These meshes could be combined and Unity could render them with one draw call.

    Mesh Baker is a tool that combines textures into atlases and combines meshes (adjusting UVs as it goes).
     
    Last edited: Feb 23, 2013
  14. SimtropBuggi

    SimtropBuggi

    Joined:
    Feb 15, 2013
    Posts:
    98
    Then the limit is the max size texture unity supports right?

    So if I bake four building meshes each with a 1024 x 1024 uv texture that turns into one mesh with a 4096x4096 texture? But if I try to bake a fifth mesh with its own 1024 x 1024 uv texture then either 1. Unity crashes trying to load a texture larger than 4096 x 4096 or 2. all textures are reduced in quality to fit the fifth.

    Now, in my example, I would be baking buildings dynamically once their LOD drops, so they will have smaller textures as well, I just used the above example to illustrate my question. And I'm assuming if I bake two buildings with the same texture this will automatically bake both meshes using just one texture.

    Once meshes are baked, how do I get them back to their original state? Would I have to destroy the baked mesh and reload the original meshes?
     
  15. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Yes. This is also platform dependent.

    You could actually fit sixteen 1024x1024 textures into 4096x4096. All textures are reduced in quality if they don't fit and you try to add more to the atlas. You also usually need to include 1 pixel padding between textures so they don't bleed into each other.
    MeshBaker will only include a texture once provided it has the same tiling and offset. If the same texture is reused several times with different tiling and offset then the tiling is baked and the result is included for each different tiling and offset.

    You can combine the meshes in game, but I would recommend building the atlases in the editor ahead of time. Atlas building generally takes more than a second and can take 30+ seconds if there is baked tiling/resizing going on. It can be done at runtime but it has limitations and is hard to make it go fast.
    Baking creates a new mesh, the source objects are left in the scene. The way most people use this is to disable the renders on the source objects but leave them in the scene. Any colliders, rigid bodies, and scripts on the source objects still function normally even though they are invisible. It is the combined mesh that is being rendered. You can either delete the entire combined mesh or remove meshes from it when you want to return to your normal building.
     
    Last edited: Feb 24, 2013
  16. SimtropBuggi

    SimtropBuggi

    Joined:
    Feb 15, 2013
    Posts:
    98
    The meshes wouldn't be baked during game play but in a seperate Building Editor, so the processing delay is done before the assets are even loaded into the game. This applys only to buildings that have a bottom, tileing middle, and top. During gameplay, if the player zooms out then I would need to look into optimizations regarding rendering as more buildings would be on the screen at once. So I would either have to 1. Bake meshes of the same exact building which wouldn't require an atlas or 2. bake buildings close together which have different meshes and textures.

    and yeah, 16 textures in a 4k x 4k...duh... that was a brain fart.
     
  17. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Ok... making some progress. However now what I now have is the decorations will render until I add them to them to the Mesh Baker, then they don't display at all. Could that mean I'm not getting them added properly before the renderers get disabled?
     
  18. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    After adding some decorations, pause the game and look in your scene and you should be able to see a game object called "CombinedMesh-[something]". Look at its child game object and you should see a mesh renderer and mesh filter. This is where meshbaker should be putting the combined mesh. If you select it you should be able to see where it is in the scene. It should probably be positioned at 0,0,0. Check that it is enabled, check that the components are enabled. check that it has a material and that the combined material has been assigned to it. Some materials have material properties (like an alpha value) that affect their visibility. Try assigning different materials just for testing. Check which channels are being baked in the mesh. Are there submeshes involved? There are lots of possibilities. Check the console for messages. MeshBaker is good at printing warnings if something strange is going on.

    It is sometimes best to experiment with the baking in the editor to see what options you need for the meshes you are combining. MeshBaker is forgiving because it doesn't touch your source meshes. Be brave and try different things until you find what works for the meshes you have. Then you know how to configure the baker for runtime baking.

    Let me know if anything here helps.
     
  19. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Phong,

    I'm afraid I'm more confused now. I can get the meshes to bake just fine in the editor - however the exact same settings during gameplay result in invisible meshes. There are no warnings or errors of any kind. Is there any chance I could send you my project so you could take a look and determine what may be going on?
     
  20. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Sure, I wouldn't mind taking a look. Could you PM me with a download link or something?
     
  21. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    Phong,

    Thank you! I've sent you a PM with the download link and information.
     
  22. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    do you give full source code?

    is it possible to get all colliders from source object? after i bake object i want to delete source objects.

    Assume i have 4 different cube on my scene. each face uses 512x512 texture. so there are 4x (512x512) texture as material. i have 400 tiles on my scene. when i bake these meshes will i get (1 mesh, 1 texture (1024x1024 including merge of 4 textures)) ? do we preserve original texture resolution?

    on your youtube videos baked mesh color is lighter than original. why?
     
    Last edited: Feb 26, 2013
  23. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Yes full source is included.
    Mesh Baker does not do this, but there is nothing stopping you from doing it yourself.
    If you set the atlas padding to be zero then you will get one 1024x1024 atlas. However you probable need padding to stop textures from blending into each other. Atlas padding can cause big problems with texture packing. Adding 1 pixel padding can force the texture packer to the next power of two which would be 2048x2048 (75% wasted space). There are two fixes for this problem.

    • MeshBaker includes a feature that will shrink textures by "padding" as they are being added. Obviously this will change the resolution slightly
    • You can build a clear boarder into your original textures so they don't need padding.
    In that scene the models use the "Self/Illum bump diffuse shader". It includes a base color which tints the objects. It defaults to white but on the source models it is a grey. If I had changed it the combined material would have looked the same.

    This is a limitation. If the source models had each used a different base color, I would not be able to get the combined mesh to look exactly the same because the combine mesh only has one color property that is shared by all the combined models.
     
  24. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Hey Phong,

    Do you have any plans to support baking into multiple objects? I'm currently dealing with a large amount of skinned meshes with small-to-medium vertex counts (they have over Unity's 65k vert limit total), and wanted to be able to bake them into a couple of large ones. Alternatively, I can write a script that puts the meshes into groups, but I wanted to see if this was on your radar at all. Currently, Unity will throw an error when I combine these objects all at once.
     
  25. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    A few people have requested this, but it will probably be a week or more before I can get it done. Busy with some client work at the moment.
     
  26. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Looks awesome, will be purchasing.

    I'm curious to know, what system of packing UV's did you use?

    Does this rely on the packTextures function built into unity? Or did you use a different algorithm?
     
    Last edited: Feb 27, 2013
  27. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    The uv channel is scaled from 0,0 .. 1,1 to the rectangle in the atlas corresponding to the source texture. If the source model has UVs outside the range 0,0 .. 1,1 (tiling) then the tiling is baked into the texture then the UVs are scaled.


    MeshBaker uses the built in Unity Texture Packer. I started writing my own at one point but never got it stable enough to use as an alternative to Unity's.
     
    Last edited: Feb 27, 2013
  28. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Is it possible to turn a MeshBaker baked mesh into a prefab? I've tried that, but the resulting prefab is missing the mesh.
     
  29. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    748
    Can the mesh baker system be used completely through code (I want to make it match my current workflow).
     
  30. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    If output is "bake into scene object", the result can't be turned into a prefab because the mesh is an instance in the scene not an asset in the project.

    Try the output "bake into prefab" option. You need to create a target prefab with an empty game object in it.
    This option will save the mesh as an asset and then add that asset to the prefab.
     
    Last edited: Mar 2, 2013
  31. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I presume that you want to use the API in edit mode. This should work as this is what the Mesh Baker inspector does. The code is organized so that all the baking functionality is contained in the Mesh Baker component and the inspector is basically a client which uses that functionality. You could probably copy the code in the "bake" function in the inspector and modify it to suit your needs.

    I am currently working on the next version (which should come out late next week) to improve the organization of the code so that the baking functionality is loosely coupled to the Mesh Baker component. This should make it easy to bake meshes and textures in almost any use case.
     
  32. bngames

    bngames

    Joined:
    Jul 3, 2012
    Posts:
    67
  33. jaegis07

    jaegis07

    Joined:
    Apr 6, 2010
    Posts:
    8
    Hi Phong.
    I had my own mesh baker in my game that doing in runtime. One problem i encountered is the TexturePacker function in Unity output uncompressed texture., and that usually resulted in negative performance in IOS. Did you plugin has the same issue. It will definitely on my buy list if it's not.
     
  34. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    how can i generate lightmap for combined mesh and material? should i generate lightmap first, and bake meshes?
     
  35. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    combining materials uses diffuse shader. how can i make it to use bumped diffuse?

    i get this error when i try to combine materials. i think it is related with this.

    Game object floor1 (UnityEngine.GameObject) does not use shader Diffuse (UnityEngine.Shader) it may not have the required textures. If not empty textures will be generated.
    UnityEngine.Debug:LogWarning(Object)
    MB2_TextureBaker:CreateAtlases(ProgressUpdateDelegate) (at Assets/MeshBaker/scripts/MB2_TextureBaker.cs:68)
    MB2_TextureBakerEditorInternal:_bakeTexturesOnly(MB2_TextureBaker) (at Assets/MeshBaker/scripts/Editor/MB2_TextureBakerEditor.cs:204)
    MB2_TextureBakerEditorInternal:bake(MB2_TextureBaker) (at Assets/MeshBaker/scripts/Editor/MB2_TextureBakerEditor.cs:180)
    MB2_TextureBakerEditorInternal:DrawGUI(MB2_TextureBaker) (at Assets/MeshBaker/scripts/Editor/MB2_TextureBakerEditor.cs:167)
    MB2_TextureBakerEditor:OnInspectorGUI() (at Assets/MeshBaker/scripts/Editor/MB2_TextureBakerEditor.cs:21)
    UnityEditor.DockArea:OnGUI()
     
  36. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    i think baking rotated objects has problem. right side is my original mesh. left side is baked. there are rotated tiles on original. how can i generate baked mesh that looks like original?

    $baker_01.jpg
     
  37. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    You can either, lightmap first, then choose option "preserve current lightmapping".

    Or you can choose option "generate new UV2 layout" and lightmap the combined mesh after baking.
     
  38. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Mesh Baker will generate atlases based on whatever shader is selected in the combined material. If the combined material shader is Bumped Diffuse then it will generate an atlas for the Main Texture and an atlas for the bumpmap.

    The message you see is a warning, not an error. If the source object uses diffuse shader and combined mesh uses Bumped Diffuse shader. Then Mesh Baker warns you that it is generating a clear texture to use for the bumpmap on the combined mesh for that object.
     
    Last edited: Mar 4, 2013
  39. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I am not sure. I have read the description of how Amplify works and can't say I understand what it is saying.

    There is nothing magic about the meshes and atlases that Mesh Baker generates. These are ordinary Unity meshes and ordinary unity textures. However Amplify talks mentions "tiles" and "tiling". Tiling and atlases don't play well together. I would ask the Amplify people if their product is affected by meshes that use atlases.
     
  40. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    Hello, thanks for sending me this project. This is one of the strangest issues I have encountered with Unity.

    It appears that those tiles are actually rotated. You can see this if you put a a non-symetrical texture on the tile in the Main Texture slot.

    The problem appears to be the bumpmap texture. If the you check "Create From Grayscale" then you click "apply" you will see that some of the source blocks are rotated as they appear in the combined mesh. If you correct the rotation then bake the mesh, it works as expected. I have no idea why the normal map appears to be correct on the rotated tile if "Create From Grayscale" is not checked.
     
    Last edited: Mar 5, 2013
  41. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    i sent you source as PM.
     
  42. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    feature request;

    it would be useful to bake colliders too.
     
  43. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    i use substances to generate procedural texture. i get following error when i try to bake materials.

    Object floor1 in the list of objects to mesh uses a Texture that is not a Texture2D. Cannot build atlases.

    texture type is UnityEditor.ProceduralTexture. is it possible to bake also this type of texture?
     
  44. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    MeshBaker can't combine procedural textures because MeshBaker creates atlases and procedural textures can't be combined into an atlas.

    If you have a bunch of meshes that use the same texture, you could put a temporary ordinary material on them. Bake them together, then apply the procedural texture to the result. This would work but be limited to combining meshes that have the same texture.
     
  45. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    don't you create your atlas once when i click "Bake Materials Into Combined Material" ? at that time can't you read procedural output and write this to the atlas?
     
  46. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I looked at the API for the ProceduralTexture but it doesn't implement any functions for setting and getting pixel information. To build the atlas I would need these. Also, I use Unity's built in texture packer which only accepts an array of Texture2D objects. It would be very hard to get this to work.
     
  47. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    i also examined api you are right. we should find a way to convert Texture to Texture2D. following did not worked for me.

    http://answers.unity3d.com/questions/182362/convert-texture-to-texture2d-eg-renderermaterialma.html
     
  48. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    using procedural materials as texture2D will not be easy. so i will write a script that exports bitmap from procedural material.

    can you reduce vertices on bake process? i have 4 tiles. after bake vertices count is 16. it is possible to merge vertices at the same position. you can also add a threshold to accept them as the same position. if you merge vertices this 4 tiles become 9 vertices. for bigger tile background there will be much reduction. now i cannot bake my background because the 64k limitation error.

    also one step more is polygon reduction :) it would be great if you reduce flat poligons. for example this shape would 2 triangles instead of 8.

    is it possible to generate multiple meshes if vertices count is over 64k?

    $baker_02.jpg
     
    Last edited: Mar 7, 2013
  49. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    I think this is a good approach.
    This is probably not as easy as it sounds. You probably need those extra vertices because each one has its own normal and UV coordinate. I can only merge vertices that have the same normal,uv,color,tangent etc...

    You may be able to reduce your triangle and vertex count by eliminating the walls and possibly underside from the internal tiles. You could have separate wall pieces that you add around the perimeter.
    That would be nice but it is a big ask. There is an asset Cruncher $100 that does this.
    This is coming. I have a new version that will come out over the next 2-3 days that can do this.
     
  50. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,084
    A new version 2.5 of MeshBaker is available in the asset store.

    New! Use a MultiMeshBaker component to bake meshes into multiple combined meshes. No more worrying about the 64k limit when combining meshes.

    The API has been refactored and API documentation improved. Mesh combining functionality is now encapsulated in a regular class that is not a component, so meshes can now be combined in scripts without requiring a Component on a game object. Don't worry the MB2_MeshBaker and MB2_TextureBaker classes are still there.

    Note that this version changes the way data is stored internally in the MB2_MeshBaker components. If you modify combined meshes at runtime in your scenes you may need to re-bake the combined meshes before playing the scene.