Feb 09 2024 05:29 AM
Since updating to the Mesh Unity Toolkit (v5.2315.6), the Content Performance Analyser window no longer opens in the Editor. The error message is:
NullReferenceException: Object reference not set to an instance of an object
Microsoft.Mesh.Toolkit.CPA.Editor.AnalyzerWindow.CreateGUI () (at ./Library/PackageCache/com.microsoft.mesh.toolkit@5.2315.6/mesh.toolkit.cpa/Editor/AnalyzerWindow.cs:96)
This is the `c#` code it fails on:
var window = windowTemplate.Instantiate()
... and this looks like it is a VisualTreeAsset object from Unity UI Toolkit
private VisualTreeAsset windowTemplate;
Feb 20 2024 10:22 AM
Thanks @Lee_Probert for reporting this! I'll check this out and report back if there is a local workaround you can take.
Feb 20 2024 12:16 PM
Good and bad news I wasn't able to reproduce this in v5.2315.6 - but I want to learn how we can fix it for you (and likely others).
If you select the AnalyzerWindow script in the Mesh Toolkit package, do you see a valid "Window Template" specified in the inspector? Or is it set to none?
Feb 21 2024 03:19 AM
Apologies for the confusion ... I am logged in with another account and cannot find a way to switch accounts on this forum.
I have another project using Mesh that is working fine. It has the same Unity version and the same SDK.
Here's a screenshot of the Inspector with the file you have shown above selected. As you can see, there is something definitely wrong with the compilation of that script.
Do you think it is the capitalisation of CPA in the namespace?
Feb 21 2024 10:19 AM
Feb 23 2024 02:16 AM
Deleting the library fixed it. Do you think it has anything to do with the capitalisation in the namespace?
Feb 23 2024 10:30 AM
@Weald_Spatial thanks for verifying that! I think this is a Unity 2022 bug we are trying to track down.
The idea that it could be capitalization in the namespace is interesting, I'm honestly not sure. I wouldn't think that would cause this issue? I'm working on some changes to make this more robust, so this doesn't happen to other people too.
Mar 22 2024 09:56 AM