SFraissTU/BA_PointCloud

[Bug] Move Center To Transform Position

Closed this issue · 2 comments

Hello Simon,

I found a little bug in the project. Setting moveCenterToTransformPosition bool to true breaks the code.

Here is the console log:

System.ArgumentNullException: Value cannot be null.
Parameter name: obj
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_monitor_enter_v4_internal(object,intptr)
  at BAPointCloudRenderer.CloudController.AbstractPointCloudSet.AddRootNode (BAPointCloudRenderer.CloudData.Node node) [0x00001] in C:\Development\BA_PointCloud\PointCloudRenderer\Assets\Scripts\BAPointCloudRenderer\CloudController\AbstractPointCloudSet.cs:83 
  at BAPointCloudRenderer.CloudController.PointCloudLoader.LoadHierarchy () [0x0005d] in C:\Development\BA_PointCloud\PointCloudRenderer\Assets\Scripts\BAPointCloudRenderer\CloudController\PointCloudLoader.cs:51 
UnityEngine.Debug:LogError(Object)
BAPointCloudRenderer.CloudController.PointCloudLoader:LoadHierarchy() (at Assets/Scripts/BAPointCloudRenderer/CloudController/PointCloudLoader.cs:53)
System.Threading.ThreadHelper:ThreadStart()

I'm currently working with Unity 2018.4.4f1 version and your master git branch without any changes. The only thing I changed was the above-mentioned bool variable.

Have a nice one,
Stavros

Hi!
Thanks for the information and sorry for my late response. I just took a look at it. Interestingly, I have the opposite behaviour. Setting moveCenterToTransformPosition to false breaks the code, while true is working perfectly fine.
However I think I found the source of the problem. Somehow when this value is changed, the order of initializations of the single GameObjects changes. I fixed this on my current working branch, you'll find the necessary changes here.
Simon

This is now fixed on master as well.