Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Weird errors and the mesh disappears

Discussion in 'World Building' started by SonGoku10c, Jun 22, 2018.

  1. SonGoku10c

    SonGoku10c

    Joined:
    Dec 9, 2017
    Posts:
    77
    I built with ProBuilder and suddenly these errors appear:

    Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 7155, VertexCount: 4493 UnityEngine.Mesh:SetIndices(Int32[], MeshTopology, Int32, Boolean) pb_Object:ToMesh(MeshTopology) pb_Object:ToMesh() pb_Object:Awake() IndexOutOfRangeException: Array index is out of range. ProBuilder2.Common.pb_Projection.FindBestPlane (UnityEngine.Vector3[] points, System.Int32[] indices) pb_Object.RefreshUV (IEnumerable`1 facesToRefresh) pb_Object.RefreshUV () pb_Object.Refresh (RefreshMask mask) pb_Object.Awake ()


    KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary2[System.Int32,System.Int32].get_Item (Int32 key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150) ProBuilder2.Common.pb_Edge.GetUniversalEdges (ProBuilder2.Common.pb_Edge[] edges, System.Collections.Generic.Dictionary2 sharedIndicesLookup) ProBuilder2.EditorCommon.pb_Editor.UpdateSelection (Boolean forceUpdate) ProBuilder2.EditorCommon.pb_Editor.OnSelectionChange () System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295) UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288) UnityEditor.HostView.OnSelectionChange () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:168)


    What can I do to work on it again? Or are hours of work away?


    When I try to export it:


    Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 1395, VertexCount: 4493
    UnityEngine.Mesh:SetIndices(Int32[], MeshTopology, Int32, Boolean)
    pb_Object:ToMesh(MeshTopology)
    ProBuilder2.EditorCommon.pb_Model:.ctor(String, pb_Object, Boolean)
    ProBuilder2.Actions.ExportObj:<ExportWithFileDialog>m__0(pb_Object)
    System.Linq.Enumerable:Count(IEnumerable`1)
    ProBuilder2.Actions.ExportObj:ExportWithFileDialog(IEnumerable`1, Boolean, Boolean, pb_ObjOptions)
    ProBuilder2.Actions.Export:DoAction()
    ProBuilder2.Actions.Export:OnSettingsGUI()
    ProBuilder2.EditorCommon.pb_MenuOption:OnGUI()
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)



    IndexOutOfRangeException: Array index is out of range.
    ProBuilder2.Common.pb_Projection.FindBestPlane (UnityEngine.Vector3[] points, System.Int32[] indices)
    pb_Object.RefreshUV (IEnumerable`1 facesToRefresh)
    pb_Object.RefreshUV ()
    pb_Object.Refresh (RefreshMask mask)
    ProBuilder2.EditorCommon.pb_Model..ctor (System.String name, .pb_Object mesh, Boolean quads)
    ProBuilder2.Actions.ExportObj.<ExportWithFileDialog>m__0 (.pb_Object x)
    System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[pb_Object,ProBuilder2.EditorCommon.pb_Model].MoveNext ()
    System.Linq.Enumerable.Count[pb_Model] (IEnumerable`1 source)
    ProBuilder2.Actions.ExportObj.ExportWithFileDialog (IEnumerable`1 meshes, Boolean asGroup, Boolean allowQuads, ProBuilder2.EditorCommon.pb_ObjOptions options)
    ProBuilder2.Actions.Export.DoAction ()
    ProBuilder2.Actions.Export.OnSettingsGUI ()
    ProBuilder2.EditorCommon.pb_MenuOption.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:107)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182)
     
  2. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,383
    Hi there- we'll need more info before we can help, can you let us know the basics first:

    1) OS
    2) Version of Unity
    3) Version of ProBuilder
    4) Build Target
    5) If you create a new, blank project with only ProBuilder installed, using the same versions and build target, does this error still occur when clicking "Build"?

    Thanks!
     
  3. SonGoku10c

    SonGoku10c

    Joined:
    Dec 9, 2017
    Posts:
    77
    1.) Windows 7
    2.) 2017.3.1
    3.) 2.9.8f3
    4.) Target Platform: Windows
    5.) The error happend, when I built with ProBuilder in the editor. Suddenly the Object disappeard. So I don't know, when the error occurs or why or if it is repeatable. I just want my object back ^^.

    If I can't get it back, I will create it again. Will take some hours, but who cares. ^^
     
  4. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,383
    Hi! Thanks for the info :)

    I'm unable to repro this, sounds like you have a custom script affecting the object? For number 5 on the list, it's important to create a brand-new project, not just scene, and try it there.

    Also, if you are able to upgrade to Unity 2018 and ProBuilder 3.x (Package Manager), that would be best, there have been many bugfixes and improvements. I'd give that a shot for sure :)
     
  5. SonGoku10c

    SonGoku10c

    Joined:
    Dec 9, 2017
    Posts:
    77
    Can't upgrade to 2018 at the moment, because not all my assets are 2018 ready. ^^
    and I don't have any custom scripts on the object. Only the normal ones: Transform, Pb_Entity (Script), Mesh_Renderer, Pb_Mesh 135296 (Mesh Filter), Mesh Collider, Pb_Object (Script).
    Could the Triangles count be the problem? I have over 2000 tris on this object. Maybe ProBuilder can't handle this much?

    I will try to build it again and lets see if it happens again.