Skip to content

Commit

Permalink
fix: partial fix for test build button becoming disabled after test b…
Browse files Browse the repository at this point in the history
…uild (#518)

This fixes an issue where the "test build" button would become disabled after testing an avatar which is not at the root of the scene. Note that the underlying issue (#493) remains outstanding for now, but this workaround should deal with the immediate bug report.

Closes: #493
  • Loading branch information
bdunderscore authored Jan 25, 2025
1 parent 12e2805 commit 4b17f14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Performance improvements (#515 #516)
- "Test build" button is disabled after test-building an avatar that is not a scene root (#518)

### Changed

Expand Down
11 changes: 11 additions & 0 deletions Editor/ErrorReporting/UI/ErrorReportWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ private void TestBuild()
{
if (_avatarRoot == null) return;

var currentAvatar = _avatarRoot;
var clone = Instantiate(_avatarRoot);

try
Expand All @@ -236,6 +237,16 @@ private void TestBuild()
AvatarProcessor.ProcessAvatar(clone);

CurrentReport = ErrorReport.Reports.FirstOrDefault();

// HACK: If the avatar is not at the root of the scene, we end up being unable to find it (because the
// clone is at the root). For now, we force reset the avatar root here, but we should find a more
// reliable way to find the original avatar. This probably needs to be plugged into the platform API
// system, so for now we'll do this workaround to ensure that the test build button remains enabled.
// See https://github.com/bdunderscore/ndmf/issues/517

// Note: We avoid the property accessor as it would clear the CurrentReport property.
_avatarRoot = currentAvatar;
UpdateContents();
}
finally
{
Expand Down

0 comments on commit 4b17f14

Please sign in to comment.