Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: optimizing phase not executed even when VRCFury isn't installed #135

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

### Changed
- Reverted the optimizing phase to being invoked by Apply on Play when VRCFury is not installed (#135)

### Removed

Expand Down
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
Loading