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
[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)
0
[3.8.1] VRCStation crashes random unrelated scripts in ClientSim
This was figured out after an hour and a half of debugging. Turns out, the ClientSim staiton helper script has a bug that results in broken editor behaviour. Here's a writeup of what went wrong and my quick fix of the issue - the ideal fix is probably to use a GUID instead, but hey. There's a TODO in the SDK on the line that broke. This reproduces in 3.8.0 too, as well as earlier versions. From my postmortem - this was a mysterious crash in AquaFloat, but the bug is not in AquaFloat's code, which is why it sent us on such a wild goose chase. Postmortem: The script was crashing in a GetComponent<Floater>() in OnTriggerExit. GetComponent against an UdonBehaviour works by getting all UdonBehaviour components and matching their internal ID/name/signature (due to it not being a real type at runtime - standard U# behaviour) This was triggering when an object with a VRC Station left its bounding box. The reason why this broke is due to a ClientSim fumble. On game start, if in the editor, ClientSim attaches an UdonBehaviour, and tries to attach a default station behaviour to that. The problem is, the way it does that is it looks for a given .asset under the Assets dir (specifically vrc example stuff) - but VRC no longer places those assets there (or some other script was removing it). This caused an empty UdonBehavior component to be added without an associated Udon VM instance. When the GetComponent lookup ran, it tried to hit the VM instance to get public vars, in order to get the signature. The VM instance was null as a result of this failed load, which caused GetComponent to fail, which crashed the calling script. My quick fix (quick after 1.5 hours lol) was to modify the ClientSim station helper and fix up the path. Hilariously, there's actually a TODO comment talking about finding the asset file "properly".
2
·

tracked

Load More