Search Unity

Easy Combine - Two Clicks Mesh Combining

Discussion in 'Assets and Asset Store' started by Sycoforge, Sep 18, 2016.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    It seems the "Transform space" option flips the mesh normals in some cases:
    upload_2019-12-11_12-21-44.png

    I've checked the source mesh's transform hierarchy and import settings, but these all seem to check out (no negative scaling). Observed in 2018.4.6, possible to look into this?
     
  2. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Thanks for reporting. Were you able to spot the case when the flipping happens? Does it occur randomly? Or only with certain meshes or hierarchies?
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    I've meanwhile narrowed it down, and it appears to happen when the parent object (the source meshes being child objects) has a non-zero rotation. You can reproduce this as follows:

    - Create an empty GameObject (parent)
    - Create several spheres as child objects
    - Rotate the parent object on any axis
    - Combine the parent object (Transform space checked)
    - Normals should be flipped at this point

    (Before/after)

    upload_2019-12-11_14-25-54.png

    So far digging the simplicity of the tool (simple is what we need), unfortunately this is preventing us from using it. If possible, I would like the asset path to be saved (EditorPrefs preferably) so it doesn't have to be reconfigured every time the window opens.
     
  4. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Thanks for the repro case. Highly appreciated! This issue will be fixed in the next update together with the persistent path feature.
     
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Awesome, thanks for the quick assist! Will look out for the update.
     
  6. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Dropped you an early access package in PM. :)
     
  7. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Simple is power. this tool could do more stuff that other will request many CLICKS to do it.
    Thank you.
     
    Last edited: Dec 12, 2019
  8. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Glad you like Easy Combine! :)
     
  9. xalsVR

    xalsVR

    Joined:
    Jan 2, 2014
    Posts:
    16
    Hi, I have an issue with some meshes.

    They are apparently ok (in the scene, in 3dsmax) but when I try to EasyCombine them, the console says the following:

    UnityException: You can generate UVs only for meshes with vertices inited.

    It doesn't happen with all meshes, but I can reproduce the error at 100% with some assets.
     
  10. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Hard to say what's going on there. Can you send us the mesh in question?
     
  11. xalsVR

    xalsVR

    Joined:
    Jan 2, 2014
    Posts:
    16
  12. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Thanks for providing the model. It seems that the provided model is corrupted in some way. We couldn't open it in any of our modeling applications (Maya, Blender, Windows 3D viewer, Autodesk FBX viewer). The UV and vertex count seem different.
     
  13. xalsVR

    xalsVR

    Joined:
    Jan 2, 2014
    Posts:
    16
    Here you have another model that you could probably open with your modeling applications that has the same problem with the combine.

    https://we.tl/t-PojOPVsNh6
     
  14. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    That one worked. You have to set the index format to 16Bit in the import settings of the model, as the plugin doesn't fully support single models with a vertex count larger than 65k in conjunction with the lightmap UV unwrap function. Hope that helped.
     
  15. tachyon-particle

    tachyon-particle

    Joined:
    Jan 5, 2016
    Posts:
    79
    Hi,

    When combining a Mesh from a SkinnedMeshRenderer, it creates a combine of new Mesh and places it in new GameObject with MeshRender. Is it possible to have it produce it to a new Game Object with SkinnedMeshRenderer?
     
  16. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Thanks for the feature request! :) Currently, Skinned meshes are not fully (and officially) supported as it's very difficult to merge bone structures and remap those to the combined mesh. It's on our to-research-list.
     
    tachyon-particle likes this.
  17. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    40
    Hi, I find the asset very useful and it works well, but I have one problem I just came across. I think maybe this is just because I'm a new user and not very experienced with lighting etc...

    When I bake the uncombined geometry into a light map it looks OK (this is from a VR game I've written):
    lightmapped-uncombined.png
    But if I combine the meshes first, then bake (same settings - 256 texels/unit, Progressive GPU on a RTX 2080 Ti), it looks like about 1/4 of the texel resolution:
    lightmapped-combined.png
    So
    (1) why is this happening?
    (2) what's the best practice approach for maximising performance - should I be baking then combining, or what?

    Thank in advance!
     
  18. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Seems like that the size of the lightmaps did change because the model became larger with combining. You can change the size of the lightmaps on the renderer component after combining. Let me know of that did the trick! :)
     
  19. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    40
    Sorry for the slow response...

    I did not have any initial success improving this. Here are some examples. The first number is the Lightmap Resolution and the second is the Max Lightmap Size. Note that the only larger lightmap size is 4096 and Unity hangs when I try to use that.

    upload_2021-6-11_19-58-45.png

    However I did manage to improve the quality a lot by disabling the Compress Lightmaps option. Here are the equivalent screenshots with Compress Lightmaps OFF... Strangely, the two different settings here look identical to me even though the Lightmap Resolution is quite different (I didn't have time for 2048 & 2048):
    upload_2021-6-11_20-43-17.png
    Just to clear for anyone else this is the section of the Lighting -> Scene tab in Unity 2020.3.11

    upload_2021-6-11_20-54-33.png

    Anyway thanks for replying, my game still runs at 72 FPS on Quest and with better looking lightmaps now.

    https://badpennygames.itch.io/laser-quiz-3000
     
    Last edited: Jun 12, 2021
  20. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    The max lightmap resolution doesn't influence the actual texel density of the single lightmap islands. It actually only tells the system when to allocate another texture (for large objects this may have an influence though). When the install size is not an issue, and you don't have very large levels to lightmap, not compressing the maps always gives you better results. However, you probably want to increase the size (= texel density) of the unwrapped object on the lightmaps here: upload_2021-6-12_8-28-53.png

    Hope that helped! :)
     
  21. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    I'm getting the following error when trying to combine:-

    Code (CSharp):
    1. MissingMethodException: Method not found: void UnityEditor.Unwrapping.GenerateSecondaryUVSet(UnityEngine.Mesh)
    2. ch.sycoforge.Combine.EasyCombine.CollapseMaterials (System.Collections.Generic.Dictionary`2[TKey,TValue] mappings, ch.sycoforge.Combine.UV2Mode uv2Mode) (at <4e82762c6488452eb800736064e0733b>:0)
    3. ch.sycoforge.Combine.EasyCombine.Combine (System.Collections.Generic.IList`1[T] gameObjects, ch.sycoforge.Combine.UV2Mode uv2Mode, System.Boolean optimize, System.Boolean recalculateNormals) (at <4e82762c6488452eb800736064e0733b>:0)
    4. ch.sycoforge.Combine.EasyCombine.CombineInstatiate (System.Collections.Generic.IList`1[T] gameObjects, UnityEngine.Transform parent, ch.sycoforge.Combine.UV2Mode uv2Mode, System.Boolean optimize, System.Boolean recalculateNormals) (at <4e82762c6488452eb800736064e0733b>:0)
    5. ch.sycoforge.Combine.EasyCombine.CombineInstatiate (System.Collections.Generic.IList`1[T] gameObjects, UnityEngine.Transform parent, ch.sycoforge.Combine.SplitMode splitMode, ch.sycoforge.Combine.UV2Mode uv2Mode, System.Boolean optimize, System.Boolean recalculateNormals) (at <4e82762c6488452eb800736064e0733b>:0)
    6. ch.sycoforge.Combine.Editor.EasyCombineWindow.Combine (System.Collections.Generic.IList`1[T] selectedObjects, UnityEngine.Transform parent) (at <bb89965da6d74c478e274cf425f61ece>:0)
    7. ch.sycoforge.Combine.Editor.EasyCombineWindow.CombineSelected () (at <bb89965da6d74c478e274cf425f61ece>:0)
    8. ch.sycoforge.Combine.Editor.EasyCombineWindow.DrawBakeView () (at <bb89965da6d74c478e274cf425f61ece>:0)
    9. ch.sycoforge.Combine.Editor.EasyCombineWindow.OnGUI () (at <bb89965da6d74c478e274cf425f61ece>:0)
    10. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <bccfc7dedc604845b69da832e24281ea>:0)
    11. UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <bccfc7dedc604845b69da832e24281ea>:0)
    12. UnityEditor.DockArea.OldOnGUI () (at <bccfc7dedc604845b69da832e24281ea>:0)
    13. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d7e218349ba245358b718ae545b0585b>:0)
    14. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d7e218349ba245358b718ae545b0585b>:0)
    15. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d7e218349ba245358b718ae545b0585b>:0)
    16. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <d7e218349ba245358b718ae545b0585b>:0)
    17. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <d7e218349ba245358b718ae545b0585b>:0)
    18. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <d7e218349ba245358b718ae545b0585b>:0)
    19. UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <d7e218349ba245358b718ae545b0585b>:0)
    20. UnityEngine.UIElements.IMGUIContainer.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <d7e218349ba245358b718ae545b0585b>:0)
    21. UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <d7e218349ba245358b718ae545b0585b>:0)
    22. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <d7e218349ba245358b718ae545b0585b>:0)
    23. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <d7e218349ba245358b718ae545b0585b>:0)
    24. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d7e218349ba245358b718ae545b0585b>:0)
    25. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <d7e218349ba245358b718ae545b0585b>:0)
    26. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d7e218349ba245358b718ae545b0585b>:0)
    27. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <d7e218349ba245358b718ae545b0585b>:0)
    28. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <d7e218349ba245358b718ae545b0585b>:0)
    29. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <d7e218349ba245358b718ae545b0585b>:0)
    30. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d7e218349ba245358b718ae545b0585b>:0)
    31. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <d7e218349ba245358b718ae545b0585b>:0)
    32. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <d7e218349ba245358b718ae545b0585b>:0)
    33. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <d7e218349ba245358b718ae545b0585b>:0)
    34. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <d7e218349ba245358b718ae545b0585b>:0)
    35. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <d7e218349ba245358b718ae545b0585b>:0)
    36. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <d7e218349ba245358b718ae545b0585b>:0)
    37. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <16345810913e4130822010222c5660f0>:0)
    38.  
     
  22. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Big update for later Unity version is around the corner. PM one of the devs in the discord, to receive the early access version.
     
    chelnok and Quast like this.