Skip to content

Commit

Permalink
fix: serialize assets after the initial plugin hook
Browse files Browse the repository at this point in the history
This ensures that we don't have any references from assets to non-assets when passing control to non-NDMF hooks such as VRCF.
  • Loading branch information
bdunderscore committed Sep 21, 2024
1 parent 9b6caee commit 7390727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Fixed
- [#408] Improved performance of `BuildContext.Serialize`

### Changed
- [#408] Unserialized assets will be serialized after the Transforming phase completes (before e.g. VRCFury runs)

### Removed

Expand Down
3 changes: 3 additions & 0 deletions Editor/VRChat/BuildFrameworkPreprocessHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Diagnostics;
using nadena.dev.ndmf.runtime;
using UnityEditor;
using UnityEngine;
using VRC.SDKBase.Editor.BuildPipeline;
using Debug = UnityEngine.Debug;
Expand Down Expand Up @@ -41,6 +42,8 @@ public bool OnPreprocessAvatar(GameObject avatarGameObject)
holder.context = new BuildContext(avatarGameObject, AvatarProcessor.TemporaryAssetRoot);

AvatarProcessor.ProcessAvatar(holder.context, BuildPhase.Resolving, BuildPhase.Transforming);
holder.context.Serialize();

return true;
}
catch (Exception e)
Expand Down

0 comments on commit 7390727

Please sign in to comment.