unitycoder / UnityPointCloudViewer

Point Cloud Viewer and Tools for Unity
https://assetstore.unity.com/packages/tools/utilities/point-cloud-viewer-and-tools-16019?aid=1101lGti
131 stars 15 forks source link

NullReferenceException #110

Closed nvoelzow closed 11 months ago

nvoelzow commented 3 years ago

Every now and then when trying to load large portions of high resolution point clouds I will get this error when using the (original) PointCloudViewerTilesDX11 :

NullReferenceException: Object reference not set to an instance of an object UnityLibrary.MainThread+d__12.MoveNext () (at Assets/PointCloudTools/PointCloudViewerDX11/Scripts/Common/MainThread.cs:74) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)

after this happens no more tiles will be loaded until I restart the Component.

Unfortunately it only happens from time to time, so it's not exactly easy to track down...

unitycoder commented 3 years ago

ok adding to things to check list, i remember seeing this few times, but thought that it was fixed by those while-loops after CallInitBuffers line, to make sure they are ready.

Yangfb91 commented 1 year ago

same issue, The only way is Restart my app.

unitycoder commented 1 year ago

aha, i'll need to check more.. which unity version, and do you have [x] use native arrays, and [x] release tile memory enabled? (just wondering if its related to those)

Yangfb91 commented 1 year ago

image

unitycoder commented 1 year ago

ok, does it happen mostly in the build, less in editor?

unitycoder commented 1 year ago

one thing that you can test (*or email me, so i'll send updated test script)

example, inside InitDX11BufferA() 1st trycatch: image

2nd image

3rd image

Yangfb91 commented 1 year ago

I test my proj mostly in editor,so i am not sure which one happens a lot. And i will test try-catches to get more info.

unitycoder commented 11 months ago

MainThread code has had updates, more in v2.80, should help with some null ref issues.