Skip to content

Commit

Permalink
fix: optimizing phase not executed even when VRCFury isn't installed
Browse files Browse the repository at this point in the history
Closes: #129
  • Loading branch information
bdunderscore committed Jan 28, 2024
1 parent 7c82432 commit 7bb1a4f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Editor/ApplyOnPlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#region

using System;
using System.Linq;
using nadena.dev.ndmf.config;
using nadena.dev.ndmf.runtime;
using UnityEditor;
Expand Down Expand Up @@ -62,9 +64,15 @@ private static void MaybeProcessAvatar(ApplyOnPlayGlobalActivator.OnDemandSource
{
var avatar = RuntimeUtil.FindAvatarInParents(component.transform);
if (avatar == null) return;

var furyInstalled = AppDomain.CurrentDomain.GetAssemblies()
.Any(a => a.GetName().Name == "VRCFury");

// Skip optimizing the avatar as we might have VRCFury or similar running after us.
AvatarProcessor.ProcessAvatar(avatar.gameObject, BuildPhase.Transforming);
// Skip optimizing the avatar if VRCFury is installed, as VRCFury will run after optimizations
// and might be broken by e.g. blendshape removal, etc.
var lastPhase = furyInstalled ? BuildPhase.Transforming : BuildPhase.Optimizing;

AvatarProcessor.ProcessAvatar(avatar.gameObject, lastPhase);
}
}

Expand Down

0 comments on commit 7bb1a4f

Please sign in to comment.