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.

Cannot encode mesh in latest version.

See original GitHub issue

Tried exporting both a GameObject (default sphere) using Tools > Draco > Encode Selected GameObject and received this error:

InvalidOperationException: The NativeArray can not be Disposed because it was not allocated with a valid allocator.
Unity.Collections.NativeArray`1[T].Dispose () (at <4cc8ec075538416496e5db5d391208ac>:0)
Draco.Encoder.DracoEncoder.EncodeMesh (UnityEngine.Mesh unityMesh, System.Int32 encodingSpeed, System.Int32 decodingSpeed, System.Int32 positionQuantization, System.Int32 normalQuantization, System.Int32 texCoordQuantization, System.Int32 colorQuantization, System.Int32 genericQuantization) (at C:/.../Runtime/Scripts/Encoder/DracoEncoder.cs:234)
Draco.Encoder.DracoEncoder.EncodeMesh (UnityEngine.Mesh unityMesh, UnityEngine.Vector3 worldScale, System.Single precision, System.Int32 encodingSpeed, System.Int32 decodingSpeed, System.Int32 normalQuantization, System.Int32 texCoordQuantization, System.Int32 colorQuantization, System.Int32 genericQuantization) (at C:/.../Runtime/Scripts/Encoder/DracoEncoder.cs:104)
Draco.Editor.DracoEditorEncoder.CompressMeshFilters (UnityEngine.MeshFilter[] meshFilters, System.String directory) (at C:/.../Editor/DracoEditorEncoder.cs:151)
Draco.Editor.DracoEditorEncoder.Compress () (at C:/.../Editor/DracoEditorEncoder.cs:88)

Tried exporting a mesh (read/write enabled obj in assets) using Tools > Draco > Encode Selected Mesh and received this error:

InvalidOperationException: The NativeArray can not be Disposed because it was not allocated with a valid allocator.
Unity.Collections.NativeArray`1[T].Dispose () (at <4cc8ec075538416496e5db5d391208ac>:0)
Draco.Encoder.DracoEncoder.EncodeMesh (UnityEngine.Mesh unityMesh, System.Int32 encodingSpeed, System.Int32 decodingSpeed, System.Int32 positionQuantization, System.Int32 normalQuantization, System.Int32 texCoordQuantization, System.Int32 colorQuantization, System.Int32 genericQuantization) (at C:/.../Runtime/Scripts/Encoder/DracoEncoder.cs:234)
Draco.Editor.DracoEditorEncoder.EncodeMesh (UnityEngine.Mesh mesh, System.String directory) (at C:/.../Editor/DracoEditorEncoder.cs:225)
Draco.Editor.DracoEditorEncoder.EncodeSelectedMeshes () (at C:/.../Editor/DracoEditorEncoder.cs:213)

Also received this error sporadically afterwards:

A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

Same error appeared both when installed using Install-com.atteneder.draco-2.0.0-preview.unitypackage as well as pulling the latest source from github.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
attenedercommented, Apr 8, 2021

I couldn’t reproduce on 2020.3 LTS nor 2021.1. It makes no sense to me to spend time fixing it for 2020.1, so please upgrade to 2020.3 LTS and see if this solves your problem (reopen and provide steps to reproduce otherwise).

Thanks!

0reactions
attenedercommented, Apr 8, 2021

Can i ask you something? @sam598 How did you build dracoenc_unity,dll? I can’t find that dll file in draco unity I got Error at [DllImport(“dracoenc_unity”)] I got same issue A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

You shouldn’t need to build the binaries yourself. This project uses GIT LFS for dll files, so please make sure you have GIT LFS installed when cloning this repository. Otherwise, the binaries are built in this GitHub project’s actions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mesh cannot be decoded after sequential encoding #1013
I have a user-reported error related to a file that becomes invalid (the decoder always fails) after Draco encoding with the sequential method....
Read more >
[ANSYS Meshing] Model Information is incompatible with ...
It occur because the meshing cannot detect the face at the setup option, hence i suggest to match the missing surface for the...
Read more >
SDK for Mesh v1.0.0 with SES "invalid ASCII encoded byte: ...
I am trying to build and debug the Mesh v1.0.0 light-switch server ... then there is a Segger GUI popup "invalid ASCII encoded...
Read more >
TypeError: Cannot call property getEncoder in object
I am trying to encode byte array using java package Base64 in a javascript. Javascript engine is Rhino. Below is the error in...
Read more >
Gotchas — Blender Python API
When working with mesh data you may run into the problem where a script fails to run as expected in Edit-Mode. This is...
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