IndexOutOfRangeException: Index was outside the bounds of the array [USDU-328]
See original GitHub issueImporting as game objects some of our USD assets now throws IndexOutORangeException
s after commit dc87b25a3878cab9463311517909660f51bab0ed. This happens only when Import Preview Surface is selected for Materials in the Inspector.
Is this a known issue ?
Here’s the full stack trace from the Console:
IndexOutOfRangeException: Index was outside the bounds of the array.
Unity.Formats.USD.MeshImporter.ImportSkinning (System.String path, Unity.Formats.USD.SanitizedMeshSample usdMesh, UnityEngine.Mesh unityMesh, pxr.UsdSkelSkinningQuery skinningQuery) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs:385)
Unity.Formats.USD.MeshImporter.BuildSkinnedMesh (System.String path, Unity.Formats.USD.SanitizedMeshSample usdMesh, Unity.Formats.USD.MeshImporter+GeometrySubsets geomSubsets, UnityEngine.GameObject go, Unity.Formats.USD.SceneImportOptions options, System.Boolean isDynamic, pxr.UsdSkelSkinningQuery skinningQuery) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs:317)
Unity.Formats.USD.MeshImportStrategy+<Import>d__5.MoveNext () (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs:195)
Rethrow as ImportException: Error processing mesh <...>
UnityEngine.Debug:LogException(Exception)
Unity.Formats.USD.<Import>d__5:MoveNext() (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs:211)
Unity.Formats.USD.<BuildScene>d__9:MoveNext() (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs:640)
Unity.Formats.USD.SceneImporter:BuildScene(Scene, GameObject, SceneImportOptions, PrimMap, Boolean) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs:332)
Unity.Formats.USD.SceneImporter:ImportUsd(GameObject, Scene, PrimMap, Boolean, SceneImportOptions) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs:307)
Unity.Formats.USD.SceneImporter:ImportUsd(GameObject, Scene, PrimMap, SceneImportOptions) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs:269)
Unity.Formats.USD.UsdAsset:Reload(Boolean) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs:565)
Unity.Formats.USD.UsdAssetEditor:ReloadFromUsd(UsdAsset, Boolean) (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs:324)
Unity.Formats.USD.UsdAssetEditor:OnInspectorGUI() (at C:/Users/nicolas.popravka/USD Unity SDK/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs:128)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Issue Analytics
- State:
- Created 6 months ago
- Comments:6
Top Results From Across the Web
c# - What is an IndexOutOfRangeException ...
This exception means that you're trying to access a collection item by index, using an invalid index. An index is invalid when it's...
Read more >IndexOutOfRangeException Class (System)
The exception that is thrown when an attempt is made to access an element of an array or collection with an index that...
Read more >index was outside the bounds of the array.
You can resolve it by not requesting items which are outside the bounds of the array. Remember, the valid indexes for an array...
Read more >How to resolve “system.indexoutofrangeexception' index ...
The "System.IndexOutOfRangeException: Index was outside the bounds of the array" error occurs in C# when you try to access an array element that...
Read more >What is IndexOutOfRangeException in C#? - Code Maze
IndexOutOfRangeException gets thrown when we try to access a member of an array or a collection using an invalid index.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! This should be fixed by #359 , please let us know if you’re still seeing issues!
I have also reproduced here with
HumanFemale.usd
. I’ve logged this as an internal issue. Thanks again.