Search Unity

ProBuilder Errors and cant select verticies.

Discussion in 'World Building' started by drguild, Dec 10, 2019.

  1. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    I've been using pro builder for the last month slowly building a house design and today I thought I would cleanup, merge objects and faces etc.

    Now some of my floors the main and second one is generating errors in the log and I cant select vertices.
    I can select faces and edges but not vertices.


    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    UnityEngine.ProBuilder.WingedEdge.GetWingedEdges (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Collections.Generic.IEnumerable`1[T] faces, System.Boolean oneWingPerFace) (at Library/PackageCache/com.unity.probuilder@4.2.1/Runtime/Core/WingedEdge.cs:353)
    UnityEditor.ProBuilder.ElementGroup.GetFaceSelectionGroups (UnityEngine.ProBuilder.ProBuilderMesh mesh) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/MeshAndElementSelection.cs:132)
    UnityEditor.ProBuilder.ElementGroup.GetElementGroups (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Boolean collectCoincident) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/MeshAndElementSelection.cs:107)
    UnityEditor.ProBuilder.MeshAndElementSelection..ctor (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Boolean collectCoincidentIndices) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/MeshAndElementSelection.cs:31)
    UnityEditor.ProBuilder.PositionTool+MeshAndPositions..ctor (UnityEngine.ProBuilder.ProBuilderMesh mesh, UnityEngine.ProBuilder.PivotPoint pivot) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/PositionTool.cs:54)



    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    I did create a backup before starting, though I would rather not want to do all the merging etc again.
    I have no custom code and just been using Pro Builder so seems pro builder bugged out somewhere..

    Uploaded the current scene file of where I am at if anyone wants to take a look.
    As well as the bug I'm interested in any improvements and advice etc.

    I may have to detach the faces from the objects and rebuild them tops, bottoms and sides separately as I can still do that.

    Next stage was going to be split the floors up more into rooms by creating edges and faces.

    Here is the current progress for those that are wondering without downloading the scene file.
    I cull faces that are out of view hence why the box at the front looks broken plus has a terrain mesh for floor turned off while I work on other things.

     

    Attached Files:

    • House.7z
      File size:
      556.4 KB
      Views:
      55
    Last edited: Dec 10, 2019
  2. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    Even the detached faces seem bugged which is annoying :/
    the whole scene seems bugged.

    I am getting other errors also.


    IndexOutOfRangeException: Index was outside the bounds of the array.
    UnityEngine.ProBuilder.SharedVertex.get_Item (System.Int32 i) (at Library/PackageCache/com.unity.probuilder@4.2.1/Runtime/Core/SharedVertex.cs:62)
    UnityEditor.ProBuilder.EditorSceneViewPicker.GetNearestVertices (UnityEngine.ProBuilder.ProBuilderMesh mesh, UnityEngine.Vector3 mousePosition, System.Collections.Generic.List`1[T] list, System.Single maxDistance, System.Single distModifier) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/EditorSceneViewPicker.cs:557)
    UnityEditor.ProBuilder.EditorSceneViewPicker.VertexRaycast (UnityEngine.Vector3 mousePosition, UnityEditor.ProBuilder.ScenePickerPreferences pickerOptions, System.Boolean allowUnselected, UnityEngine.ProBuilder.SceneSelection selection) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/EditorSceneViewPicker.cs:517)
    UnityEditor.ProBuilder.EditorSceneViewPicker.DoMouseClick (UnityEngine.Event evt, UnityEngine.ProBuilder.SelectMode selectionMode, UnityEditor.ProBuilder.ScenePickerPreferences pickerPreferences) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/EditorSceneViewPicker.cs:45)
    UnityEditor.ProBuilder.ProBuilderEditor.OnSceneGUI (UnityEditor.SceneView sceneView) (at Library/PackageCache/com.unity.probuilder@4.2.1/Editor/EditorCore/ProBuilderEditor.cs:721)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2849)


    All my work seems to have gone to waste for what I am not sure of.
     
    Last edited: Dec 10, 2019
  3. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    Was asked what unity version this is its, 2018.4.13f1 latest LTS and Pro Builder 2.4.1 from the Package Manager.
    My scene was updated from the store Pro Builder v2 and the previous 2018 LTS release.
    Scene was working fine on latest versions until yesterday when I was merging objects and suddenly started getting the above errors for no apparent reason.

    I was rending a lightmap at the time which may have been one reason this happened.
     
  4. Alien_J

    Alien_J

    Joined:
    May 29, 2019
    Posts:
    17
  5. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    I loaded my backup I made before I started the merging which was working.
    I started to replicate my actions and managed to error it straight away.

    When I merged the kitchen curves object to the rest of the floor I got a instant error as above.
    The object is made up of the 2 curves then the edge to the stairs I circled in blue.

    Here is a screenshot.
    the blue arrows are just showing that they are 2 objects at that line and I was merging them together as 1 object.

    Reason for merging was to merge faces so I wouldn't have 2 separate lighting effects (still new so if theirs another way let me know).
    The left face of the line goes to that wall then theirs another face to the main entrance etc etc.

     
    Last edited: Dec 11, 2019
    Hellshrekers and Alien_J like this.
  6. Hellshrekers

    Hellshrekers

    Joined:
    Oct 6, 2013
    Posts:
    6
    Having the same issue! Cant alter any face, edge, or vert since merging my objects.
    No amount of using the repair options, or resetting probuilder prefs help.
     
  7. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    203
    Hey, I just opened a PR fixing this here https://github.com/Unity-Technologies/com.unity.probuilder/pull/225. I also went ahead and tagged a preview build with this fix, which should be available in about an hour. To get it on your machine, enable "Preview Packages" in your Package Manager window and select ProBuilder version 4.3.0-preview.1.
     
    drguild and Alien_J like this.
  8. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    Still not working right.

    I merged a curve to a another object with a L shaped square mesh and while I could select vertices and collapse remaining I couldn't merge the faces getting this error.

    The error was when I collapsed the vertices on the merged objects.
    Welding is fine without error.


    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    UnityEngine.ProBuilder.MeshOperations.MeshValidation.RemoveDegenerateTriangles (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Collections.Generic.List`1[T] removed) (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.1/Runtime/MeshOperations/MeshValidation.cs:212)
    UnityEngine.ProBuilder.MeshOperations.VertexEditing.MergeVertices (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Int32[] indexes, System.Boolean collapseToFirst) (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.1/Runtime/MeshOperations/VertexEditing.cs:45)
    UnityEditor.ProBuilder.Actions.CollapseVertices.DoAction () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.1/Editor/MenuActions/Geometry/CollapseVertices.cs:88)
    UnityEditor.ProBuilder.MenuAction.DoButton (System.Boolean isHorizontal, System.Boolean showOptions, UnityEngine.Rect& optionsRect, UnityEngine.GUILayoutOption[] layoutOptions) (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.1/Editor/EditorCore/MenuAction.cs:304)
    UnityEditor.ProBuilder.EditorToolbar.OnGUI () (at Library/PackageCache/com.unity.probuilder@4.3.0-preview.1/Editor/EditorCore/EditorToolbar.cs:343)


    I also cant seem to merge faces on the combined object that could be a kinda limitation rather than a bug, so would need to work around it with splitting the faces combining or something and reattaching.

    STILL BUGGED
    The curved object I merged into a floor L shaped floor I could select the vertices on that.
    The L shaped floor the vertices disappeared and nothing was selectable.

    So the fix only half fixed the problem.
    I can send my scene if it helps @kaarrrllll

    Its not complex what I am doing should fairly basic simple stuff and the scene is simple soo should be easy to play around with for a diagnosis and fix.
     
    Last edited: Dec 17, 2019
  9. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    203
    @drguild If I'm understanding correctly, you should be able to merge faces on the combined object. I'm not certain what is causing your mesh to end up in this state. If you have the time, could you please file a bug report in Unity with the steps you have taken? Once you get an email with the link to your bug report please PM it to me directly and I will investigate.
     
    Alien_J likes this.
  10. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    I'll PM you the report once uploaded soon.

    I made a small video unlisted of the bug in action below, I loaded a working non bugged scene saved the scene under a separate name, generated the bug while recording and uploading the report from it.

    You can see the different texturing on the end curve I was hoping to create that floor a single mesh. as its one room.


    The vertices get bugged cant merge faces etc.
    The way I work has been in vertices and faces and separated objects as I find that easier than trying to extrude everything as one object.

    I have a multi window setup so the video is the center working scene window.

    I'm fixing up a few overlapping vertices and mesh stuff since that bug was reported. (No change to the bug splitting the face and fixing some bugs)
     
    Last edited: Dec 18, 2019
  11. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    Just letting you all know @kaarrrllll will look at this after the holiday break.
    No rush for me and developers need all the holidays they can get as they always seem overworked.

    Here is another vid of the bug.
    I made a simple cylinder split the front faces into 4 2 on each side as I am going to use them as corners.
    I duplicated and tried to merge 2 faces into 1 instead of recreating the cylinder again to split off half the face as one piece.
    When merging no vertices were shown and I couldn't select more than 1 face.

    This is with the preview @kaarrrllll uploaded with a potential fix, I used to be able to do this so the fix may have broken else little objects trying to fix the bigger merging bug above.

    I'll keep the faces into 4 parts for now and not merge anything.
     
    Alien_J likes this.
  12. bunpro

    bunpro

    Joined:
    May 22, 2019
    Posts:
    3
    To anyone still having this issue.

    I had success by merging everything I wanted, then selecting the faulty merged object and doing:
    Tools > Probuilder > Repair > Rebuild Shared Indexes Cache.
     
    llJIMBOBll likes this.
  13. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    Seems to be working for me so far I'll keep a eye on it.
    But annoying to do it for every object after merging

    I'll let unity know about this.
    Seems this needs to be added to be automatically run in the background when merging objects.

    I have gave @kaarrrllll a extensive message about this for when he gets back as only rebuilding the index cache on that object works, rebuilding all doesn't.

    Doing this works but mesh uv's need manually adjusting and error now which I also mentioned to him.

    This is that error.
    Resetting and redoing the uv's seem to work but keeping a eye on the error incase it doesn't.


    Mesh.uv is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    UnityEditor.Selection:Internal_CallSelectionChanged()


    So hopfully he can create a fix and extra automated process and safeguards for merging objects.
     
    Last edited: Jan 5, 2020
    bunpro likes this.
  14. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    @kaarrrllll messages me yesterday thanking me for all the new info and saying he is back in the office and will look at this soon.

    'Catch up on important work and meetings first ;)'
     
    Alien_J and bunpro like this.
  15. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    The latest 4.3.0-Preview.2 fixes the bug completely I tested extensively merging many things to cut down on object count.

    But please note that something changed in 4.3.0-Preview.2 from Preview.1 in how Pro builder now renders its meshes.

    With importing my world into VRChat a VR social app with its SDK with Preview.2 my world is now invisible and won't render the Pro Builder meshes.
    I made a new issue on that here with screenshots, which is a separate issue.

    https://forum.unity.com/threads/cant-generate-uvs-and-invisible-meshes-vrchat.824949/

    So if you are planning to update to get this fix please keep the above in mind.
     
    Last edited: Feb 10, 2020
  16. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    203
    Thanks @drguild for the update. The issue with objects not rendering in builds has been fixed and I will tag another preview build this week.
     
  17. drguild

    drguild

    Joined:
    Nov 12, 2019
    Posts:
    24
    All good, glad to be helping providing what seems to be valuable info for you guys.
     
unityunity