Errors and cant select verticies.

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.

5265822–526935–House.7z (556 KB)

Even the detached faces seem bugged which is annoying :confused:
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.

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.

@gabrielw_unity

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.

2 Likes

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.

1 Like

Hey, I just opened a PR fixing this here Fix SelectionCache throwing errors by karl- · Pull Request #225 · Unity-Technologies/com.unity.probuilder · GitHub. 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.

2 Likes

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.

@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.

1 Like

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)

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.

1 Like

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.

17 Likes

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.

1 Like

@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 ;)’

2 Likes

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.

So if you are planning to update to get this fix please keep the above in mind.

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.

All good, glad to be helping providing what seems to be valuable info for you guys.

It has been a couple of weeks but I still can’t pull down preview.3 in the Package Manager.

I’ve not found a way manage using the source directly due to prefab GUIDs changing and the use of unpublished packages (unity.settings). Any tips on how to get a build done on 4.x or manage using the source directly without the pain of prefab ids changing? Thanks!

EDIT: I’m on 2018.4 LTS, maybe that is the issue?

Still awaiting P3 myself in the package manager, it got packaged on git a couple weeks back though.

If I’m remembering correctly, all current ProBuilder versions should be compatible with 2018.4.

Regarding working from source, that should definitely be possible. In fact, it should be as easy as cloning the repository into your project’s Packages directory.

https://github.com/Unity-Technologies/com.unity.probuilder