Search Unity

Mesh Baker by Digital Opus [RELEASED]

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

  1. dreamriver

    dreamriver

    Joined:
    Jan 23, 2016
    Posts:
    5
    Hello everyone,

    My problem is I have hundreds of gameobjects and they have tree of gameobjects under it. At the end every leaf gameobject has its own unique mesh. What I want to do is combine all the leaf childs and their meshes as one under its parent.
    As an example;
    Original gameobject structure:

    A
    ---A-1
    ---------A-1-1
    -------------LEAF-A-1-1-1
    -------------LEAF-A-1-1-2
    -------------LEAF-A-1-1-3
    ---------A-1-2
    -------------LEAF-A-1-2-1
    -------------LEAF-A-1-2-2
    -------------LEAF-A-1-2-3
    ---A-2
    ---------A-2-1
    -------------LEAF-A-2-1-1
    -------------LEAF-A-2-2-2
    -------------LEAF-A-2-2-3
    -------------LEAF-A-2-2-4


    I want to convert it to to:

    A
    ---A-1
    ---------A-1-1
    -------------COMBINED A-1-1
    ---------A-1-2
    -------------COMBINED A-1-2
    ---A-2
    ---------A-2-1
    -------------COMBINED A-2-1

    Thanks for yor time.
     
  2. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Hi Dreamriver,

    Create a separate MeshBaker for each (A-1-1, A-1-2, A-2-1...) You can add the meshes to separate mesh bakers by either dragging and dropping (A-1-1, A-1-2 ...) onto the drag and drop area of the inspector or using the Mesh Baker window. When you bake each mesh, the combined mesh will be at the root of the hierarchy. You can move it so that it is a child of (A-1-1, A-2-1... etc..) then delete the other meshes if you want.

    Do you also want to use a texture atlas for your meshes? You can use a single atlas for everything. The output of the TextureBaker is the "Texture Bake Result" object. You can bake all of your meshes using a single texture baker then assign the generated "Texture Bake Result" to all your MeshBakers.
     
  3. dreamriver

    dreamriver

    Joined:
    Jan 23, 2016
    Posts:
    5
    Hi Phong,

    Actually I was looking for an auto way to achive it. Number of leaf nodes are about twenty thousand and the model is in a continious update phase. If mesh baker had such a functionality it would be perfect.
    Thanks for your answer.
     
  4. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Mesh Baker does have some automated tools but they are designed to organize by material, spatial position, not hierarchy organization.

    It would be fairly easy to write a script to automate this.

    20,000 leaf nodes. Wow! have you considered using ECS for this?
     
  5. dreamriver

    dreamriver

    Joined:
    Jan 23, 2016
    Posts:
    5
    The model is generated by a 3D laser scanner and the scanning process takes about half man /year. So the model is extremely huge real world model. I will try to use mesh baker with ECS. That looks like the only way.
     
  6. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Sounds like you are working with some very interesting tech. If you haven't already I would take a look at Unity's MegaCity example project. It is designed to handle huge worlds that are too large to load and render using the traditional Unity approach (lots of GameObjects in a hierarchy).
     
    dreamriver likes this.
  7. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    In Unity 2018.2.20 when I select "generate baker" I get a "Folder for saving created assets was not set." error.

    What do I do? I can make a baker manually but what I assume is the quicker way doesn't work.
     
  8. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    At the top of the tab there is a field for selecting a folder. This is where the generated TextureBakeResult assets will go. You need to set that field before generating the bakers.
     
  9. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    Oh I see I missed that :O

    Also is there any solution for to make the lightmap index for an object the same?

    Also does this work with substance source materials? And if not will it get an update so it can?

    EDIT:
    Also I have an issue where a certain multi material object is missing it's material application. The texture bakes just fine, but the object does not display it's material.

    In some cases it works if "ignore_UV2" is selected in other cases it doesn't work at all. Initially this issue only happened when "preserve_current_lightmapping" was enabled which seemed to be the only option to give me the results I was looking for.

    The below objects are part of the same bake. one is without baking and one is the original (with the image visible in the fame).


     
    Last edited: Mar 6, 2019
    attaway likes this.
  10. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Unfortunately the "preserve lightmapping" is not very reliable in newer versions of Unity. The safest approach for lightmapping is to use one of :

    generate new UV2 layout
    copy UV2 to separate rects

    Then re-bake the lightmapping with the combined mesh.


    Regarding substance textures. I supported substance for a while but then Unity removed built in support for Substance so it was removed. There is now a plugin by Allegorithmic in the Asset Store but it is currently in beta and the reviews so far are not very good. I may add support for this plugin if it proves popular.

    You can use substance textures with Atlases if you export the textures to bitmaps and set up your materials to use the bitmaps.
     
    attaway likes this.
  11. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    Hm, alright that picture frame is still blank though for some reason but i'll try fiddling with it.

    As for substance i haven't had a problem with it since the February update which apparently was a big revamp. I checked the reviews and a lot of them seem like user error or a borked/old installation XD.

    I rely on substance source pretty heavily in both my projects, so support for it would be valuable. But I do understand waiting until it's out of beta.

    I guess i could export the maps in the meantime but it makes things less simple for me. :p
     
    attaway likes this.
  12. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    225
    Hi @Phong -- great asset, thanks. Been using it a while now with no problem, however with more recent versions of Unity, including latest (Unity 2018.3.7f1) I'm unable to save the mesh after baking. The option to save asset no longer exists it seems, is this a known issue?

    // WildStyle
     
  13. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Regarding the missing picture. Check the source material that is being used and compare it to the combined material. Is it the same shader? Are the non-texture properties different?
     
  14. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    The option to save as mesh as asset is under the MB3_MeshBaker inspector, "output". Is this what you were looking for?
     
    WildStyle69 likes this.
  15. PawleyBoboli

    PawleyBoboli

    Joined:
    Jan 27, 2015
    Posts:
    10
    I am looking for more usage info regarding the Agglomerative setting of the Mesh Baker Grouper. In the component, your Tip says it's "awesome!" but I am not sure how or when to use it. I understand how the Grid & Pie options work. Do you have any tutorial vids or docs speaking specifically to Agglomerative grouping? Thanks for any info.
     
  16. dreamriver

    dreamriver

    Joined:
    Jan 23, 2016
    Posts:
    5
    Thank you very much. I will have a look at it.
     
  17. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    I don't have a video or tutorial doc unfortunately, but it is fairly straightforward to use.

    1. Set the cluster type to "agglomerative"
    2. Press "Build Clusters"
    3. Tweak the "Max Distance"
    4. At this point you should see some white sphere gizmos showing the clusters in the scene. You can slide the "max distance" slider to control how big the clusters are and how many clusters are generated. When you are happy with the clusters, press "Generate Mesh Bakers".
     
  18. PawleyBoboli

    PawleyBoboli

    Joined:
    Jan 27, 2015
    Posts:
    10
    Sorry for the newbie follow up question. This probably pertains to Grid & Pie clusters as well as Agglomerative, but are there guidelines for the best number of clusters? As an example, I am working on a mobile project with a scene that shows a rooftop with about 400 solar panels on it, and high-rise buildings all around. I can bake all the buildings into a single large mesh, but then occlusion would not turn any off behind or to the sides of view. If I create clusters for those buildings, would that provide better performance on mobile with occlusion or is it best to just have a single draw call of a big mesh with many vertices? If clustering is a better way to go, would I choose fewer/larger clusters for these buildings? Or more/smaller clusters.

    I realize you can't see my project to know what I'm talking about, but attached is a screen capture from above (the player will be on the roof deck near the solar panels). I appreciate any advice. Thanks. PB

    roofCapture.png
     
  19. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Unfortunately the answer to this question is not a simple guideline. It comes down to the question of whether you are GPU bound our CPU bound. Drawcalls and Setpass calls hit the CPU hard. You can reduce the drawcalls * setpass calls by combining meshes, but in doing so you might be feeding more vertices and triangles to the GPU (possibly off screen verts and triangles). This puts more load on the GPU.

    • If you are very CPU bound and lightly GPU bound then you can combine into fairly big clusters
    • If you are fairly evenly balanced then you want your clusters to be smaller
    • If your are GPU bound then combining meshes will probably make performance worse
    To make the question harder to answer, there are big differences between devices regarding (cpu/gpu bound). Some low end devices don't have very many pixels so they do OK with their wimpy GPUs. Whereas some high end devices with incredible resolutions struggle to color all those pixels every frame.
     
    PawleyBoboli likes this.
  20. loliconest

    loliconest

    Joined:
    Sep 21, 2015
    Posts:
    27
    Hello, I am very tempted to purchase this asset as it looks amazing!

    Before purchasing, I only have one question:

    If I have a very big model that is a single FBX file, but when I put it in Unity, I can select individual sub-meshes. Is it possible to only select some of the sub-meshes from a single FBX model to generate a new prefab with only those selected sub-meshes combined as one mesh?

    Thank you very much!
     
  21. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    34
    Substance support would be amazing.
    Is it currently possible to create an atlas at runtime after a few substances have completed their building process?
     
  22. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Hello, so just to clarify what you mean by sub-meshes. When an FBX file is imported into Unity it looks like this:

    upload_2019-3-12_12-34-3.png

    Unity considers Foot, Hand, HingeXToHingeZ, ... etc. to be separate meshes. Each of these meshes (Foot, Hand etc...) can be assigned to different, independent renderers and positioned independently in the scene. Mesh Baker can combine a few of these, or all of these, or any combination you like.

    Unity uses the technical term "submesh" to mean something different. Submeshes are for having more than one material on the same mesh. A single mesh (eg. Foot) can have more than one material. You could assign one material for the skin and a different material for the toenails. The foot mesh would have two "submeshes". These submeshes are both part of the same mesh and cannot be moved independently. Internally a submesh is nothing more than a list of triangle.

    Does this answer your question?
     
    hopeful likes this.
  23. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    If you can convert the substance textures to Texture2Ds at runtime or somehow cache them from the editor then this is possible. Does the substance building process happen at runtime? If there is no runtime API for converting the substance to a texture you may still be able to do this by setting up a RenderTexture to convert the substance texture to a Texture2D but this up would take a fair bit of scripting.
     
  24. PawleyBoboli

    PawleyBoboli

    Joined:
    Jan 27, 2015
    Posts:
    10

    Thanks for this info. I have found some pages in the Unity Tutorials online that speak to CPU/GPU bound issues. More for me to learn! In my case, I think my project is fairly evenly balanced except on one or two certain camera "views". I will try some clustering and see if it makes a difference.

    Thanks again. Here is the info page I found in Unity Tutorials: https://unity3d.com/learn/tutorials...ion/optimizing-graphics-rendering-unity-games
     
    Phong likes this.
  25. loliconest

    loliconest

    Joined:
    Sep 21, 2015
    Posts:
    27
    Uh, sorry don't want to read the text wall.

    Long story short, already bought the asset and it works fine with what I need. Amazing asset!
     
  26. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    It does kind of work already but not ideally I did some testing to see what would happen and it would bake the texture but the way it baked it would look wrong with black filling a large chunk of the baked texture. I bet however it works is part way there. This was without doing any kind of image export.

    Also subatnce source can optionally process at run time but the feature can be turned off per material. I have no need for the feature currently, I just want to use the materials for setting up my scene.

    I know it works in other mesh baking solutions like advanced merger toolkit.
     
  27. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    When you baked the textures did you check "consider UVs". Large black areas are usually a sign that the mesh has UVs outside the range 0..1.
     
  28. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    Thats possible, my guess though is that it wasn't baking the textures as tiled, and instead only baked the single cube. I'll look into it more soon.

    i'm pretty sure i had it generate new UV's to avoid that issue.
     
  29. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    So i did some testing outside of the scene and it does seem to work but only for the diffuse and metalic map. The heightmap and normal map are naked incorrectly when using tiling

    This is how the scene should look, this features two material setups. The concrete is a substance texture mapped to an external material rather than direct from the subsatnce generated material. The purple cube on the left is a similar set up. Both of these objects have tiling.

    The right object is a substance generated material. It has no tiling.

    these are baked using a single combined material, and generating a new UV2 layout.



    This is how things look after baking, the black lines are a result of the height map, not sure how to resolve that, it's mostly a texture padding issue i guess. EDIT: Yeah texture padding mostly fixed that.

    But you'll notice the height map is also processed wrong, the cube on the left has the height map of the cube on the right, and the concrete is no longer tiled either.



    Here's a close up so you can see that the texture bakes fine.



    Hopefully you can see how the height map is acting.


    So things seem to work for all but tiling, i need to double check my working scene to find out what was happening there...
     
    Last edited: Mar 18, 2019
  30. Fndz

    Fndz

    Joined:
    Sep 20, 2018
    Posts:
    72
    Hi there!

    Im checking the profiler and I realize that all my previous mesh are still in memory, (skinned mesh, shared mesh).
    Using destroy give me error on some assets, so my question is;
    Is there any callback to check if the Bake is completed so I can safely delete my previous mesh, material or textures?

    my code is like:

    SkinnedMeshRenerers [] sk = get list of skinned to bake;
    MeshBaker(sk);
    then I try to do:
    foreach(var smr in sk)
    {
    destroy(smr.sharedmesh); .some errors as some prefabs haven't finish the bake
    }

    Thank you!
     
  31. unidag

    unidag

    Joined:
    Dec 9, 2017
    Posts:
    1
    Hi,

    I'm importing Mesh Baker into a pre-existing project and I'd like to only import the stuff I will actually need to run Mesh Baker. There seems to be a lot of demo stuff in the package. Can you tell me which folders or scripts I need to import just to bake my meshes, without any of the demo or tutorial assets?

    Thanks.
     
  32. rtorresbonetff

    rtorresbonetff

    Joined:
    Jan 3, 2019
    Posts:
    4
    Hello,
    After baking the original meshes are still referenced (even though not visible). That will cause Unity to load the original meshes anyway, which take us quite a lot of extra memory. Any non-destructive workflow you might suggest?
    Thank you
     
  33. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    Any updates to the issue i mentioned in my earlier post :O
     
  34. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Sorry for not being silent for a while. For some reason I stopped receiving notifications about posts on this forum.

    Mesh Baker will re-use the same mesh each time it bakes. It should only create meshes if it doesn't have one to start with. One scenario that can lead to leaked meshes is changing scenes. Are you baking at runtime?

    Are you using the latest version of Mesh Baker (3.26.3). I have a fix in there for meshes not being cleaned up when the scene changes. That should be the only time when meshes are leaked.

    Re: a callback. No there is not, although that would be easy to add. I will try to include it in the next version.
     
  35. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Just "Scripts", "Resources" and "Editor" in the MeshBaker folder.
     
  36. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Do you have "Clear Buffers After Baker" checked? That should clear references to the original meshes used in the bake and free memory held in the buffers. You should only need to keep these buffers if you want to add and delete from the combined mesh.
     
  37. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Sorry for the long silence. For some reason I stopped receiving notifications from this thread.

    Regarding the heightmap, I was not able to reproduce your result. I have a few thoughts.

    • Which texture packer are you using. There was a bug, fixed in the latest version, with the "Mesh Baker Texture Packer Fast" that could produce a result similar to what you are seeing. I would recommend trying the "Mesh Baker Texture Packer" if you are not using that already.
    • How are you tiling? Is it in the texture inspector, the material inspector or the UVs of the mesh?
    • Do you have the consider-uvs enabled? That might fix the issue if there is UV tiling involved.
     
  38. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    178
    I'm using "Mesh Baker Texture Packer"

    The tiling is done through the material properties like this.I can see in the console it does detect it's tiled it just won't do it for the normal and height map.
    upload_2019-4-15_18-48-50.png

    I tried consider UV's and a wide variety of settings and modes, none of them worked in relation to normal and height maps.



    I'm going to send you a scene file with a test i did so you can see for yourself my setup and such...
     
  39. Samhayne

    Samhayne

    Joined:
    Jun 15, 2009
    Posts:
    25
    Hello,

    I'm interested in buying Mesh Baker but I'm a bit confused whether it is considered as an editor extension or not.
    In fact Mesh Baker SEEMS to be an editor extension but in the shop it's not tagged as an editor extension.

    To put it another way: Does Mesh Baker require one license per seat?

    edit:
    For other curious people:
    I also wrote Ian a mail and he was so kind and replied quickly:
    => It's no editor extension and so one license per location.
     
    Last edited: Apr 17, 2019
  40. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    261
    Hi, did you ever end up getting Optimize Transform Hierarchy working with combined skinned mesh renderers?
     
  41. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    No I have not added that yet.
     
  42. nickrart

    nickrart

    Joined:
    Mar 24, 2017
    Posts:
    29
    Would it be possible to get a distance options for 'Pie' cluster type, so each pie slice is also divided into segments by distance from the center?

    OR a threshold option so anything that is close enough to center will be part of a central cluster instead of a pie slice?
     
    Last edited: Apr 23, 2019
  43. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Your timing is good. I am doing work on the MeshBakerGrouper at the moment so this is something I should be able to add.
     
  44. nickrart

    nickrart

    Joined:
    Mar 24, 2017
    Posts:
    29
    Awesome. to combine the previous requests i'd ask have a distance option and then a check box option to combine the inner most ring to a single cluster
     
  45. ogtracy

    ogtracy

    Joined:
    Sep 27, 2016
    Posts:
    22
    I'm testing the evaluation version and I think I've followed all the instructions. I have a gameobject with multiple submeshes and I have the test diffuse materials added onto it, but whenever I try to do the "Bake materials into combined material", I get the following error:

    System.MissingMethodException: byte[] UnityEngine.Texture2D.EncodeToPNG()
    at DigitalOpus.MB.Core.MB3_TextureCombinerPackerMeshBaker+<CreateAtlases>d__0.MoveNext () [0x0079c] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00077] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00067] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00067] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00067] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00067] in <f73ec61125f64cd8ad8767a407569148>:0
    at DigitalOpus.MB.Core.MB3_TextureCombiner.RunCorutineWithoutPause (System.Collections.IEnumerator cor, System.Int32 recursionDepth) [0x00067] in <f73ec61125f64cd8ad8767a407569148>:0
    at MB3_TextureBaker.CreateAtlases (DigitalOpus.MB.Core.ProgressUpdateDelegate progressInfo, System.Boolean saveAtlasesAsAssets, DigitalOpus.MB.Core.MB2_EditorMethodsInterface editorMethods) [0x0000f] in D:\workspace\ancient_throne\Ancient Throne\Assets\MeshBaker\scripts\MB3_TextureBaker.cs:395
    UnityEngine.Debug:LogError(Object)
    MB3_TextureBaker:CreateAtlases(ProgressUpdateDelegate, Boolean, MB2_EditorMethodsInterface) (at Assets/MeshBaker/scripts/MB3_TextureBaker.cs:402)
    DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal:DrawGUI(SerializedObject, MB3_TextureBaker, Type) (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditorInternal.cs:377)
    MB3_TextureBakerEditor:OnInspectorGUI() (at Assets/MeshBaker/scripts/Editor/MB3_TextureBakerEditor.cs:33)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    My unity version is 2018.3.10
     
  46. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Strange: EncodeToPNG is an extension method for Texture2D that is part of the Unity API. I don't see how it can be missing. What is your build platform. I will try this here to see if I can reproduce the problem.

    [UPDATE] I am not able to reproduce the problem. I imported the evaluation version into 2018.3.11, created a TextureBaker & Mesh Baker and baked some textures. There were no errors.

    Was this the first error in the console?
    Are any scripts not compiling (are there errors in the console when the game is not running after you click "clear console")?

    I think if you try to bake when there are scripts that don't compile that might cause this error.
     
    Last edited: May 5, 2019
    JBR-games likes this.
  47. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    81
    Just bought the full version. I want to combine 1350 objects in my scene. These are the steps I took which resulted in no drop in batches or increase in frame rate.

    1) Create Other -> Mesh Baker -> TextureBaker and MeshBaker
    2) Dragged the parent folder of my objects into the Objects to Be Combined window. These resulted in 1347 Objects to be Combined.
    3) Click Create Empty Assets for Combined Material and named it MeshText. It is in the Assets folder. This was now added to the Combined Mesh Material field.
    4) Click Bake Materials Into Combined Material. This process took approximately 2 minutes to complete.
    5) I left cluster type to "none" and all other settings as is.
    6) The console displays 107 messages and 354 warnings most of them are like this:

    Game object One_handed_sword001 (UnityEngine.GameObject) does not use shader Standard (UnityEngine.Shader) it may not have the required textures. If not small solid color textures will be generated.
    UnityEngine.Debug:LogWarning(Object)
    <CreateAtlasesCoroutine>d__94:MoveNext() (at Assets/MeshBaker/scripts/MB3_TextureBaker.cs:285)
    DigitalOpus.MB.Core.MB3_TextureCombiner:RunCorutineWithoutPause(IEnumerator, Int32) (at Assets/MeshBaker/scripts/core/TextureCombiner/MB3_TextureCombiner.cs:248)
    MB3_TextureBaker:CreateAtlases(ProgressUpdateDelegate, Boolean, MB2_EditorMethodsInterface) (at Assets/MeshBaker/scripts/MB3_TextureBaker.cs:395)
    DigitalOpus.MB.Core.MB3_TextureBakerEditorInternal:DrawGUI(SerializedObject, MB3_TextureBaker, Type) (at Assets/MeshBaker/Editor/MB3_TextureBakerEditorInternal.cs:385)
    MB3_TextureBakerEditor:OnInspectorGUI() (at Assets/MeshBaker/Editor/MB3_TextureBakerEditor.cs:33)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    7) Click Generate Mesh Bakers which resulted in two messages in the console:

    Filtering into groups none
    UnityEngine.Debug:Log(Object)
    DigitalOpus.MB.Core.MB3_MeshBakerGrouperNone:FilterIntoGroups(List`1) (at Assets/MeshBaker/scripts/MB3_MeshBakerGrouper.cs:234)
    DigitalOpus.MB.Core.MB3_MeshBakerGrouperCore:DoClustering(MB3_TextureBaker, MB3_MeshBakerGrouper) (at Assets/MeshBaker/scripts/MB3_MeshBakerGrouper.cs:91)
    MB3_MeshBakerGrouperEditor:OnInspectorGUI() (at Assets/MeshBaker/Editor/MB3_MeshBakerGrouperEditor.cs:96)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Found 1 cells with Renderers. Not creating bakers for 0 because there is only one mesh in the cell. Creating 1 bakers.
    UnityEngine.Debug:Log(Object)
    DigitalOpus.MB.Core.MB3_MeshBakerGrouperCore:DoClustering(MB3_TextureBaker, MB3_MeshBakerGrouper) (at Assets/MeshBaker/scripts/MB3_MeshBakerGrouper.cs:171)
    MB3_MeshBakerGrouperEditor:OnInspectorGUI() (at Assets/MeshBaker/Editor/MB3_MeshBakerGrouperEditor.cs:96)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    8) Play the scene. No drop in batches or increase in frame rate.

    Sorry for the emojis. They just appear during the copy and paste of the console messages/warnings. What am I doing wrong?
     
  48. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    After step 8) you will need to bake the meshes. On the MeshBakerGrouper there is a button "Bake Child Mesh Bakers". Click this button. There should be a log message saying "successfully baked X meshes". Also there should be a new GameObject in your scene "Combined-Mesh...".

    Step 9) Click the "Disable Renderers On Source Meshes" button.
     
  49. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    367
    Is this product still in development? Why are there no questions or issues since 2013?

    I have a bunch of custom character models that are made up of multiple skinned meshes.
    (Eyes, Hair, Body, Torso, Pants, Shoes) The Body meshes also have BlendShapes (I do facial animation to simulate speech and blinking).

    I would like to combine all of these meshes to reduce the overhead of having several of these models on screen at one time. My questions:
    1. Will this product help me to achieve my goal as stated above?
    2. If BlendShapes are a problem, can I combine all of the meshes except the one that contains the face?
    3. Would I be better served just pulling my models back into Blender and combining all of the meshes there for export to FBX?
    Mark

    EDIT: My apologies. The forum was only showing 6 pages. After posting, I now see 48!! Disregard the 2013 comment. -=Sigh=- Technology...
     
  50. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,547
    Hi Mark, Regarding your questions:

    1) Yes Mesh Baker can combine multiple skinned meshes and meshes with blend shapes with some limitations which I will describe below.
    2) Yes, you could omit the face and leave it as a separate mesh.
    3) Possibly, combining in blender would leave your unity project cleaner and create a cleaner skinned mesh rig. Some options (like animation import settings) are only available using the ModelImporter.

    There are a few limitations with combining skinned meshes and blend shapes.

    One issue is that the combined mesh reuses the bones from the source skinned mesh rig. This is because:

    • These rigs can be complex and consist of multiple interacting parts (Animator, Avatar, Animation Controller, Bone Hierarchy, CharacterController). It is difficult to duplicate all of this and mix it with other (possibly very different rigs). It is a clean solution is to re-use the bones from the source rig and not worry about what is driving those bones.
    Because of this the combined mesh can end up being driving by multiple Animator components (several characters could be combined). This is slightly different that the typical Unity setup (one animator drives one skinned mesh). One consequence is that Animators are harder to cull (culling settings are limited to always animate). It is still possible to cull animations using custom scripts.

    There is also a limitation with Blend Shapes. They can be included in the combined mesh but there is a problem. Often people are combining several instances of the same mesh and if the blend shapes kept their original names then all blend shapes would move in lock step. Mesh Baker solves this by renaming the blend shapes so that they can be controlled independently for the various source meshes. You will need to modify scripts to use the updated name of the blend shapes.