Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException: An item with the same key has already been added. (USDU-243) #287

Open
corybarr opened this issue Jan 13, 2022 · 3 comments

Comments

@corybarr
Copy link

When attempting to reduce a model via the Simplygon Unity Plugin, the reduction fails with the following error:

ArgumentException: An item with the same key has already been added. Key: (10022.0, 10023.0, 10024.0)
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Unity.Formats.USD.MeshExporter.ExportMesh (Unity.Formats.USD.ObjectContext objContext, Unity.Formats.USD.ExportContext exportContext, UnityEngine.Mesh mesh, UnityEngine.Material sharedMaterial, UnityEngine.Material[] sharedMaterials, System.Boolean exportMeshPose) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Geometry/MeshExporter.cs:394)
Unity.Formats.USD.MeshExporter.ExportMesh (Unity.Formats.USD.ObjectContext objContext, Unity.Formats.USD.ExportContext exportContext) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Geometry/MeshExporter.cs:224)
Unity.Formats.USD.SceneExporter.ExportImpl (UnityEngine.GameObject root, Unity.Formats.USD.ExportContext context) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Scene/SceneExporter.cs:269)
Rethrow as Exception: Error exporting: /X7100_UPITT_5TH_AVE_RENO_ARCH_CENTRAL_R20/X7100_UPITT_5TH_AVE_RENO_ARCH_CENTRAL_R20_rvt/Communication_Devices/TV_Samsung_Display/QM65R
UnityEngine.Debug:LogException(Exception)
Unity.Formats.USD.SceneExporter:ExportImpl(GameObject, ExportContext) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Scene/SceneExporter.cs:273)
Unity.Formats.USD.SceneExporter:Export(GameObject, ExportContext, Boolean) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Scene/SceneExporter.cs:176)
Unity.Formats.USD.SceneExporter:Export(GameObject, Scene, BasisTransformation, Boolean, Boolean, Boolean, Boolean) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.1/Runtime/Scripts/IO/Scene/SceneExporter.cs:138)
Simplygon.Unity.EditorPlugin.SimplygonExporter:Export(ISimplygon, String, List`1)
Simplygon.Unity.EditorPlugin.SimplygonWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@etienne-unity etienne-unity changed the title ArgumentException: An item with the same key has already been added. ArgumentException: An item with the same key has already been added. (USDU-243) Aug 17, 2022
@werez-sn
Copy link

werez-sn commented Aug 7, 2023

+1

Same error but im not using Simplygon, i just have an FBX in Unity that produces this error.
It also DOES output a USDZ after the error, but material assignments are a bit messed up and no textures are brought across.

@vickycl
Copy link
Collaborator

vickycl commented Aug 9, 2023

Hi @werez-sn, thank you for reporting. Would you be able to share the FBX file so that we can reproduce this? It would also be useful to hear:

  • your Unity version
  • your package version
  • whether the issue reproduces when exporting as USDC
    Thank you!

@werez-sn
Copy link

CORICart TV Only.zip

Hi @vickycl , sorry for the delay.

I have attached the problematic element of a larger mesh structure im not allowed to share.
Unity Version : 2020.3.8f1
Package Version : 3.0.0-exp.4
All export options produce the same error.

Notes from tests, if I remove the mesh renderer component from the export works correctly. Also even with the error, a file is produced but it is solid black. I tried just removing/changing the materials of the object but results were the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants