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
UnityEventFilter removes events from non-whitelisted components
UnityEventFilter interferes with non-VRCSDK related components, causing UnityEvents to be wiped out on any object in the scene if they target forbidden types, methods or objects. I'm heavily relying on UnityEvents for build actions, making the creator workflow significantly easier by allowing the utilization of several build time callbacks to invoke UnityEvents, however, UnityEventFilter's overzealous reach breaks this functionality for no apparent reason. I would suggest comparing the list of components for filtering against the already existing component whitelist that exists in the SDK, since the build action components will be removed on build regardless, they just need to exist for the duration of the scene processing to get their job done, after which they are not a concern in the scope of the scene to be uploaded. As far as I'm aware this problem exists in all versions of the SDK where UnityEventFilter is in use. [UnityEventFilter] Events on 'X' were removed because one of them targeted a prohibited type 'X', method 'Y' or object 'X'. UnityEngine.Debug:LogWarning (object,UnityEngine.Object) VRC.Core.Logger:LogWarning (string,string,UnityEngine.Object) VRC.Core.UnityEventFilter:LogRemoval (string,UnityEngine.Object) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:442) VRC.Core.UnityEventFilter:FilterUnityEvents (System.Collections.Generic.HashSet`1<object>,VRC.Core.UnityEventFilter/TypeInfo,object,UnityEngine.Component) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:360) VRC.Core.UnityEventFilter:FilterUnityEvents (System.Collections.Generic.ICollection`1<UnityEngine.Component>) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:322) VRC.Core.UnityEventFilter:FilterUnityEvents (System.Collections.Generic.List`1<UnityEngine.GameObject>) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:278) VRC.Core.UnityEventFilter:FilterEvents (System.Collections.Generic.List`1<UnityEngine.GameObject>) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:254) VRC.Core.UnityEventFilter:RunFilteringOnPlayModeEntry (UnityEditor.PlayModeStateChange) (at ./Packages/com.vrchat.worlds/Runtime/VRCSDK/SDK3/UnityEventFilter.cs:125) UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange)
0
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
0
[Worlds 3.5.0] VRCSDK may reset VRC Default World Scene
Description Modifications to the VRC Default World Scene will be reset silently (without any confirmation). In VRCSDK Worlds 3.5.0, VRC Default World Scene template is added and VRC Default World Scene based on the template is created if no scene is existing in the Assets folder. However, because AssetDatabase.FindAssets returns an empty array on [InitializeOnLoad] , if AssetDatabase cache is missing, Worlds Sample Scene will be created even if scenes are in the Assets folder. In addition, Since SceneTemplateService.Instantiate will override the existing scene silently, modifications to Assets/Scenes/VRCDefaultWorldScene.unity will be reverted. This problem is very problematic because AssetDatabase cache is missing when restoring a project from backup. Backup created by VCC will not include Library folder, so the first startup of Unity doesn't have AssetDatabase cache. Steps to Reproduce Create and open VRCSDK Worlds 3.5.0 project Modify VRCDefaultWorldScene and save Close Unity Remove Library folder Reopen project Modifications to the VRCDefaultWorldScene are reverted. Suggestions Currently, In the VRCSceneTemplateInitializer.cs , AssetDatabase.FindAssets is called on the [InitializeOnLoad] and Instantiated scene in delayCall. I confirmed moving AssetDatabase.FindAssets into delayCall will fix this problem. In addition, I think it’s better to just instantiate VRCDefaultWorldScene template without saving a scene for several reasons. (I mean pass null for third parameter of SceneTemplateService.Instantiate ) First, saving to the exactly same path will cause to unexpectedly override our scene on importing unity package. Many VRChat creators don’t understand unity much. Some (especially for beginners) creators use Assets/Scenes/SampleScene.unity of the initialized unity project for contents creation. However, since the GUID of the SampleScene is exactly the same for all projects in the world, It’s happening to replace modified SampleScene.unity (or renamed ones) with SampleScene.unity from unitypackage unexpectedly. (GUID of VRCDefaultWorldScene.unity is different for each project, but the path is the same, so It is still likely to override VRCDefaultWorldScene.unity unexpectedly.) Users should be aware of which file is included in unity package, but I think it’s good to avoid this problem. Secondly, not saving to disk initially will force creators to think about where the scene is. As mentioned above, beginner VRChat creators do not know about scenes, and I often see them confused when a previously opened scene does not reopen upon startup. I think letting creators think about scenes is good. not save default scene automatically, just open in-memory scene on the startup and let users save a scene manually because it lets users know something is saved to file. Conclusion Modifications to the VRC Default World Scene will be reset silently, so please fix the problem. This problem is very problematic because VRC Default World Scene will be reset silently when restoring the project from backup. As one of the ways to fix this problem, I think it might be good to let creators choose the scene path manually instead of automatically save to Assets/Scenes/VRCDefaultWorldScene.unity .
4
Uploading Avatar may freeze when antivirus software holds handle for lastly uploaded .vrca files
When we uploaded multiple avatars in a row relatively quickly, we encountered an issue where the upload process would freeze without any error message shown on the console or in the log files. This issue comes from two main causes: Firstly, the VRChat SDK silently ignores exceptions that occur in VRC_SdkBuilder.RunExportAvatarBlueprint . The catch clauses has comment // Errors are handled by the error callback , but most of the exceptions do not initiate error callback, including this one. Secondly, the VRChat SDK does not handle the exception occurred when trying to delete the last uploaded .vrca file. Removing the last uploaded .vrca file is not a critical step in the upload process, so it should not cause upload to freeze. However, currently, if the deletion fails, the upload process will not continue, leading to a freeze. When we replaced catch clauses to catch (Exception e) { Debug.LogError(e); } , we were able to see the following error message in the console: System.IO.IOException: The process cannot access the file 'C:\Users\****\AppData\Local\Temp\****\****\637e8e6c-8eb6-4cd2-a651-241fb7aa6ed3.vrca' because it is being used by another process. at System.IO.FileSystem.DeleteFile (System.String fullPath) [0x0001a] in <27124aa0e30a41659b903b822b959bc7>:0 at System.IO.File.Delete (System.String path) [0x00014] in <27124aa0e30a41659b903b822b959bc7>:0 at VRC.SDK3.Builder.VRCAvatarBuilder.ExportCurrentAvatarResource (UnityEngine.Object avatarResource, System.Boolean testAsset, System.Boolean buildAssetBundle, System.String& avatarPrefabPath, System.Action`1[T] onProgress, System.Action`1[T] onContentProcessed) [0x003bc] in <81261fc1c1e94d15bda5671000ac0e16>:0 at VRC.SDK3.Builder.VRCAvatarBuilder.ExportAvatarBlueprint (UnityEngine.GameObject externalReference) [0x00021] in <81261fc1c1e94d15bda5671000ac0e16>:0 at VRC.SDK3A.Editor.VRCSdkControlPanelAvatarBuilder.Build (UnityEngine.GameObject target, System.Boolean testAvatar) [0x0040b] in .\Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\VRCSdkControlPanelAvatarBuilder.cs:2600 UnityEngine.StackTraceUtility:ExtractStackTrace () UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) UnityEngine.Logger:Log (UnityEngine.LogType,object) UnityEngine.Debug:LogError (object) VRC.SDK3A.Editor.VRCSdkControlPanelAvatarBuilder/<Build>d__132:MoveNext () (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/VRCSdkControlPanelAvatarBuilder.cs:2605) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run () System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation/<>c:<.cctor>b__7_0 (object) UnityEngine.UnitySynchronizationContext/WorkRequest:Invoke () UnityEngine.UnitySynchronizationContext:Exec () UnityEngine.UnitySynchronizationContext:ExecuteTasks () When we disabled the real-time protection of the antivirus software for the temporary folder, the upload process worked as expected without freezing. Therefore, we conclude that the issue is related to antivirus software holding a handle on the last uploaded .vrca file, which prevents it from being deleted.
1
·

