[3.7.5+] Parallel Import encounters null exception following migration from VRCSettings to VRCPackageSettings
tracked
Dor․
With SDK version 3.7.5 several settings were migrated from the static class
VRCSettings
, existing within the VRCSDKBase-Editor.dll library provided alongside the SDK to VRCPackageSettings
, the change also included a refactor of the class, introducing a static property Instance
, used to get or create an instance of the class, an instance is attempted to be created by the PerceptualPostProcessor
as DPID settings were part of the migration, however this fails because of a null exception:- VRCPackageSettings.Instance.dpidMipmapswithinPerceptualPostProcessorexecutesVRCPackageSettings.Instance_get
- VRCPackageSettings._instanceis null soCreate()is called, which callsLoad()
- Load()and calls within it, includingEnsurePathExists()expectGetPath()to not be null, causing a null exception when it is becauseGetPath()callsGetPathFromType(GetType())which callsUnityEditor.PackageManager.PackageInfo.FindForAssembly(t.Assembly)and returnsnullwhen executed by a worker process,GetPathFromTypethen returnsnull(a comment assumes this would only occur when the SDK is not located within thePackagesfolder) but this execution path was seemingly never tested and so methods that expect valid strings such asDirectory.CreateDirectorywithinEnsurePathExists()throw null exceptions.
Simply resolving the null exceptions is not enough as the current implementation would cause
Load()
to not load any data when it's meant to, leading to VRCPackageSettings.Instance
to contain default values when executed by worker processes (AssetDatabase.IsAssetImportWorkerProcess()
), you cannot simply abort execution because that invalidates the use of Parallel Import and would cause textures marked as "dirty" to not actually be updated to have mipmaps re-generated, a proper solution leading to the same settings file must be implemented, the whole dependency on the assembly's package info seems extreme.This can be easily reproduced on any 3.7.5+ project with Parallel Import enabled (Project Settings -> Editor, mine is configured with 8 desired workers and 2 on standby) by enabling/disabling "Override Kaiser mipmapping" in the SDK settings.
Log In
StormRel
tracked