Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 000/plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Sep 24, 2023
2 parents c9c9701 + 7edb062 commit 5feee0a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 45 deletions.
7 changes: 4 additions & 3 deletions Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void SetupOutfit(MenuCommand cmd)
Transform rootBone = null, probeAnchor = null;
Bounds bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS;

FindConsistentSettings(avatarRoot, ref probeAnchor, ref rootBone, ref bounds);
FindConsistentSettings(avatarRoot, avatarHips.transform, ref probeAnchor, ref rootBone, ref bounds);

if (probeAnchor == null)
{
Expand All @@ -168,6 +168,7 @@ static void SetupOutfit(MenuCommand cmd)

private static void FindConsistentSettings(
GameObject avatarRoot,
Transform avatarHips,
ref Transform probeAnchor,
ref Transform rootBone,
ref Bounds bounds
Expand Down Expand Up @@ -210,8 +211,8 @@ ref Bounds bounds
{
if (rootBone != skinnedMeshRenderer.rootBone)
{
rootBone = null; // inconsistent configuration
bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS;
rootBone = avatarHips; // inconsistent configuration
bounds = TransformBounds(rootBone, ModularAvatarMeshSettings.DEFAULT_BOUNDS);
}
else if (Vector3.Distance(bounds.center, skinnedMeshRenderer.bounds.center) > 0.01f
|| Vector3.Distance(bounds.extents, skinnedMeshRenderer.bounds.extents) > 0.01f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,40 @@
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using VRC.SDK3.Avatars.ScriptableObjects;
using Object = UnityEngine.Object;

namespace nadena.dev.modular_avatar.core.editor
{
internal class FixupExpressionsMenuPass
{
private const string DEFAULT_EXP_MENU_GUID = "024fb8ef5b3988c46b446863c92f4522";
private const string DEFAULT_EXP_PARAM_GUID = "03a6d797deb62f0429471c4e17ea99a7";

internal static void FixupExpressionsMenu(BuildContext context)
{
context.AvatarDescriptor.customExpressions = true;

var expressionsMenu = context.AvatarDescriptor.expressionsMenu;
if (expressionsMenu == null) return;
if (expressionsMenu == null)
{
var defaultExpMenu = AssetDatabase.LoadAssetAtPath<VRCExpressionsMenu>(
AssetDatabase.GUIDToAssetPath(DEFAULT_EXP_MENU_GUID)
);

expressionsMenu = Object.Instantiate(defaultExpMenu);
context.AvatarDescriptor.expressionsMenu = expressionsMenu;
}

if (context.AvatarDescriptor.expressionParameters == null)
{
var defaultExpParam = AssetDatabase.LoadAssetAtPath<VRCExpressionParameters>(
AssetDatabase.GUIDToAssetPath(DEFAULT_EXP_PARAM_GUID)
);

context.AvatarDescriptor.expressionParameters = Object.Instantiate(defaultExpParam);
}

var parameters = context.AvatarDescriptor.expressionParameters?.parameters
var parameters = context.AvatarDescriptor.expressionParameters.parameters
?? new VRCExpressionParameters.Parameter[0];
var parameterNames = parameters.Select(p=> p.name).ToImmutableHashSet();

Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@algolia/client-search": "^4.19.1",
"@algolia/client-search": "^4.20.0",
"@docusaurus/core": "^2.4.1",
"@docusaurus/preset-classic": "^2.4.1",
"@mdx-js/react": "^1.6.22",
Expand All @@ -30,7 +30,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "^2.0.0",
"@tsconfig/docusaurus": "^2.0.1",
"typescript": "^5.2.2"
},
"resolutions": {
Expand Down
76 changes: 38 additions & 38 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ __metadata:
languageName: node
linkType: hard

"@algolia/cache-common@npm:4.19.1":
version: 4.19.1
resolution: "@algolia/cache-common@npm:4.19.1"
checksum: e4e120b9a573235ef401bb40ab1c1e622c618b79b1185fb2d46d6b28c5996297f157fa92afccf1b9e0e74b6792f222832b9a2f0913d5bf389810376b4a5476a4
"@algolia/cache-common@npm:4.20.0":
version: 4.20.0
resolution: "@algolia/cache-common@npm:4.20.0"
checksum: a46377de8a309feea109aae1283fc9157c73766a4c51e3085870a1fc49f6e33698814379f3bbdf475713fa0663dace86fc90f0466e64469b1b885a0538abace4
languageName: node
linkType: hard

Expand Down Expand Up @@ -98,13 +98,13 @@ __metadata:
languageName: node
linkType: hard

"@algolia/client-common@npm:4.19.1":
version: 4.19.1
resolution: "@algolia/client-common@npm:4.19.1"
"@algolia/client-common@npm:4.20.0":
version: 4.20.0
resolution: "@algolia/client-common@npm:4.20.0"
dependencies:
"@algolia/requester-common": 4.19.1
"@algolia/transporter": 4.19.1
checksum: d9d919e026f2918403d78081946fb84c28fb4c5e58a531b5c01c802477b70fa3c6a6d5766dbe924255c213b093459a3c84d14dee3d61338404517203a24496fd
"@algolia/requester-common": 4.20.0
"@algolia/transporter": 4.20.0
checksum: 88a27b5f8bba38349e1dbe47634e2ee159a413ff1a3baf6a65fbf244835f8d368e9f0a5ccce8bfe94ec405b38608be5bed45bcb140517f3aba6fe3b7045db373
languageName: node
linkType: hard

Expand All @@ -130,14 +130,14 @@ __metadata:
languageName: node
linkType: hard

"@algolia/client-search@npm:^4.19.1":
version: 4.19.1
resolution: "@algolia/client-search@npm:4.19.1"
"@algolia/client-search@npm:^4.20.0":
version: 4.20.0
resolution: "@algolia/client-search@npm:4.20.0"
dependencies:
"@algolia/client-common": 4.19.1
"@algolia/requester-common": 4.19.1
"@algolia/transporter": 4.19.1
checksum: 16f1112bdaba60e0258f8a024f5d90d601c61263faca500a8462fa0c6c767b82dbe5ea4ae616bd9ed41dd27a6c8f233afdb47bdd98e56edcf43c6dcb119079cf
"@algolia/client-common": 4.20.0
"@algolia/requester-common": 4.20.0
"@algolia/transporter": 4.20.0
checksum: 9fb6624dab6753f336f3207ee2af3558baeec4772ef739b6f6ed6a754c366e2e8d62cbf1cf8b28d5f763bec276a0a5fc36db2bf6f53a707890a411afcf550e92
languageName: node
linkType: hard

Expand All @@ -155,10 +155,10 @@ __metadata:
languageName: node
linkType: hard

"@algolia/logger-common@npm:4.19.1":
version: 4.19.1
resolution: "@algolia/logger-common@npm:4.19.1"
checksum: 87659bdf11573c3aa44dff573e008ff5c8e3f8968d711ecb131387825779b827c6c5204554acdf1887ba079b8581cb35e519d0550fb1f520ef7d91166df62927
"@algolia/logger-common@npm:4.20.0":
version: 4.20.0
resolution: "@algolia/logger-common@npm:4.20.0"
checksum: 06ed28f76b630c8e7597534b15138ab6f71c10dfc6e13f1fb1b76965b39c88fd1d9cb3fe6bb9d046de6533ebcbe5ad92e751bc36fabe98ceda39d1d5f47bb637
languageName: node
linkType: hard

Expand Down Expand Up @@ -187,10 +187,10 @@ __metadata:
languageName: node
linkType: hard

"@algolia/requester-common@npm:4.19.1":
version: 4.19.1
resolution: "@algolia/requester-common@npm:4.19.1"
checksum: b6e076021042638149393952ec24f4740dbd09c9896447378cc4b25c8baeab5372653ac037269a6716e05f6920ecd1bb5015aca26c78e68aa32bdd3c103e0d13
"@algolia/requester-common@npm:4.20.0":
version: 4.20.0
resolution: "@algolia/requester-common@npm:4.20.0"
checksum: 8580ffd2be146bbdb5d4a57668bba4a5014f406cb2e5c65f596db6babab46c48d30c6e4732034ee1f987970aa27dcdab567959d654fa5fa74c4bcaf98312a724
languageName: node
linkType: hard

Expand All @@ -214,14 +214,14 @@ __metadata:
languageName: node
linkType: hard

"@algolia/transporter@npm:4.19.1":
version: 4.19.1
resolution: "@algolia/transporter@npm:4.19.1"
"@algolia/transporter@npm:4.20.0":
version: 4.20.0
resolution: "@algolia/transporter@npm:4.20.0"
dependencies:
"@algolia/cache-common": 4.19.1
"@algolia/logger-common": 4.19.1
"@algolia/requester-common": 4.19.1
checksum: 2835d917c5cbf3c56200a2038a6968327cac44b677a5e351efe1c9bdecb620452ff8c95bf42f0531072dbb9ce3d5c1ea57464a1f4c2cdc1ac4d9e369771d9499
"@algolia/cache-common": 4.20.0
"@algolia/logger-common": 4.20.0
"@algolia/requester-common": 4.20.0
checksum: f834d5c8fcb7dfa9b7044cb81e9fab44a32f9dd0c3868a0f85fe0de4f4d27ad11fdc9c3c78541bc944c2593f4be56517a8ce593309d062b8a46ca0d6fcb5dcbc
languageName: node
linkType: hard

Expand Down Expand Up @@ -2701,10 +2701,10 @@ __metadata:
languageName: node
linkType: hard

"@tsconfig/docusaurus@npm:^2.0.0":
version: 2.0.0
resolution: "@tsconfig/docusaurus@npm:2.0.0"
checksum: 39adca336d9d8d6838c982212e6661c3d211d02244be17861cae4e16b9b5ee9aa0f2d48099649417794b0c2b7661e53905615f94ffb4b5608a326f5b55194e2f
"@tsconfig/docusaurus@npm:^2.0.1":
version: 2.0.1
resolution: "@tsconfig/docusaurus@npm:2.0.1"
checksum: 63bebda70d83c56f95a90176d2e188e1ea9c08c23b499e5e7b292ebfae0ce7117f712809828ed21ae3b8440daf22191d6bf71bf2575f9bd474a51b1770ca30cc
languageName: node
linkType: hard

Expand Down Expand Up @@ -7372,12 +7372,12 @@ __metadata:
version: 0.0.0-use.local
resolution: "modular-avatar-docs@workspace:."
dependencies:
"@algolia/client-search": ^4.19.1
"@algolia/client-search": ^4.20.0
"@docusaurus/core": ^2.4.1
"@docusaurus/module-type-aliases": 2.4.1
"@docusaurus/preset-classic": ^2.4.1
"@mdx-js/react": ^1.6.22
"@tsconfig/docusaurus": ^2.0.0
"@tsconfig/docusaurus": ^2.0.1
clsx: ^2.0.0
prism-react-renderer: ^1.3.5
react: ^17.0.2
Expand Down

0 comments on commit 5feee0a

Please sign in to comment.