Workaround a unity bug resulting in broken AV3 debug displays

Thanks to @TCL987 for a hint as to where to start looking!
This commit is contained in:
bd_ 2022-11-08 20:10:56 -08:00
parent ecf62d7c8e
commit 3486adbca2
2 changed files with 15 additions and 2 deletions

View File

@ -27,7 +27,9 @@ using System.IO;
using UnityEditor;
using UnityEngine;
using VRC.SDK3.Avatars.Components;
using VRC.SDK3.Editor;
using VRC.SDKBase.Editor.BuildPipeline;
using VRC.SDKBase.Validation.Performance.Stats;
using Object = UnityEngine.Object;
namespace net.fushizen.modular_avatar.core.editor
@ -122,6 +124,15 @@ namespace net.fushizen.modular_avatar.core.editor
{
UnityEngine.Object.DestroyImmediate(component);
}
// The VRCSDK captures some debug information about animators as part of the build process, prior to invoking
// hooks. For some reason this happens in the ValidateFeatures call on the SDK builder. Reinvoke it to
// refresh this debug info.
var avatar = avatarGameObject.GetComponent<VRCAvatarDescriptor>();
var animator = avatarGameObject.GetComponent<Animator>();
var builder = new VRCSdkControlPanelAvatarBuilder3A();
builder.RegisterBuilder(ScriptableObject.CreateInstance<VRCSdkControlPanel>());
builder.ValidateFeatures(avatar, animator, new AvatarPerformanceStats(false));
}
}
}

View File

@ -1,8 +1,10 @@
{
"name": "net.fushizen.modular-avatar.core.editor",
"references": [
"GUID:fc900867c0f47cd49b6e2ae4ef907300",
"GUID:5718fb738711cd34ea54e9553040911d"
"GUID:fc900867c0f47cd49b6e2ae4ef907300",
"GUID:5718fb738711cd34ea54e9553040911d",
"GUID:6e9c6119ac4eb334284fb7b4bc6d1f05",
"GUID:b906909fcc54f634db50f2cad0f988d9"
],
"includePlatforms": [
"Editor"