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

.glb with AI painted vertex colors is import failing in 6.10.1, errors about colors #30

Open
FnSolo opened this issue Feb 5, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@FnSolo
Copy link

FnSolo commented Feb 5, 2025

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:

  1. 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

  2. Export it to .glb

  3. Move the .glb to Unity assets folder

  4. An older version of glTFast ~december 2024, early January

  5. Update to latest Windows 10 22H2

  6. Make a revert to backup with assets only folder (no git, only "Assets/") into new empty project with latest glTFast (6.10.1)

  7. 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:

  • glTFast version: 6.10.1
  • Unity Editor version: 6000.0.25f1
  • Render Pipeline and version: URP 17.0.3
  • Platform: Editor

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"

  • Downgraded package dependencies to version bundled with Editor.
    • com.unity.collections to version 1.2.4 (from 1.5.1)
    • com.unity.mathematics to version 1.2.6 (from 1.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.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)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

(Filename: C:\build\output\unity\unity\Modules\AssetPipelineEditor\Public\ScriptedImporter.cpp Line: 216)

@FnSolo FnSolo added the bug Something isn't working label Feb 5, 2025
@pcareyASM
Copy link

Same issue,
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 <6f7018b8b8c149e68c4a65a05ac289be>:0)

Looks like its coming from 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/[email protected]/Runtime/Scripts/VertexBufferColors.cs:155)

Unity 2022.3.20f1
GLTFast 6.10.1
Draco 5.1.4

Unable to supply 3D model due to NDA concerns, apologies

@pcareyASM
Copy link

Removing baked vertex colors leaves me with:
InvalidOperationException: The previously scheduled job SortAndNormalizeBoneWeightsJob writes to the Unity.Collections.NativeArray`1[GLTFast.Vertex.VBones] SortAndNormalizeBoneWeightsJob.bones. You must call JobHandle.Complete() on the job SortAndNormalizeBoneWeightsJob, before you can read from the Unity.Collections.NativeArray`1[GLTFast.Vertex.VBones] safely. Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <6f7018b8b8c149e68c4a65a05ac289be>:0) Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <6f7018b8b8c149e68c4a65a05ac289be>:0) Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr[T] (Unity.Collections.NativeArray`1[T] nativeArray) (at <6f7018b8b8c149e68c4a65a05ac289be>:0) GLTFast.VertexBufferBones.ScheduleVertexBonesJob (System.Int32 weightsAccessorIndex, System.Int32 jointsAccessorIndex, System.Int32 offset, GLTFast.IGltfBuffers buffers) (at ./Library/PackageCache/[email protected]/Runtime/Scripts/VertexBufferBones.cs:47)

Im pretty sure we need bone weights, so this isnt great :D

@FnSolo
Copy link
Author

FnSolo commented Feb 13, 2025

@pcareyASM

Well. this is sad, not even erasing vertex colors fix stuff it seems.
Have you tried reverting to glTFast version before the update with making different materialed stuff submeshes instead of separating them to different meshes right inside .glb?

(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.)

@pcareyASM
Copy link

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.

@FnSolo
Copy link
Author

FnSolo commented Feb 15, 2025

@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)
Image

, 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants