SDK Bug & Feature Requests

Please check out the following rules and use the provided template when posting a bug report! Off-topic posts will be deleted.http://bit.ly/vrchat-bug-reports
[3.10.2,3.10.3] VRCSceneTemplateInitializer does not create sample scene if UDON preprocessor symbol is defined at first launch since VRCSDK 3.10.2.
VRCSceneTemplateInitializer does not create the default sample scene when the UDON preprocessor symbol is already defined on the first launch. Steps to reproduce Prepare a VRChat Worlds template with the UDON preprocessor symbol already defined. The original report used a project template generated by ALCOM 1.1.5 or earlier. (We added a workaround in 1.1.6.) However, the issue can also be reproduced by modifying a VCC template to include the UDON preprocessor symbol in ProjectSettings.asset . For reference, ALCOM's Worlds template included the UDON preprocessor symbol to reduce the initial Unity launch time by avoiding recompilation of most assemblies. Launch Unity. VRCSceneTemplateInitializer should create the default scene, but it does not. Cause of the bug This bug is triggered by the combination of the following conditions: UdonSharpDataLocator does not exist in the project. This causes Assets/UdonSharp/UtilityScripts to be generated during the first assembly load. The UDON preprocessor symbol is already defined before the first compilation. This causes [InitializeOnLoad] in VRCSceneTemplateInitializer to run during the first assembly load. The sequence of events is as follows: Unity compiles scripts normally. Unity calls the static constructor of VRCSceneTemplateInitializer because of [InitializeOnLoad] . VRCSceneTemplateInitializer checks SessionState.GetBool(HasRunStateKey, false) , which is false , so it sets HasRunStateKey to true and registers an EditorApplication.delayCall to generate VRCDefaultWorldScene . Unity calls some [InitializeOnLoad] methods from UdonSharp, and UdonSharp generates Assets/UdonSharp/UtilityScripts . Unity recompiles Assembly-CSharp and reloads the domain. Note that the registered delayCall is never executed before this reload. Unity calls the static constructor of VRCSceneTemplateInitializer again because of [InitializeOnLoad] . This time, SessionState.GetBool(HasRunStateKey, false) returns true , so nothing happens. As a result, the logic that generates VRCDefaultWorldScene is never executed. (The order of steps 2 and 3 may differ, but the result is the same.) For comparison, the following sequence does not cause the bug when the UDON symbol is not initially defined: Unity compiles scripts normally, but the VRC.SDK3.Editor assembly containing VRCSceneTemplateInitializer is not compiled because of "defineConstraints": ["UDON"] . Unity calls some [InitializeOnLoad] methods from UdonSharp, and UdonSharp generates Assets/UdonSharp/UtilityScripts . EnvConfig.cs checks for VRC.Udon.UdonBehaviour and adds the UDON preprocessor symbol. Unity recompiles all assemblies and reloads the domain. Unity calls the static constructor of VRCSceneTemplateInitializer because of [InitializeOnLoad] . SessionState.GetBool(HasRunStateKey, false) returns false , so it sets HasRunStateKey to true and registers an EditorApplication.delayCall that generates VRCDefaultWorldScene . Unity executes the EditorApplication.delayCall , and VRCDefaultWorldScene is generated correctly. Suggested fix The issue is that HasRunStateKey is set to true before the EditorApplication.delayCall is actually executed. I believe moving the HasRunStateKey assignment into the EditorApplication.delayCall lambda would fix the issue.
13
·
Bug Report
·
available in future release
Package Resolver Tool will remove newer keys from settings.json (resetting VCC 2.5.0+ data)
The Creator Companion 2.5.0 update introduces multiple new keys, including onboardingCompleted and enabledRepos , these new keys are missing from the current Package Resolver Tool release (0.1.29) and no "beta" has been made available. The Resolver class provided within the same package executes several methods that lead to Settings.Load() and internal calls to Settings.SanitizeUserRepos() (which performs Settings.Save() within Settings.Load() ) Additionally, while not exactly documented and not part of the "public API" (and thus could be broken at any time), the package contains full functionality to add/remove repositories from VCC, as well as add/remove packages, when said functionality is utilized, Settings.Load() and Settings.Save() may be used as well. This results the settings.json file being written with an older version of the data structure, removing the newer keys from the file. Updating the package will address the data structure mismatch for now, but this issue will come up again with future updates to the data structure, and projects using older packages will persistently be an issue (more-so than VCC being downgraded, which would cause similar issues). There are several ways to tackle this this: Split the newer properties to a separate class/file Downside: Same issue arises if either file contains new properties in the future. Migrate to a file-name versioned "settings.json" i.e. "settings-v2.json" Downside: Older packages may reference outdated data within older-versioned files (i.e. repositories list may no longer match) Use one of various ways to preserve keys that aren't present in the "current" data structure. Downside: Does not address older package versions that do not contain this functionality, so this may need to be combined with #2. Also posted on GitHub with additional context and reproduction steps https://github.com/vrchat-community/creator-companion/issues/598
2
·
Bug Report
·
available in future release
[SDK 3.8.1+] Excessive SDK console log spam due to undefined log category
In VRCSDK 3.8.1 and later several log invokations ( VRC.Core.Logger.Log() ) in internal SDK assemblies (e.g. VRCSDKBase-Editor.dll and VRCCore-Editor.dll ) as well as VRC.SDKBase.Editor.EnvConfig.cs do not define the log category anymore, resulting in excessive console logging with no real added value to the end user. In 3.7.5 and earlier SDKs with old logger, DebugLevel.All enum was passed as a parameter every time these messages would be logged, resulting in nothing being visible to the end user. From 3.7.6 up to 3.8.0 after SDK logger rewrite, "All" string was passed as a parameter due to the DebugLevel enum getting replaced by a generic category string parameter, still resulting in all messages being hidden. In previous versions of the SDK not a single log entry would appear in the editor's console unless something important was actually happening and the end user should be informed about it. In 3.8.1 many of the category parameters were mysteriously removed, resulting in 14 entries appearing in the console on every assembly reload (see attachments). The increased logging takes up third of the console window's footprint on every assembly reload and makes it very difficult to spot actually important log entries. Below I have listed the different messages originating from DLLs in the SDK with their stack traces. (The rest are primarily from VRC.Editor.EnvConfig:ConfigurePlayerSettings() located in the VRC.SDKBase.Editor assembly) Reloading Assemblies UnityEngine.Debug:Log (object,UnityEngine.Object) VRC.Core.Logger:Log (string,string,UnityEngine.Object) VRC.SDK3.Editor.EditorAssemblies:OnCompileScripts () No local config found at 'C:/Users/[REDACTED]/AppData/LocalLow/[REDACTED]/[REDACTED]\config.json' UnityEngine.Debug:Log (object,UnityEngine.Object) VRC.Core.Logger:Log (string,string,UnityEngine.Object) VRC.Core.LocalConfig:FetchConfig (System.Action,System.Action) VRC.Core.LocalConfig:.ctor (string,bool,bool) VRC.Core.ConfigManager:.cctor () VRC.Editor.EnvConfig:ConfigureSettings () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:125) VRC.Editor.EnvConfig:EditorUpdate () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:91) UnityEditor.EditorApplication:Internal_CallUpdateFunctions () No local config found at 'C:/Users/[REDACTED]/AppData/LocalLow/[REDACTED]/[REDACTED]\null' UnityEngine.Debug:Log (object,UnityEngine.Object) VRC.Core.Logger:Log (string,string,UnityEngine.Object) VRC.Core.LocalConfig:FetchConfig (System.Action,System.Action) VRC.Core.LocalConfig:.ctor (string,bool,bool) VRC.Core.ConfigManager:.cctor () VRC.Editor.EnvConfig:ConfigureSettings () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:125) VRC.Editor.EnvConfig:EditorUpdate () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:91) UnityEditor.EditorApplication:Internal_CallUpdateFunctions () FetchConfig UnityEngine.Debug:Log (object,UnityEngine.Object) VRC.Core.Logger:Log (string,string,UnityEngine.Object) VRC.Core.RemoteConfig:FetchConfig (System.Action,System.Action) VRC.Core.BaseConfig:Init (System.Action,System.Action,bool) VRC.Editor.EnvConfig:ConfigureSettings () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:128) VRC.Editor.EnvConfig:EditorUpdate () (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/EnvConfig.cs:91) UnityEditor.EditorApplication:Internal_CallUpdateFunctions () finshed fetching and set config UnityEngine.Debug:Log (object,UnityEngine.Object) VRC.Core.Logger:Log (string,string,UnityEngine.Object) VRC.Core.RemoteConfig/<>c__DisplayClass1_0:<FetchConfig>b__0 (VRC.Core.ApiContainer) VRC.Core.APIResponseHandler/<HandleResponse>d__5:MoveNext () Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskVoid`1<VRC.Core.APIResponseHandler/<HandleResponse>d__5>:Run () (at ./Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:104) Cysharp.Threading.Tasks.Internal.ContinuationQueue:RunCore () (at ./Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs:194) Cysharp.Threading.Tasks.Internal.ContinuationQueue:Update () (at ./Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs:159) Cysharp.Threading.Tasks.Internal.ContinuationQueue:Run () (at ./Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs:118)
3
·
Bug Report
·
available in future release
Load More