tracked

[VRCSDK 3.8.1] VRCSDK throws exceptions when encountering an avatar descriptor with an empty animation layer list but "customize animation layers" on
On a humanoid avatar, when the VRC Avatar Descriptor has an empty baseAnimationLayers list but customizeAnimationLayers is false, then in InitAnimLayer a NullReferenceException is thrown from element.FindPropertyRelative("type").enumValueIndex = (int)type; This is caused by EnforceAnimLayerSetup assuming there is at least one layer, and calling InitAnimLayer with index=1; list.InsertArrayElementAtIndex(1) then fails, and so the subsequent GetArrayElementAtIndex also returns null. This issue was encountered by a user of Vroid's Xavatar, and reported to me as a potential Modular Avatar bug (MA invokes this code to normalize animator layers, but this also happens just by opening the inspector normally). Stack traces: Retrieving array element that was out of bounds UnityEditor.SerializedProperty:InsertArrayElementAtIndex (int) AvatarDescriptorEditor3:InitAnimLayer (UnityEditor.SerializedProperty,VRC.SDK3.Avatars.Components.VRCAvatarDescriptor/AnimLayerType,bool,int) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:128) AvatarDescriptorEditor3:EnforceAnimLayerSetup (bool) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:166) AvatarDescriptorEditor3:OnEnable () (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3.cs:41) Retrieving array element that was out of bounds UnityEditor.SerializedProperty:GetArrayElementAtIndex (int) AvatarDescriptorEditor3:InitAnimLayer (UnityEditor.SerializedProperty,VRC.SDK3.Avatars.Components.VRCAvatarDescriptor/AnimLayerType,bool,int) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:129) AvatarDescriptorEditor3:EnforceAnimLayerSetup (bool) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:166) AvatarDescriptorEditor3:OnEnable () (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3.cs:41) NullReferenceException: Object reference not set to an instance of an object AvatarDescriptorEditor3.InitAnimLayer (UnityEditor.SerializedProperty list, VRC.SDK3.Avatars.Components.VRCAvatarDescriptor+AnimLayerType type, System.Boolean isDefault, System.Int32 index) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:131) AvatarDescriptorEditor3.EnforceAnimLayerSetup (System.Boolean isOnEnable) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3AnimLayerInit.cs:166) AvatarDescriptorEditor3.OnEnable () (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/Components3/VRCAvatarDescriptorEditor3.cs:41)
1
·

tracked

Load More