Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Mesh Baker by Digital Opus [RELEASED]

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

  1. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    162
    Hi,

    Thanks for replying. No, i dont have any rigidbodies. I fixed the low fps problem with quality settings. By default it was set to very high. I tweaked the quality settings and it capped to 30 frames which is very playable with colliders attached. Very happy with the result what mesh baker did. Thank you.
     
  2. Ward101

    Ward101

    Joined:
    Mar 22, 2016
    Posts:
    12
    Do not relay only on framerate to pinpoint your perfo issue.
    If you're going to perform bakings, you should start analyzing and profiling draw calls, batches, triangles and vertex.
    I usually group baked objects based on distance, and use LODs (helps a lot with triangles)
     
  3. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    162
    i just did, i used external profiler and i was able to hit 60 fps solid at my device.

    Though mixed lighting still eats fps so i baked the whole light.
     
  4. DarriasArt

    DarriasArt

    Joined:
    Aug 26, 2013
    Posts:
    1
    Thank you for this direct and accurate answer!
     
  5. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    162
    Can mesh baker also atlas or bake normal map, emission map and other maps using custom bought shader? If so how? Can you also please update your video according to your current version? I was unable to bake skinned meshes.

    Thanks
     
  6. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Mesh Baker will work with custom shaders.

    Mesh Baker must guess the names of shader properties that are textures because Unity does not provide a way to query these. It does this by using a list of common property names. If your shader uses property names that are not on this list then you must add them to the list of Custom Shader Property Names. If you add your names to this list then Mesh Baker will know to look for them.

    Note that when adding a shader property it must be the variable name used in the shader file, not the name used in the inspector (eg. use _MainTex not 'Main Texture')

    I will try to update the tutorial videos this fall. Can you let me know what issue you are having baking skinned meshes?
     
  7. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    47
    Hi,
    I'm getting an error after updating Unity. Is Mesh Baker compatible with the most recent version of Unity?
    I had my project in version 2018.1.2f1 and no errors. I updated to 2018.2.5f1 and it starter throwing these errors:

    Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(42,41): error CS0117: `UnityEditor.EditorUserBuildSettings' does not contain a definition for `tizenBuildSubtarget'

    Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(44,77): error CS0117: `UnityEditor.EditorUserBuildSettings' does not contain a definition for `tizenBuildSubtarget'

    Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(45,41): error CS0117: `UnityEditor.EditorUserBuildSettings' does not contain a definition for `tizenBuildSubtarget'

    Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(45,41): error CS0117: `UnityEditor.EditorUserBuildSettings' does not contain a definition for `tizenBuildSubtarget'


    It is fair to say, my project is Build for PC and as far as I know, the word "tizen" there refers to some sort of store or something like that?

    I didn't change anything from the project, just updated Unity. Anyway, I can't build the project because of those errors.

    Any help?

    Thanks.
     
  8. Nijiem_Arhi

    Nijiem_Arhi

    Joined:
    Oct 4, 2017
    Posts:
    15
    Hi!
    I'm going through the workflow of using the BatchPrefabBaker and had a question:

    I have multiple prefabs with LODs. These LODs have expensive shaders at lower LODs, then drop to a simple diffuse shader at higher LODs. However, there are many cases where the diffuse texture in both the high and low LODs are the same.

    Because of this, when I use the BatchPrefabBaker 2 atlases are being created (expensive material and cheap material), and there are many duplicate instances of diffuse textures within them.

    Is there a way to tell the BatchPrefabBaker to retarget the UVs of my higher LODs to the already atased textures they use instead of creating a new atlas?
     
  9. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Are you using the latest version of Mesh Baker? This should be fixed in the latest version. Alternatively you can comment those lines out in the source file.
     
  10. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    It sounds like you are baking two atlases and the expensive materials are being added to one and cheap materials to another.

    If the expensive shader does not have extra maps (bump, specular etc) you should be able to add the game objects that use the cheap material to the expensive-atlas-texture-baker. Then the expensive atlas will know what to do with objects that have the cheap shader. For this to work the expensive and cheap shader must use the same name for the main texture (_MainTex).

    If the expensive shader has other maps, you might still be able to get this to work by hacking the MaterialBakerResult object. It is a ScriptableObject so you can select the asset in the project and see the fields in the inspector. Duplicate the row in "Material and UV Rect" for the expensive material. Switch the material in the row for the cheap material.
     
  11. Hobodi

    Hobodi

    Joined:
    Dec 30, 2017
    Posts:
    12
    I also have this error. Last version of free baker. Unity 2018.2.5f1.
    In versions before these errors were not.
     
  12. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    I have not yet fixed these errors in Mesh Baker Free hoping to publish a new version this week. Unfortunately you won't be able to fix the issue by modify the scripts because some of the code is in a .dll.
     
  13. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    130
    i'm trying to edit code in demo " SkinnedMeshRenderer ".
    i want to make the sword have skinned mesh but when i Instantiate it is show in inspector but didn't bake
    same code same everything just changed MeshRenderer to SkinnedMeshRenderer.

    any suggest ?
    Thanks
     
  14. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Is the sword the only object being baked by the MB2_MeshBaker component? There are a few things to check:

    1) Are there any messages in the console? You can to turn the MeshBaker log level to debug or trace to get more details.
    2) Is the "Combined Mesh Object" in the scene. You can delete this object and re-bake to make sure you have a clean object. It should have a child component with the skinned mesh on it. Does this have a mesh?

    Note that skinned meshes are a bit tricky to work with. The skinned mesh needs a decent render bounds that encloses it or it can go invisible. You need to move the skinned mesh by moving the bone (source sword object). Moving the SkinnedMeshRenderer component does nothing.
     
    xxhaissamxx likes this.
  15. Wizard-Games

    Wizard-Games

    Joined:
    Jun 4, 2013
    Posts:
    34
    Hi, I am trying to combine 6 materials' textures into a single atlas, but each material uses different settings, so i would like to preserve the materials. Is there a way to just combine textures into an atlas while retaining some of the seterate material properties with mesh baker. When i use the texture baker and set it to use multiple combined materials and then set all the materials, it returns:
    "All objects use the same textures in this set of atlases. Original textures will be reused.," and does not atlas the textures.
     
  16. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Try using "blend non-texture properties" it will try to blend the non-texture settings with the textures when adding them to the atlas. This can create several "tinted" versions of the same texture in the atlas. Note that this feature requires knowledge of how the shader "tints" each texture using the non-texture properties. This is knowledge is encoded in the TextureBlender scripts. Mesh Baker includes scripts for the Standard shader variants and diffuse variants. If your shader is significantly different from those or uses different property names you may need to write your own TextureBlender for this to work.
     
  17. SnaiperoG

    SnaiperoG

    Joined:
    Apr 6, 2015
    Posts:
    7
    Is there is a way to bake after bake in run time? I have modular zombies: head, body and legs. Ive done bake in run time random head, body and legs into scene objects around 30 zombies, and then i need to bake all those zombies in one skinned mesh, but i have errors when i try it:
    Firstly i get these errors:

    Object MeshBaker-mesh-mesh has a MeshRenderer or SkinnedMeshRenderer but no mesh.
    Game object 0 in list of objects to add no renderer
    textureBakeResults must be set.
    Texture Bake Results is null. Can't combine meshes.
    Failed to add/delete objects to combined mesh

    I thought there is a trouble, when each of 30 zombies doesnt baked yet, so i did invoke, before bake all zombies in one skinned mesh, and then i have these errors:

    Assertion failed: d3d11: buffer size can not be zero
    Assertion failed: Geometry jobs should not be launched for empty tasks
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    Assertion failed: Geometry jobs should not be launched for empty tasks

    What exacly i did: i stored all "MeshBaker-mesh" (results of baking) with skinned mesh component in one array and trying to bake those, but as i think there are no meshes as well, i cant see where they have been stored.But it could be wrong. So there is a question, how to bake after bake in run time?
     
  18. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Hello, this is possible. Mesh Baker can use baked meshes as input. I think the problem is that the array of SkinnedMeshRenderers being passed to Mesh Baker do not have any meshes assigned. Do you know why that might be happening? Here are some possibilities that I can think of:

    1) Did you use "Bake Into Scene Object" when baking the original zombies together, then create a prefab and you are using that prefab in a different scene? The prefab will loose the mesh reference when you do this because the mesh is an instance in the scene not an asset on disk. If you want to do this you need to use "Bake Into Prefab".

    2) Could your second bake be happening before your first bake (script execution order issue)?
     
  19. SnaiperoG

    SnaiperoG

    Joined:
    Apr 6, 2015
    Posts:
    7
    Hello, thank you for the answer.
    1) No i didnt use prefabs, my first bake going on GameObject which has been created before. Here is a pic, there are hierarchy of each zombie, it have his own meshbaker script, and meshbaker-mesh, which i puted into meshbaker script. At start my main script instantiate 30 zombies, and do a bake. Its going good, but when i trying to bake second time, it goind to fall. And 2) special for it, i did invoke to second bake, so it could be script execution order issue i guess.
    pic1 - zombie hierarhy

    pic2 - skinned mesh renderer on meshbaker-mesh. when i pressed twice on mesh it open it on preview

    It might be my fault but i still cant understand where it.
     
  20. Nijiem_Arhi

    Nijiem_Arhi

    Joined:
    Oct 4, 2017
    Posts:
    15
    Hi,

    I'm using Mesh Baker to atlas a set of prefabs with a normal map. When I bake the materials into a Combined Material the normal map atlas that Mesh Baker generates does not look like a standard normal map, or function as such.

    I've attached an example of what I'm seeing.

    How do I fix this?
     

    Attached Files:

  21. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    I would suggest adding some Debug.Log statements to verify that the first bake is happening before the second bake. Also, just before the second bake, Debug.Log the first game object in the list of objects you are combining. Grab the SkinnedMeshRenderer component on that print out the .sharedMesh property to see if it is really null. Also consider setting the log level on the MeshBaker inspectors to "Debug" or "Trace". The bakers will output a lot of detail to the console about what is happening in the bakes. None of this will solve the problem but it should help understand what is happening and why it is happening.
     
  22. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Is the normal map in the list of custom property names or is it being found and handled by Mesh Baker automatically? If it is in the list of custom property names, make sure the normal map property is checked. Can you tell me:
    • Which texture packer are you using? (try the Mesh Baker Texture Packer)
    • Are you using "Blend Non-Texture Properties" (try without)
    • Are the source textures imported as normal maps in the importer inspector
    If none of this fixes your problem please let me know what version of Unity you are using and Plaform. It may be a bug.
     
  23. Nijiem_Arhi

    Nijiem_Arhi

    Joined:
    Oct 4, 2017
    Posts:
    15
    • I've had the same results both with and without listing the normal map in the custom properties. The property is "_Normal" so it looks like Mesh Baker automatically handles it either way. Normal map property is checked when it is listed as a custom property.
    • I'm using Mesh Baker Texture Packer
    • "Blend Non-Texture Properties" is unchecked
    • All source textures are imported as normal maps

    Since my last successful bake we've recently been tinkering with some default texture import settings — are there any other normal map import settings that may affect the bake in this way?

    We also recently upgraded to 2018.2.6f1 (target platform PC/VR). This is also my first attempted bake following the upgrade to 2018.2.6f1 (in 2018.1 I was able to bake with expected results)
     
  24. SnaiperoG

    SnaiperoG

    Joined:
    Apr 6, 2015
    Posts:
    7
    Thank you again, its realy was my fault, really good support, have good day!
     
  25. CNR-EpiTel

    CNR-EpiTel

    Joined:
    Aug 23, 2018
    Posts:
    11
    Hi, Would this be useful in Google daydream VR for the latest Unity 2018? Thank you for your suggestions. Trying to get the calls down without losing the realistic quality of Gaia assembled in my scene with CTS, Enviro and Aquas desperately!
     
  26. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    I will try baking in 2018.2.6f1 to see if I can get the same result. Can you verify if this happens with one of the example scenes if you add a normal map to one of those materials? Does it happen with the Standard shader?
     
  27. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    I have not tested it yet on 2018 with Google daydream VR, but I fully intend to support it. To answer your question, would this be useful. The answer is that it depends what you want to do. Mesh Baker does the following:
    • Combines textures into texture atlases
    • Combines and modifies meshes to use the texture atlases
    • Combines regular meshes into skinned meshes
    • Combines skinned meshes
    • Creates modified prefabs capable of using atlas materials
    • Helps create customizable characters (mix and match body parts)
    If you want to do any of these things then Mesh Baker is useful.
     
    CNR-EpiTel likes this.
  28. Jackrabbit82

    Jackrabbit82

    Joined:
    Mar 13, 2013
    Posts:
    12

    Regarding the normal map issues it's working fine for me in 2018.2.12f1. Found the culprit it's the Texture PostProcessor in our project preventing the tool from switching the normal maps to the default type before atlassing, just commenting this processor section should do the tricks while attaching object.
     
  29. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    278
    Hi,

    Does this asset combine meshes with same material/texture without creating new atlas texture ?
    Dees this asset combine only materials into single atlas without combining meshes ( single game objects with same material/texture atlas ) ?
     
    Last edited: Nov 7, 2018
  30. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Yes to both. The assets has two core components that are loosely coupled. They can be used separately or together.

    • TextureBaker - Creates texture atlases and a special asset that maps source materials to rectangles in the atlas.
    • MeshBaker - Combines meshes.
    The MeshBaker can combine meshes without an atlas. Objects with different materials are mapped to different submeshes in the combined mesh. If the special asset that maps source materials to rectangles is provided then the MeshBaker can make objects share materials as they are combined.

    Mesh Baker also includes a BatchPrefabBaker which creates modified versions of prefabs that share a material from a list of source prefabs that use different materials.
     
  31. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    278
    Hi, I try to use it...

    UI is really weird designed.. I want to only combine meshes with same materials ( atlassed ), I also want to use cluster feature with grid etc.. ( for better occlusing culling results )

    However using MeshBaker script hard, Analyze scene create TextureBaker with MeshBaker, but when I only want to combine meshes without using TextureBaker, it complains about no material etc... Adding object to only MeshBaker is very time consuming one by one..

    Simply put, I only want to use MeshBaker and MeshGrouper only, without Texture Baker.. It seems hard.. MeshGrouper complains about that it needs TextureBaker..

    And 1 question, where is the combined mesh ?
     
    Last edited: Nov 9, 2018
  32. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Hello,

    The workflow for what you are doing is not the most intuitive I agree. I will try to make it friendlier.

    The mesh baker checks to see if there is a TextureBaker in the parent and if has a Material Bake Result asset. If both of these are true it won't bake until the textures have been baked.

    Currently you have two choices.

    Option 1:

    Bake the Texture Baker. I know that all the source objects use the same material. Mesh Baker will detect this so it doesn't generate any atlases, but it does set up the Material Bake Result so that it will work. It re-uses the source textures. However it does generate a new material which is probably annoying for you.

    Option 2:

    Use the following workflow, the key step is to delete the "Material Bake Result" asset. With that gone, the Mesh Bakers will not detect that the textures have not been baked and will combine the meshes without the error about the textures not being baked.

    • Use the List Shaders In Scene
    • Generate Baker
    • Use the MeshBakerGrouper to group the meshes into clusters
    • Delete the Material Bake Result asset in the project folders. After doing this the Material Bake Result field should be None for all bakers.
    • Now you can bake the Mesh Bakers either by clicking bake on them individually or by clicking "Bake All Child Mesh Bakers" on the MeshBakerGrouper component. You will get a warning but the bake succeeds.
    The combined mesh is will be a new game object in the scene. On the Mesh Baker component there is a "Combined Mesh Object" property. The combined mesh will be a child of this Game Object. It is set up this way so that you can delete the Mesh Baker after baking if you want. It is a child of the "Combined Mesh Object" because sometimes the combined mesh can be split into several meshes.
     
    Last edited: Nov 10, 2018
    MoribitoMT likes this.
  33. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    278
    I love this asset, It has amazing feature, however I think it needs easy UI design, a refactoring :) .. Couple suggestions
    • 1 Click combine feature ( combines asset with combine selection ( only same materials, bake together, create atlas, etc.. options ) without any fuss.. ( Like MeshKit, EasyCombine assets )
    • 1 Click atlas bake feature ( Like ProDrawCallOptimizer asset )
    • 1 Click material combine ( Like ProMaterialCombiner asset )
    • 1 Click prefab maker ( craetes folder, prefabs, meshes, etc.. auto without any hassle.. )
    • Realtime UV editing before baking atlas ( Like Prefab Maker asset )
    • Totaly seperated TextureBaker, MeshBaker, MeshBakerGrouper, PrefabBaker, no dependencies at all..
    Just couple suggestion to make your asset bring much more success..
     
  34. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    980
    It's really cool but too slow! I have 30 low poly character but it takes too long to bake.
    Also my CPU is AMD threadripper 1920. But baking is too slow. I've tried to bake 100 low poly characters with no luck.
     
  35. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    987
    With no luck you mean too slow in runtime? Or it's hanging or something? I don't use it much, but it works fine for me when I do.
     
  36. pokoponmaru

    pokoponmaru

    Joined:
    May 24, 2015
    Posts:
    5
    Hi there
    I am really interested and I bought it from the asset store!
    However
    Texture combine error has come out ...
    I want to know urgent, solution method.

    PC:Win10(surface pro4)
    Unity:2018.2.1f1(Personal)

    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(10,35): error CS0433: The imported type `DigitalOpus.MB.Core.MB2_EditorMethodsInterface' is defined multiple times
    2.  
    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/core/MB3_BakeInPlace.cs(12,40): error CS0433: The imported type `DigitalOpus.MB.Core.MB3_MeshCombinerSingle' is defined multiple times
    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/core/MB3_BakeInPlace.cs(12,144): error CS0433: The imported type `DigitalOpus.MB.Core.ProgressUpdateDelegate' is defined multiple times
    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(467,63): error CS0433: The imported type `DigitalOpus.MB.Core.ShaderTextureProperty' is defined multiple times
    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/core/MB3_TextureCombinerEditorFunctions.cs(591,32): error CS0433: The imported type `DigitalOpus.MB.Core.MB_ObjsToCombineTypes' is defined multiple times
    Code (CSharp):
    1. Assets/MeshBaker/scripts/Editor/MB3_BatchPrefabBakerEditor.cs(327,133): error CS0433: The imported type `MB2_TextureBakeResults' is defined multiple times
     
  37. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Thanks for the feedback. I am planning on putting some work in on Mesh Baker over the next few weeks. Will consider these suggestions.
     
  38. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Did you install the evaluation version and then the full version without deleting the evaluation version first? I think that would generate these errors.

    I would recommend deleting the Mesh Baker folder and everything contained within and re-importing.
     
    pokoponmaru likes this.
  39. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Can you provide more details about what you are trying to do and which part is taking a long time?

    Baking textures can take a long time. It is recommended to build these in the editor if possible.

    When you say "too slow" how long is it taking?

    Do you have a total vertex and triangle count for the 30 characters?

    Are there any error messages in the console?

    Can you post a screenshot with your bake settings?
     
    ksam2 likes this.
  40. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    980
    There is an option to disable skined mesh of source objects, That's cool but I need to keep that enable and just remove mesh on that! So please add an option to only change mesh of a skinned mesh component to null.
     
  41. pokoponmaru

    pokoponmaru

    Joined:
    May 24, 2015
    Posts:
    5
    Thank you I'm try !
     
  42. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    I can't promise to implement everything. I need to make sure that any features I implement are useful to most users.
     
  43. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    130
    i have follow MB_SkinnedMeshSceneController to combine meshs at runtime i successfully added and removed full character but when i try to add item after that it works fine but can't remove
    add code
    Code (CSharp):
    1. m_MeshPlayer.AddDeleteGameObjects(items, null, true);
    2. m_MeshPlayer.Apply();
    remove code
    Code (CSharp):
    1. m_MeshPlayer.AddDeleteGameObjects(null, items, false);
    2. m_MeshPlayer.Apply();
    that's error when i try to remove
    Code (CSharp):
    1. ArgumentException: An element with the same key already exists in the dictionary.
    2. System.Collections.Generic.Dictionary`2[UnityEngine.Transform,System.Int32].Add (UnityEngine.Transform key, Int32 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    3. DigitalOpus.MB.Core.MB3_MeshCombinerSingle._addToCombined (UnityEngine.GameObject[] goToAdd, System.Int32[] goToDelete, Boolean disableRendererInSource) (at Assets/Scripts/Asset/MeshBaker/scripts/core/MB3_MeshCombinerSimple.cs:1166)
    4. DigitalOpus.MB.Core.MB3_MeshCombinerSingle.AddDeleteGameObjectsByID (UnityEngine.GameObject[] gos, System.Int32[] deleteGOinstanceIDs, Boolean disableRendererInSource) (at Assets/Scripts/Asset/MeshBaker/scripts/core/MB3_MeshCombinerSimple.cs:2382)
    5. DigitalOpus.MB.Core.MB3_MeshCombinerSingle.AddDeleteGameObjects (UnityEngine.GameObject[] gos, UnityEngine.GameObject[] deleteGOs, Boolean disableRendererInSource) (at Assets/Scripts/Asset/MeshBaker/scripts/core/MB3_MeshCombinerSimple.cs:2316)
    6. MB3_MeshBaker.AddDeleteGameObjects (UnityEngine.GameObject[] gos, UnityEngine.GameObject[] deleteGOs, Boolean disableRendererInSource) (at Assets/Scripts/Asset/MeshBaker/scripts/MB3_MeshBaker.cs:43)
     
  44. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    282
    Hello Is that system working well with automatic atlasing Lod groups? we have over 200 models with already prepared lod groups and we would to make soem atlas from it. Will it make in autoamtic way for us? there is nothing about it on page description ;) Hope you could answer Cause we would to buy system ;)
     
  45. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Make certain that Clear Buffers After Bake is NOT checked.

    Are you combining in the editor then deleting at runtime? This is problematic. The reason is that when you press play Unity serialized the scene, and creates a fresh version for playing. This is why changes made at runtime do not affect the scene when you stop playing. Unfortunately it also means that the references and identifiers to the source objects that were baked are broken. If you try to tell the baker "Delete this object" it may map to the wrong object or can't find the reference. If you want to do this I would recommend doing the initial bake in Start, so that the baker has the references to the playing objects. Then adding and deleting works correctly.
     
  46. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    It depends on the workflow you want to use. This works well with LOD groups.
    • You have some prefabs that contain LOD groups
    • You use the Batch Prefab Baker to create atlases for these prefabs and create modified versions of your meshes with adjusted UVs that use the atlas textures.
    • You use these new prefabs in your scenes. Or switch the meshes and materials in your source prefabs to use the updated meshes and materials.
    If you have scenes that are full of LODgroups and you want to switch the meshes and material on the scene instances. You could still use the Batch Prefab Baker to create atlases and meshes with UVs that use the atlas, you would then need to write a script that would search the scene for renderers that use the original material and mesh and switch it to use the new material and mesh.
     
  47. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    282
    OK thank you but will Your system prepare new configured the same as old LOD group new atlased Lod groups ? :) Because this is main thinkg that I'm asking :) cause I dont have time to manuallu place again new meshes to lod group we have to many objects for that. And most system that make atlas on asset store make atlas but then I have to manually again prepare lod groups. So will your system do it automatic way? Or have I make my own scripts, I'm not programmer so this is not thing for me, I'm looking for system that will just do it automatically.
     
  48. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    If the LOD groups in your scene are connected to prefabs then Mesh Baker can automatically update the prefabs which will update all the instances in your scene. However it won't go through your scene and and find all the renderers that use the meshes and materials and switch them.
     
  49. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    282

    I ahve 200 prefabs every one of it have its own lod group :) Will it work this way? Thank you for your time answer!
     
  50. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    1,441
    Yes it should work this way.

    If the prefabs are already positioned in the scene and you probably don't want to create new prefabs, you want to update the existing prefabs. You can accomplish this by:

    1) Use the Batch Prefab Baker
    2) Duplicate the prefabs and use the new duplicates as the source prefabs and the old prefabs as the target prefabs.
     
    JBR-games likes this.