Search Issue Tracker

Fixed in 4.1.0

Votes

0

Found in [Package]

4.0.5

Issue ID

1161021

Regression

Yes

[ProBuilder] NullReferenceException Occurs on Exporting ProBuilderObject with Vertex Colors enabled

Package: Probuilder

-

NullReferenceException Occurs on Exporting ProBuilderObject with Vertex Colors enabled, when vertex colors are not applied

Steps to Repro:
1. Create a new or Open attached Project
2. Window > Package Manager
3. Install ProBuilder Package
4. Tools > ProBuilder > ProBuilder
5. Ctrl+k to create a new shape
6. Select the shape and click export in Probuilder window
7. Enable Vertex Colors > Export

Actual Result:
NullReferenceException occurs

Expected Result:
The object is exported gracefully

Environment tested on:
Windows 10, Mac 10.14

Unity:
2019.3.0a5, 2019.5.0b5, 2019.1.4f1

Working in Package Version:
4.0.3

Occurring in Package Version:
4.0.5, 4.0.4

Stack Trace:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ProBuilder.ObjExporter.AppendPositions (System.Text.StringBuilder sb, UnityEngine.Vector3[] positions, UnityEngine.Color[] colors, System.Boolean mergeCoincident, System.Boolean includeColors) (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/EditorCore/ObjExporter.cs:418)
UnityEditor.ProBuilder.ObjExporter.WriteObjContents (System.String name, System.Collections.Generic.IEnumerable`1[T] models, System.Collections.Generic.Dictionary`2[TKey,TValue] materialMap, UnityEditor.ProBuilder.ObjOptions options) (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/EditorCore/ObjExporter.cs:179)
UnityEditor.ProBuilder.ObjExporter.Export (System.String name, System.Collections.Generic.IEnumerable`1[T] models, System.String& objContents, System.String& mtlContents, System.Collections.Generic.List`1[System.String]& textures, UnityEditor.ProBuilder.ObjOptions options) (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/EditorCore/ObjExporter.cs:105)
UnityEditor.ProBuilder.Actions.ExportObj.DoExport (System.String path, System.Collections.Generic.IEnumerable`1[T] models, UnityEditor.ProBuilder.ObjOptions options) (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/MenuActions/Export/ExportObj.cs:95)
UnityEditor.ProBuilder.Actions.ExportObj.ExportWithFileDialog (System.Collections.Generic.IEnumerable`1[T] meshes, System.Boolean asGroup, System.Boolean allowQuads, UnityEditor.ProBuilder.ObjOptions options) (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/MenuActions/Export/ExportObj.cs:71)
UnityEditor.ProBuilder.Actions.Export.DoAction () (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/MenuActions/Export/Export.cs:162)
UnityEditor.ProBuilder.Actions.Export.OnSettingsGUI () (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/MenuActions/Export/Export.cs:110)
UnityEditor.ProBuilder.MenuOption.OnGUI () (at Library/PackageCache/com.unity.probuilder@4.0.5/Editor/EditorCore/MenuOption.cs:78)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <23c160f925be47d7a4fd083a3a62c920>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <23c160f925be47d7a4fd083a3a62c920>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <23c160f925be47d7a4fd083a3a62c920>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:337)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:331)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:137)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:93)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:189)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.