-
Notifications
You must be signed in to change notification settings - Fork 24
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
.glb with AI painted vertex colors is import failing in 6.10.1, errors about colors #30
Comments
Same issue, Looks like its coming from Unity 2022.3.20f1 Unable to supply 3D model due to NDA concerns, apologies |
Removing baked vertex colors leaves me with: Im pretty sure we need bone weights, so this isnt great :D |
Well. this is sad, not even erasing vertex colors fix stuff it seems. (Btw, yeah, one of my models bugged because there is a submesh system now in inspector, but that was an easy fix, just copied World Transform from older, then pasted to newer and deleted older, oh, seems like now if i revert the glTFast version now this model will break? Lol.) |
We actually switched to this version because we needed the material submesh changes 😂 Our plugin is engine-agnostic, so we needed to get parity with how UE applies materials on their version of gltfast. For more info, we've found that erasing vertex colors allows us to import at runtime, which suits our usecase. So likely the SortAndNormalizeBoneWeightsJob error is in the editor only area. |
@pcareyASM so if i import this kind of .glb blank file: (just example of the icon, when it doesn't work, but inspector on the right still see it as .glb, but an empty one) , but in runtime like from some script instead of in the editor drag into the Assets folder from any Windows folder it will work? (If it really is, then we really do live in a society, lol.). Or the runtime import just still works like there is still no submesh system and i can see each material as separate GameObject with its mesh, hm? |
Describe the bug
Classic "import failed", something about the colors and converting "To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job."
Files
I bet it doesn't pass the glTFast validator (btw where is it?), but staff told me to make issue. so i did.
Here is the .glb model that import failed (it is non-commercial):
Train_Passenger_Wagon.zip
To Reproduce
Steps to reproduce the behavior:
OS: Win 10 2004, Shap-E ( https://huggingface.co/spaces/hysts/Shap-E?duplicate=true ) model manually turned into low-poly in Blender by decimating, deleting, filling empty places after that without erasing its vertex colors
Export it to .glb
Move the .glb to Unity assets folder
An older version of glTFast ~december 2024, early January
Update to latest Windows 10 22H2
Make a revert to backup with assets only folder (no git, only "Assets/") into new empty project with latest glTFast (6.10.1)
See error
Extra:
OS versions probably have nothing to do with it, just for detail.
Expected behavior
It continues working as expected, or at least lets me fix issue with (vertex colors)?
Screenshots
It is pretty straight "Import failed" with blank white file, except the glTFast in inspector still working and able to "Print to console", no sense in screenshots, applied logs below
Desktop:
Additional context
I haven't tried to just use previous versions of glTFast.
Model contains 2 single color materials, both are used.
My assumption why this happens in newer version (probably not, as both math-s and coll-s packages inside project are latest):
"
"### Changed"
com.unity.collections
to version1.2.4
(from1.5.1
)com.unity.mathematics
to version1.2.6
(from1.3.1
)"
Here is the Errors on import:
Errors, something about colors:
//
Here is first error:
//
InvalidOperationException: The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.
Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at :0)
Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at :0)
GLTFast.VertexBufferColors.GetColors32Job (System.Void* input, GLTFast.Schema.GltfComponentType inputType, GLTFast.Schema.GltfAccessorAttributeType attributeType, System.Int32 inputByteStride, Unity.Collections.NativeSlice1[T] output) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:155) GLTFast.VertexBufferColors.ScheduleVertexColorJob (System.Int32 colorAccessorIndex, System.Int32 offset, Unity.Collections.NativeSlice1[T] handles, GLTFast.IGltfBuffers buffers) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:46)
GLTFast.VertexBufferGenerator1[TMainBuffer].ScheduleColorsJobs (GLTFast.Schema.Attributes att, System.Int32 i, Unity.Collections.NativeArray1[T] handles, System.Int32& handleIndex) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:356)
GLTFast.VertexBufferGenerator1[TMainBuffer].CreateVertexBuffer () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:189) GLTFast.MeshGenerator.GenerateMesh (GLTFast.GltfImportBase gltfImport) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGenerator.cs:189) Rethrow as AggregateException: One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.) System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.Threading.Tasks.Task1[TResult].GetResultCore (System.Boolean waitCompletionNotification) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0)
System.Threading.Tasks.Task1[TResult].get_Result () (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) GLTFast.MeshGeneratorBase.CreateMeshResult () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGeneratorBase.cs:40) GLTFast.GltfImportBase.CreateAllMeshAssignments () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2327) GLTFast.GltfImportBase.Prepare () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2140) GLTFast.GltfImportBase.LoadFromUri (System.Uri url, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:1177) GLTFast.GltfImportBase.Load (System.Uri url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:427) GLTFast.GltfImportBase.Load (System.String url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:409) GLTFast.Utils.AsyncHelpers+<>c__DisplayClass1_01[T].b__0 (System.Object _) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:66)
Rethrow as AggregateException: AsyncHelpers.Run method threw an exception. (One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.))
GLTFast.Utils.AsyncHelpers+ExclusiveSynchronizationContext.BeginMessageLoop () (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:122)
GLTFast.Utils.AsyncHelpers.RunSync[T] (System.Func`1[TResult] task) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:73)
GLTFast.Editor.GltfImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/GltfImporter.cs:118)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <9e3a60dbcacc4e77a9c6e1c14064183a>:0)
//
Here is the second:
//
Asset import failed, “Assets/D_Models/Train_Passenger_Wagon.glb” > InvalidOperationException: The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.
Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at :0)
Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at :0)
GLTFast.VertexBufferColors.GetColors32Job (System.Void* input, GLTFast.Schema.GltfComponentType inputType, GLTFast.Schema.GltfAccessorAttributeType attributeType, System.Int32 inputByteStride, Unity.Collections.NativeSlice1[T] output) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:155) GLTFast.VertexBufferColors.ScheduleVertexColorJob (System.Int32 colorAccessorIndex, System.Int32 offset, Unity.Collections.NativeSlice1[T] handles, GLTFast.IGltfBuffers buffers) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:46)
GLTFast.VertexBufferGenerator1[TMainBuffer].ScheduleColorsJobs (GLTFast.Schema.Attributes att, System.Int32 i, Unity.Collections.NativeArray1[T] handles, System.Int32& handleIndex) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:356)
GLTFast.VertexBufferGenerator1[TMainBuffer].CreateVertexBuffer () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:189) GLTFast.MeshGenerator.GenerateMesh (GLTFast.GltfImportBase gltfImport) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGenerator.cs:189) Rethrow as AggregateException: One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.) System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.Threading.Tasks.Task1[TResult].GetResultCore (System.Boolean waitCompletionNotification) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0)
System.Threading.Tasks.Task1[TResult].get_Result () (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) GLTFast.MeshGeneratorBase.CreateMeshResult () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGeneratorBase.cs:40) GLTFast.GltfImportBase.CreateAllMeshAssignments () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2327) GLTFast.GltfImportBase.Prepare () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2140) GLTFast.GltfImportBase.LoadFromUri (System.Uri url, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:1177) GLTFast.GltfImportBase.Load (System.Uri url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:427) GLTFast.GltfImportBase.Load (System.String url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:409) GLTFast.Utils.AsyncHelpers+<>c__DisplayClass1_01[T].b__0 (System.Object _) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:66)
Rethrow as AggregateException: AsyncHelpers.Run method threw an exception. (One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.))
GLTFast.Utils.AsyncHelpers+ExclusiveSynchronizationContext.BeginMessageLoop () (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:122)
GLTFast.Utils.AsyncHelpers.RunSync[T] (System.Func`1[TResult] task) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:73)
GLTFast.Editor.GltfImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/GltfImporter.cs:118)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <9e3a60dbcacc4e77a9c6e1c14064183a>:0)
=====
Here is the "Print to console" error, just in case if its not the same as import ones:
Asset import failed, "Assets/Tets/Train_Passenger_Wagon.glb" > InvalidOperationException: The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray
1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray
1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters, System.Int32 arrayLength, System.Int32 innerloopBatchCount) (at :0)
Unity.Jobs.IJobParallelForExtensions.Schedule[T] (T jobData, System.Int32 arrayLength, System.Int32 innerloopBatchCount, Unity.Jobs.JobHandle dependsOn) (at :0)
GLTFast.VertexBufferColors.GetColors32Job (System.Void* input, GLTFast.Schema.GltfComponentType inputType, GLTFast.Schema.GltfAccessorAttributeType attributeType, System.Int32 inputByteStride, Unity.Collections.NativeSlice
1[T] output) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:155) GLTFast.VertexBufferColors.ScheduleVertexColorJob (System.Int32 colorAccessorIndex, System.Int32 offset, Unity.Collections.NativeSlice
1[T] handles, GLTFast.IGltfBuffers buffers) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferColors.cs:46)GLTFast.VertexBufferGenerator
1[TMainBuffer].ScheduleColorsJobs (GLTFast.Schema.Attributes att, System.Int32 i, Unity.Collections.NativeArray
1[T] handles, System.Int32& handleIndex) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:356)GLTFast.VertexBufferGenerator
1[TMainBuffer].CreateVertexBuffer () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/VertexBufferGenerator.cs:189) GLTFast.MeshGenerator.GenerateMesh (GLTFast.GltfImportBase gltfImport) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGenerator.cs:189) Rethrow as AggregateException: One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray
1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.) System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) System.Threading.Tasks.Task
1[TResult].GetResultCore (System.Boolean waitCompletionNotification) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0)System.Threading.Tasks.Task
1[TResult].get_Result () (at <321eb2db7c6d43ea8fc39b54eaca3452>:0) GLTFast.MeshGeneratorBase.CreateMeshResult () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/MeshGeneratorBase.cs:40) GLTFast.GltfImportBase.CreateAllMeshAssignments () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2327) GLTFast.GltfImportBase.Prepare () (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:2140) GLTFast.GltfImportBase.LoadFromUri (System.Uri url, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:1177) GLTFast.GltfImportBase.Load (System.Uri url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:427) GLTFast.GltfImportBase.Load (System.String url, GLTFast.ImportSettings importSettings, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.unity.cloud.gltfast/Runtime/Scripts/GltfImport.cs:409) GLTFast.Utils.AsyncHelpers+<>c__DisplayClass1_0
1[T].b__0 (System.Object _) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:66)Rethrow as AggregateException: AsyncHelpers.Run method threw an exception. (One or more errors occurred. (The previously scheduled job ConvertColorsRgbaUInt8ToRGBAFloatJob writes to the Unity.Collections.NativeArray
1[Unity.Mathematics.float4] ConvertColorsRgbaUInt8ToRGBAFloatJob.result. You are trying to schedule a new job ConvertColorsRgbaUInt8ToRGBAFloatJob, which writes to the same Unity.Collections.NativeArray
1[Unity.Mathematics.float4] (via ConvertColorsRgbaUInt8ToRGBAFloatJob.result). To guarantee safety, you must include ConvertColorsRgbaUInt8ToRGBAFloatJob as a dependency of the newly scheduled job.))GLTFast.Utils.AsyncHelpers+ExclusiveSynchronizationContext.BeginMessageLoop () (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:122)
GLTFast.Utils.AsyncHelpers.RunSync[T] (System.Func`1[TResult] task) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/AsyncHelpers.cs:73)
GLTFast.Editor.GltfImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at ./Library/PackageCache/com.unity.cloud.gltfast/Editor/Scripts/GltfImporter.cs:118)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <9e3a60dbcacc4e77a9c6e1c14064183a>:0)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
(Filename: C:\build\output\unity\unity\Modules\AssetPipelineEditor\Public\ScriptedImporter.cpp Line: 216)
The text was updated successfully, but these errors were encountered: