Search Unity

[ProBuilder Bug] Error using Connect Edges on complex PolyShape object

Discussion in 'World Building' started by solar_blitz, Jun 3, 2018.

  1. solar_blitz

    solar_blitz

    Joined:
    Jul 30, 2014
    Posts:
    19
    Running Unity3d 2017.3f1, ProBuilder ver. 2.9.8f3

    When running the Connect Edges command on a PolyShape object, I get the following error.

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ProBuilder2.MeshOperations.pb_ConnectEdges.Connect (.pb_Object pb, IEnumerable`1 edges, ProBuilder2.Common.pb_Face[]& addedFaces, ProBuilder2.Common.pb_Edge[]& connections, Boolean returnFaces, Boolean returnEdges, System.Collections.Generic.HashSet`1 faceMask)
    3. ProBuilder2.MeshOperations.pb_ConnectEdges.Connect (.pb_Object pb, IEnumerable`1 faces, ProBuilder2.Common.pb_Face[]& subdividedFaces)
    4. ProBuilder2.MeshOperations.pb_Subdivide.Subdivide (.pb_Object pb, IList`1 faces, ProBuilder2.Common.pb_Face[]& subdividedFaces)
    5. ProBuilder2.MeshOperations.pb_Subdivide.Subdivide (.pb_Object pb)
    6. ProBuilder2.EditorCommon.pb_Menu_Commands.MenuSubdivide (.pb_Object[] selection)
    7. ProBuilder2.Actions.SubdivideObject.DoAction ()
    8. ProBuilder2.EditorCommon.pb_MenuAction.DoButton (Boolean isHorizontal, Boolean showOptions, UnityEngine.Rect& optionsRect, UnityEngine.GUILayoutOption[] layoutOptions)
    9. ProBuilder2.EditorCommon.pb_EditorToolbar.OnGUI ()
    10. ProBuilder2.EditorCommon.pb_Editor.OnGUI ()
    11. 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)
    12. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    13. 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)
    14. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    15. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    16. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    17. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    I can work around it by subdividing edges and connecting vertices, but I still wanted to point this out. I think I was able to use Connect Edges for a while before this occurred. For reference here is an image of the object I am working with. The two green lines at the base of the object are the ones I am trying to connect.

    ProBuilderBugScreenCapture.PNG
     
  2. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi! I can't be sure from the image, but it looks like you have some overlapping geometry there. I'd suggest checking (move vertices and see if unexpected polys appear/distort)?

    Are you able to recreate the issue with a newly-created, fairly simple Polyshape object? That would be helpful to know.

    If you can upgrade to 2018.x, and use the Package Manager version of ProBuilder, that would be best. Lots of fixes and enhancements in that version, while the Asset Store version is only getting critical fixes.