Skip to content

Commit

Permalink
add manual bake avatar in context menu (#234)
Browse files Browse the repository at this point in the history
* add manual bake avatar in context menu

* docs(changelog): Manual Bake avatar context menu for projects with Modular Avatar

---------

Co-authored-by: bd_ <bd_@nadena.dev>
  • Loading branch information
anatawa12 and bdunderscore committed May 12, 2024
1 parent b2c1ddb commit 17e0962
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Manual Bake avatar context menu for projects with Modular Avatar (#234)
- `__Generated` folder is not removed after building avatar (#235)

### Fixed
Expand Down
8 changes: 2 additions & 6 deletions Editor/UI/Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@ static void Init()
Config.OnChange += OnSettingsChanged;
}

// Avoid cluttering the GameObject context menu with duplicate entries. Users are more familiar with MA anyway,
// so we'll keep that entry.
#if !MODULAR_AVATAR
[MenuItem("GameObject/[NDMF] Manual bake avatar", true, 49)]
[MenuItem("GameObject/NDM Framework/Manual bake avatar", true, 49)]
private static bool ValidateManualBakeGameObject()
{
return AvatarProcessor.CanProcessObject(Selection.activeGameObject);
}

[MenuItem("GameObject/[NDMF] Manual bake avatar", false, 49)]
[MenuItem("GameObject/NDM Framework/Manual bake avatar", false, 49)]
private static void ManualBakeGameObject()
{
AvatarProcessor.ProcessAvatarUI(Selection.activeGameObject);
}
#endif

[MenuItem(TOPLEVEL_MANUAL_BAKE_MENU_NAME, true, TOPLEVEL_MANUAL_BAKE_PRIO)]
private static bool ValidateManualBakeToplevel()
Expand Down

0 comments on commit 17e0962

Please sign in to comment.