question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IndexOutOfRangeException: Index was outside the bounds of the array [USDU-328]

See original GitHub issue

Importing as game objects some of our USD assets now throws IndexOutORangeExceptions 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:closed
  • Created 6 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
vickyclcommented, Apr 17, 2023

Hi! This should be fixed by #359 , please let us know if you’re still seeing issues!

1reaction
michaeljblaincommented, Mar 17, 2023

I have also reproduced here with HumanFemale.usd. I’ve logged this as an internal issue. Thanks again.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found