"Import Nested Prefabs" option is broken

I’ve tried this with many different file types and models, and it always results in the same error if the model contains sub-assemblies that can be made into prefabs.

Is this a known bug that will be fixed soon, or is there any kind of workaround? This is definitely a feature I would very much like to use as it would save me a lot of time setting up LODs in large models with lots of repeating instanced sub-assemblies that should be prefabs.

ArgumentException: An item with the same key has already been added. Key: 6458
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <31687ccd371e4dc6b0c23a1317cf9474>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <31687ccd371e4dc6b0c23a1317cf9474>:0)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1283)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1261)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1316)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1261)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1316)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1316)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1316)
UnityEditor.Pixyz.UnitySDK.SceneConverter.UpdateHierarchy (System.UInt32 occurrence, System.Int32 index, UnityEngine.Transform transform, UnityEngine.Transform trParent, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSync) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1316)
UnityEditor.Pixyz.UnitySDK.SceneConverter.ToUnity (System.UInt32 root, UnityEditor.Pixyz.UnitySDK.SceneConverter+MeshSyncType meshSyncType, System.Collections.Generic.Dictionary`2[TKey,TValue] entityToObject) (at ./Library/PackageCache/com.unity.pixyz.unity-sdk@2.0.34/Editor/Conversions/SceneConverter/SceneConverter.cs:1066)
UnityEditor.PixyzPlugin4Unity.Importer.CreateUnityAssets (UnityEngine.GameObject& root, UnityEngine.GameObject[]& nestedPrefabs, System.Boolean importMetadata, System.Boolean importVariants, System.Boolean importPmi, System.Boolean importAnimations, System.Boolean importPrototypes) (at ./Library/PackageCache/com.unity.industry.toolkit@3.0.3/Editor/Importer/Importer.cs:357)
UnityEditor.PixyzPlugin4Unity.CADImporter.PostProcess () (at ./Library/PackageCache/com.unity.industry.toolkit@3.0.3/Editor/Importer/CADImporter.cs:30)
UnityEditor.PixyzPlugin4Unity.Importer.<ImportInternal>b__35_1 (System.Threading.Tasks.Task task) (at ./Library/PackageCache/com.unity.industry.toolkit@3.0.3/Editor/Importer/Importer.cs:151)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

This is with Pixyz plugin for Unity v3.0.3 in Unity v2022.3.50f1

Hi @smenyhart,

Thanks for reporting this issue.
I was able to reproduce on a dummy file. We created a ticket in our system and we will work on it. Unfortunatly it won’t be solved for the next release scheduled in few days. But it should be in the next one (~ end of the year / early next year ).

Thank you again for helping us making this produt better.
Have a good day,
–Selim

1 Like

Hi @smenyhart
I’m comming back to tell you the bug has been solved. I tryed with your model this morning and I was correctly able to import it with Nested Prefab enabled.

The patch will be available in the next release ( ETA: end of year / early next year)