diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6d1f30ac..a31b2644 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout logo assets - uses: actions/checkout@v3 + uses: actions/checkout@v4 if: startsWith(github.ref, 'refs/tags/') with: repository: bdunderscore/modular-avatar-images diff --git a/.github/workflows/build-test-docs.yml b/.github/workflows/build-test-docs.yml index aaef613a..3cfae25e 100644 --- a/.github/workflows/build-test-docs.yml +++ b/.github/workflows/build-test-docs.yml @@ -30,10 +30,10 @@ jobs: with: node-version: 18 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: bdunderscore/modular-avatar-images path: modular-avatar-images diff --git a/.github/workflows/export-gameci-license.yml b/.github/workflows/export-gameci-license.yml new file mode 100644 index 00000000..f10e3fae --- /dev/null +++ b/.github/workflows/export-gameci-license.yml @@ -0,0 +1,56 @@ +name: Export GameCI license +on: + workflow_dispatch: {} + +jobs: + export: + runs-on: ubuntu-latest + steps: + - name: Setup + run: | + sudo apt-get -y install gnupg + gpg --import <(); + var expMenu = descriptor.expressionsMenu; + + Assert.AreEqual(3, expMenu.controls.Count); + + Assert.AreEqual("testparam", expMenu.controls[0].parameter.name); + Assert.AreEqual(256, expMenu.controls[0].icon.height); + Assert.AreEqual(192, expMenu.controls[0].icon.width); + + Assert.AreEqual("", expMenu.controls[1].parameter.name); + Assert.AreEqual(192, expMenu.controls[1].icon.height); + Assert.AreEqual(256, expMenu.controls[1].icon.width); + + Assert.AreEqual("testparam", expMenu.controls[2].subParameters[0].name); + Assert.AreEqual("", expMenu.controls[2].subParameters[1].name); + + foreach (var label in expMenu.controls[2].labels) + { + Assert.LessOrEqual(label.icon.width, 256); + Assert.LessOrEqual(label.icon.height, 256); + } + } + } +} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs.meta b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionMenuFixupTests.cs.meta similarity index 83% rename from Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs.meta rename to Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionMenuFixupTests.cs.meta index e2b96474..978bbc9b 100644 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs.meta +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionMenuFixupTests.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d75fcaecb8b9e7f4bbe783e5f4c9838a +guid: 9c1bfdcd79a862e40a2c896f18ae0ca0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab new file mode 100644 index 00000000..84ad5fdf --- /dev/null +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab @@ -0,0 +1,322 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6204877465042736622 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6776946804248067904} + - component: {fileID: 5187824885137632139} + - component: {fileID: 1283586302596586804} + - component: {fileID: 3838643251041431458} + m_Layer: 0 + m_Name: ExpressionsMenuFixupTestAvatar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6776946804248067904 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6204877465042736622} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 20.384737, y: 1.6344047, z: 3.1785903} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5187824885137632139 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6204877465042736622} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 542108242, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: + ViewPosition: {x: 0, y: 1.6, z: 0.2} + Animations: 0 + ScaleIPD: 1 + lipSync: 0 + lipSyncJawBone: {fileID: 0} + lipSyncJawClosed: {x: 0, y: 0, z: 0, w: 1} + lipSyncJawOpen: {x: 0, y: 0, z: 0, w: 1} + VisemeSkinnedMesh: {fileID: 0} + MouthOpenBlendShapeName: Facial_Blends.Jaw_Down + VisemeBlendShapes: [] + unityVersion: + portraitCameraPositionOffset: {x: 0, y: 0, z: 0} + portraitCameraRotationOffset: {x: 0, y: 1, z: 0, w: -0.00000004371139} + networkIDs: [] + customExpressions: 1 + expressionsMenu: {fileID: 11400000, guid: f2f0d7df290a6bc48bcb1efe964c6281, type: 2} + expressionParameters: {fileID: 11400000, guid: 16746f1009cf9ae4fb8391d44dc8257a, + type: 2} + enableEyeLook: 0 + customEyeLookSettings: + eyeMovement: + confidence: 0.5 + excitement: 0.5 + leftEye: {fileID: 0} + rightEye: {fileID: 0} + eyesLookingStraight: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingUp: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingDown: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingLeft: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingRight: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidType: 0 + upperLeftEyelid: {fileID: 0} + upperRightEyelid: {fileID: 0} + lowerLeftEyelid: {fileID: 0} + lowerRightEyelid: {fileID: 0} + eyelidsDefault: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsClosed: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsLookingUp: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsLookingDown: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsSkinnedMesh: {fileID: 0} + eyelidsBlendshapes: + customizeAnimationLayers: 0 + baseAnimationLayers: + - isEnabled: 0 + type: 0 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 4 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 5 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + specialAnimationLayers: + - isEnabled: 0 + type: 6 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 7 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 8 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + AnimationPreset: {fileID: 0} + animationHashSet: [] + autoFootsteps: 1 + autoLocomotion: 1 + collider_head: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_torso: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_footR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_footL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_handR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_handL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerIndexL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerMiddleL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerRingL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerLittleL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerIndexR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerMiddleR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerRingR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerLittleR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} +--- !u!114 &1283586302596586804 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6204877465042736622} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1427037861, guid: 4ecd63eff847044b68db9453ce219299, type: 3} + m_Name: + m_EditorClassIdentifier: + launchedFromSDKPipeline: 0 + completedSDKPipeline: 0 + blueprintId: + contentType: 0 + assetBundleUnityVersion: + fallbackStatus: 0 +--- !u!95 &3838643251041431458 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6204877465042736622} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt.meta b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab.meta similarity index 62% rename from Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt.meta rename to Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab.meta index 028d199a..48f3e97c 100644 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt.meta +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/ExpressionsMenuFixupTestAvatar.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: ca344e99cdd379947ab3e8e5b346428c -TextScriptImporter: +guid: 188009d5762353447bb0a11e779c1abb +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset new file mode 100644 index 00000000..ba1df815 --- /dev/null +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1506855854, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: parameters + m_EditorClassIdentifier: + parameters: + - name: testparam + valueType: 0 + saved: 1 + defaultValue: 0 + networkSynced: 1 diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies.meta b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset.meta similarity index 52% rename from Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies.meta rename to Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset.meta index 72fd76ec..8f6bed4c 100644 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies.meta +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/parameters.asset.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: f4e8a9c940ed84943bb0433246ec42bb -folderAsset: yes -DefaultImporter: +guid: 16746f1009cf9ae4fb8391d44dc8257a +NativeFormatImporter: externalObjects: {} + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset new file mode 100644 index 00000000..c19977fa --- /dev/null +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset @@ -0,0 +1,55 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -340790334, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: test menu + m_EditorClassIdentifier: + controls: + - name: retain + icon: {fileID: 2800000, guid: adf82baccd885794cb63be6da2bf289e, type: 3} + type: 101 + parameter: + name: testparam + value: 1 + style: 0 + subMenu: {fileID: 0} + subParameters: [] + labels: [] + - name: redact + icon: {fileID: 2800000, guid: 9bb00a795610e1f4998410320612d6bd, type: 3} + type: 101 + parameter: + name: redact + value: 1 + style: 0 + subMenu: {fileID: 0} + subParameters: [] + labels: [] + - name: New Control + icon: {fileID: 0} + type: 201 + parameter: + name: + value: 1 + style: 0 + subMenu: {fileID: 0} + subParameters: + - name: testparam + - name: redact + labels: + - name: + icon: {fileID: 2800000, guid: 9bb00a795610e1f4998410320612d6bd, type: 3} + - name: + icon: {fileID: 2800000, guid: adf82baccd885794cb63be6da2bf289e, type: 3} + - name: + icon: {fileID: 2800000, guid: 9bb00a795610e1f4998410320612d6bd, type: 3} + - name: + icon: {fileID: 2800000, guid: adf82baccd885794cb63be6da2bf289e, type: 3} diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt.meta b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset.meta similarity index 52% rename from Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt.meta rename to Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset.meta index 649b3193..24b88168 100644 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt.meta +++ b/Assets/_ModularAvatar/EditModeTests/ExpressionMenuFixupTests/test menu.asset.meta @@ -1,7 +1,8 @@ fileFormatVersion: 2 -guid: 1a7454bc513adb84d9ae85ed7e7268ba -TextScriptImporter: +guid: f2f0d7df290a6bc48bcb1efe964c6281 +NativeFormatImporter: externalObjects: {} + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/_ModularAvatar/EditModeTests/GameObjectGC/GameObjectGC.cs b/Assets/_ModularAvatar/EditModeTests/GameObjectGC/GameObjectGC.cs index 4e36c2d3..711cad4e 100644 --- a/Assets/_ModularAvatar/EditModeTests/GameObjectGC/GameObjectGC.cs +++ b/Assets/_ModularAvatar/EditModeTests/GameObjectGC/GameObjectGC.cs @@ -1,4 +1,5 @@ -using modular_avatar_tests; +using System.Linq; +using modular_avatar_tests; using nadena.dev.modular_avatar.core.editor; using NUnit.Framework; using UnityEngine; @@ -38,4 +39,22 @@ public void RetainEndBones() Assert.True(bone2 != null); Assert.True(bone3 == null); } + + [Test] + public void RetainArmatureHack() + { + var fake_humanoid = CreatePrefab("FakeHumanoid.prefab"); + var avdesc = fake_humanoid.GetComponent(); + + var armature = new GameObject(); + armature.name = "Armature"; + armature.transform.parent = fake_humanoid.transform; + armature.transform.SetSiblingIndex(0); + + new GCGameObjectsPass(new BuildContext(avdesc), fake_humanoid).OnPreprocessAvatar(); + AvatarProcessor.ProcessAvatar(fake_humanoid); + + Assert.AreEqual(2, + avdesc.GetComponentsInChildren().Count(t => t.gameObject.name == "Armature")); + } } \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt deleted file mode 100644 index 66437210..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2016 Adam Reeve - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt.meta deleted file mode 100644 index a0fc49d8..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.License.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1417544c34d9a4f4aacebf76247940a9 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll deleted file mode 100644 index e0216727..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll.meta deleted file mode 100644 index cc2ba32c..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/SemanticVersioning.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 65d82c6541a90644390df2caa29c2209 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt deleted file mode 100644 index 37ec93a1..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.License.txt +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll deleted file mode 100644 index 1600c057..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll.meta deleted file mode 100644 index 53d8dd73..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 0c56563958a156145b708466db0e35cc -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt deleted file mode 100644 index 8dada3ed..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.File.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md deleted file mode 100644 index d9f6ecd2..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md +++ /dev/null @@ -1,23 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2020 Kurai András -Copyright (c) 2022-Present VRChat Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md.meta deleted file mode 100644 index 597bf25a..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.License.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 598e678340a8c6e4e9a3debcdc6a9579 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll deleted file mode 100644 index eb78a0fe..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll.meta deleted file mode 100644 index 932224a5..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.Sinks.Unity3D.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: cfc1421f162f0354d8a64d569417d9c9 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll deleted file mode 100644 index dab49d2c..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll.meta deleted file mode 100644 index 2ef53f97..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/Serilog.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 702a5a2579f8edf43b5e7bfb2f52e2c6 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt deleted file mode 100644 index d4f29245..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Antoine Aubry and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt.meta deleted file mode 100644 index a8bc0bc1..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.License.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3547422b181c5af49901e93c1122bbdd -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll deleted file mode 100644 index d0bbb751..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll.meta deleted file mode 100644 index 4b5ebc37..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/YamlDotNet.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 9fd667e0ec0d1d84c9e17dad407f2272 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll deleted file mode 100644 index 485d75af..00000000 Binary files a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll and /dev/null differ diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll.meta deleted file mode 100644 index 71e73f6c..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Dependencies/vpm-core-lib.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 140aba2a5b760e94cb3ed9f39a52610a -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker.meta deleted file mode 100644 index b14bc72c..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5da3ddd939264fc40a113d615f3ca77a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs b/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs deleted file mode 100644 index 02f4b71a..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindow.cs +++ /dev/null @@ -1,422 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using UnityEditor; -using UnityEditor.UIElements; -using UnityEngine; -using UnityEngine.UIElements; -using VRC.PackageManagement.Core.Types.Packages; - -namespace VRC.PackageManagement.PackageMaker -{ - public class PackageMakerWindow : EditorWindow - { - // VisualElements - private VisualElement _rootView; - private TextField _targetAssetFolderField; - private TextField _packageIDField; - private Button _actionButton; - private EnumField _targetVRCPackageField; - private static string _projectDir; - private PackageMakerWindowData _windowData; - - private void LoadDataFromSave() - { - if (!string.IsNullOrWhiteSpace(_windowData.targetAssetFolder)) - { - _targetAssetFolderField.SetValueWithoutNotify(_windowData.targetAssetFolder); - } - - _packageIDField.SetValueWithoutNotify(_windowData.packageID); - _targetVRCPackageField.SetValueWithoutNotify(_windowData.relatedPackage); - - RefreshActionButtonState(); - } - - private void OnEnable() - { - _projectDir = Directory.GetParent(Application.dataPath).FullName; - Refresh(); - } - - [MenuItem("VRChat SDK/Utilities/Package Maker")] - public static void ShowWindow() - { - PackageMakerWindow wnd = GetWindow(); - wnd.titleContent = new GUIContent("Package Maker"); - } - - [MenuItem("Assets/Export VPM as UnityPackage")] - private static void ExportAsUnityPackage() - { - var foldersToExport = new List(); - StringBuilder exportFilename = new StringBuilder("exported"); - foreach (string guid in Selection.assetGUIDs) - { - string selectedFolder = AssetDatabase.GUIDToAssetPath(guid); - var manifestPath = Path.Combine(selectedFolder, VRCPackageManifest.Filename); - var manifest = VRCPackageManifest.GetManifestAtPath(manifestPath); - if (manifest == null) - { - Debug.LogWarning( - $"Could not read valid Package Manifest at {manifestPath}. You need to create this first to export a VPM Package."); - continue; - } - - exportFilename.Append($"-{manifest.Id}-{manifest.Version}"); - foldersToExport.Add(selectedFolder); - } - - exportFilename.Append(".unitypackage"); - var exportDir = Path.Combine(Directory.GetCurrentDirectory(), "Exports"); - Directory.CreateDirectory(exportDir); - AssetDatabase.ExportPackage - ( - foldersToExport.ToArray(), - Path.Combine(exportDir, exportFilename.ToString()), - ExportPackageOptions.Recurse | ExportPackageOptions.Interactive - ); - } - - private void Refresh() - { - if (_windowData == null) - { - _windowData = PackageMakerWindowData.GetOrCreate(); - } - - if (_rootView == null) return; - - if (_windowData != null) - { - LoadDataFromSave(); - } - } - - private void RefreshActionButtonState() - { - _actionButton.SetEnabled( - StringIsValidAssetFolder(_windowData.targetAssetFolder) && - !string.IsNullOrWhiteSpace(_windowData.packageID) - ); - } - - /// - /// Unity calls the CreateGUI method automatically when the window needs to display - /// - private void CreateGUI() - { - if (_windowData == null) - { - _windowData = PackageMakerWindowData.GetOrCreate(); - } - - _rootView = rootVisualElement; - _rootView.name = "root-view"; - _rootView.styleSheets.Add((StyleSheet) Resources.Load("PackageMakerWindowStyle")); - - // Create Target Asset folder and register for drag and drop events - _rootView.Add(CreateTargetFolderElement()); - _rootView.Add(CreatePackageIDElement()); - _rootView.Add(CreateTargetVRCPackageElement()); - _rootView.Add(CreateActionButton()); - - Refresh(); - } - - public enum VRCPackageEnum - { - None = 0, - Worlds = 1, - Avatars = 2, - Base = 3, - UdonSharp = 4, - } - - private VisualElement CreateTargetVRCPackageElement() - { - _targetVRCPackageField = new EnumField("Related VRChat Package", VRCPackageEnum.None); - _targetVRCPackageField.RegisterValueChangedCallback(OnTargetVRCPackageChanged); - var box = new Box(); - box.Add(_targetVRCPackageField); - return box; - } - - private void OnTargetVRCPackageChanged(ChangeEvent evt) - { - _windowData.relatedPackage = (VRCPackageEnum) evt.newValue; - _windowData.Save(); - } - - private VisualElement CreateActionButton() - { - _actionButton = new Button(OnActionButtonPressed) - { - text = "Convert Assets to Package", - name = "action-button" - }; - return _actionButton; - } - - private void OnActionButtonPressed() - { - bool result = EditorUtility.DisplayDialog("One-Way Conversion", - $"This process will move the assets from {_windowData.targetAssetFolder} into a new Package with the id {_windowData.packageID} and give it references to {_windowData.relatedPackage}.", - "Ok", "Wait, not yet."); - if (result) - { - string newPackageFolderPath = Path.Combine(_projectDir, "Packages", _windowData.packageID); - Directory.CreateDirectory(newPackageFolderPath); - var fullTargetAssetFolder = Path.Combine(_projectDir, _windowData.targetAssetFolder); - DoMigration(fullTargetAssetFolder, newPackageFolderPath); - ForceRefresh(); - } - } - - public static void ForceRefresh() - { - MethodInfo method = typeof(UnityEditor.PackageManager.Client).GetMethod("Resolve", - BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); - if (method != null) - method.Invoke(null, null); - - AssetDatabase.Refresh(); - } - - private VisualElement CreatePackageIDElement() - { - var box = new Box() - { - name = "package-name-box" - }; - - _packageIDField = new TextField("Package ID", 255, false, false, '*'); - _packageIDField.RegisterValueChangedCallback(OnPackageIDChanged); - box.Add(_packageIDField); - - box.Add(new Label("Lowercase letters, numbers and dots only.") - { - name = "description", - tooltip = - "Standard practice is reverse domain notation like com.vrchat.packagename. Needs to be unique across VRChat, so if you don't own a domain you can try your username.", - }); - - return box; - } - - private Regex packageIdRegex = new Regex("[^a-z0-9.]"); - - private void OnPackageIDChanged(ChangeEvent evt) - { - if (evt.newValue != null) - { - string newId = packageIdRegex.Replace(evt.newValue, "-"); - _packageIDField.SetValueWithoutNotify(newId); - _windowData.packageID = newId; - _windowData.Save(); - } - - RefreshActionButtonState(); - } - - private VisualElement CreateTargetFolderElement() - { - var targetFolderBox = new Box() - { - name = "editor-target-box" - }; - - _targetAssetFolderField = new TextField("Target Folder"); - _targetAssetFolderField.RegisterCallback(OnTargetAssetFolderDragEnter, - TrickleDown.TrickleDown); - _targetAssetFolderField.RegisterCallback(OnTargetAssetFolderDragLeave, - TrickleDown.TrickleDown); - _targetAssetFolderField.RegisterCallback(OnTargetAssetFolderDragUpdated, - TrickleDown.TrickleDown); - _targetAssetFolderField.RegisterCallback(OnTargetAssetFolderDragPerform, - TrickleDown.TrickleDown); - _targetAssetFolderField.RegisterCallback(OnTargetAssetFolderDragExited, - TrickleDown.TrickleDown); - _targetAssetFolderField.RegisterValueChangedCallback(OnTargetAssetFolderValueChanged); - targetFolderBox.Add(_targetAssetFolderField); - - targetFolderBox.Add(new Label("Drag and Drop an Assets Folder to Convert Above") {name = "description"}); - return targetFolderBox; - } - - #region TargetAssetFolder Field Events - - private bool StringIsValidAssetFolder(string targetFolder) - { - return !string.IsNullOrWhiteSpace(targetFolder) && AssetDatabase.IsValidFolder(targetFolder); - } - - private void OnTargetAssetFolderValueChanged(ChangeEvent evt) - { - string targetFolder = evt.newValue; - - if (StringIsValidAssetFolder(targetFolder)) - { - _windowData.targetAssetFolder = evt.newValue; - _windowData.Save(); - RefreshActionButtonState(); - } - else - { - _targetAssetFolderField.SetValueWithoutNotify(evt.previousValue); - } - } - - private void OnTargetAssetFolderDragExited(DragExitedEvent evt) - { - DragAndDrop.visualMode = DragAndDropVisualMode.None; - } - - private void OnTargetAssetFolderDragPerform(DragPerformEvent evt) - { - var targetFolder = DragAndDrop.paths[0]; - if (!string.IsNullOrWhiteSpace(targetFolder) && AssetDatabase.IsValidFolder(targetFolder)) - { - _targetAssetFolderField.value = targetFolder; - } - else - { - Debug.LogError($"Could not accept {targetFolder}. Needs to be a folder within the project"); - } - } - - private void OnTargetAssetFolderDragUpdated(DragUpdatedEvent evt) - { - if (DragAndDrop.paths.Length == 1) - { - DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - DragAndDrop.AcceptDrag(); - } - else - { - DragAndDrop.visualMode = DragAndDropVisualMode.Rejected; - } - } - - private void OnTargetAssetFolderDragLeave(DragLeaveEvent evt) - { - DragAndDrop.visualMode = DragAndDropVisualMode.None; - } - - private void OnTargetAssetFolderDragEnter(DragEnterEvent evt) - { - if (DragAndDrop.paths.Length == 1) - { - DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - DragAndDrop.AcceptDrag(); - } - } - - #endregion - - #region Migration Logic - - private void DoMigration(string corePath, string targetDir) - { - EditorUtility.DisplayProgressBar("Migrating Package", "Creating Starter Package", 0.1f); - - // Convert PackageType enum to VRC Package ID string - string packageType = null; - switch (_windowData.relatedPackage) - { - case VRCPackageEnum.Avatars: - packageType = "com.vrchat.avatars"; - break; - case VRCPackageEnum.Base: - packageType = "com.vrchat.base"; - break; - case VRCPackageEnum.Worlds: - packageType = "com.vrchat.clientsim"; // we want ClientSim too, need to specify that for now - break; - case VRCPackageEnum.UdonSharp: - packageType = "com.vrchat.udonsharp"; - break; - } - - string parentDir = new DirectoryInfo(targetDir)?.Parent.FullName; - Core.Utilities.CreateStarterPackage(_windowData.packageID, parentDir, packageType); - var allFiles = GetAllFiles(corePath).ToList(); - MoveFilesToPackageDir(allFiles, corePath, targetDir); - - // Clear target asset folder since it should no longer exist - _windowData.targetAssetFolder = ""; - } - - private static IEnumerable GetAllFiles(string path) - { - var excludedPaths = new List() - { - "Editor.meta" - }; - return Directory.EnumerateFiles(path, "*.*", SearchOption.AllDirectories) - .Where( - s => excludedPaths.All(entry => !s.Contains(entry)) - ); - } - - public static void MoveFilesToPackageDir(List files, string pathBase, string targetDir) - { - EditorUtility.DisplayProgressBar("Migrating Package", "Moving Package Files", 0f); - float totalFiles = files.Count; - - for (int i = 0; i < files.Count; i++) - { - try - { - EditorUtility.DisplayProgressBar("Migrating Package", "Moving Package Files", i / totalFiles); - var file = files[i]; - string simplifiedPath = file.Replace($"{pathBase}\\", ""); - - string dest = null; - if (simplifiedPath.Contains("Editor\\")) - { - // Remove extra 'Editor' subfolders - dest = simplifiedPath.Replace("Editor\\", ""); - dest = Path.Combine(targetDir, "Editor", dest); - } - else - { - // Make complete path to Runtime folder - dest = Path.Combine(targetDir, "Runtime", simplifiedPath); - } - - string targetEnclosingDir = Path.GetDirectoryName(dest); - Directory.CreateDirectory(targetEnclosingDir); - var sourceFile = Path.Combine(pathBase, simplifiedPath); - File.Move(sourceFile, dest); - } - catch (Exception e) - { - Debug.LogError($"Error moving {files[i]}: {e.Message}"); - continue; - } - } - - Directory.Delete(pathBase, true); // cleans up leftover folders since only files are moved - EditorUtility.ClearProgressBar(); - } - - // Important while we're doing copy-and-rename in order to rename paths with "Assets" without renaming paths with "Sample Assets" - public static string ReplaceFirst(string text, string search, string replace) - { - int pos = text.IndexOf(search); - if (pos < 0) - { - return text; - } - - return text.Substring(0, pos) + replace + text.Substring(pos + search.Length); - } - - #endregion - } -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs b/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs deleted file mode 100644 index ee580b7c..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.IO; -using UnityEditor; -using UnityEngine; -using VRC.PackageManagement.PackageMaker; - -public class PackageMakerWindowData : ScriptableObject -{ - public static string defaultAssetPath = Path.Combine("Assets", "PackageMakerWindowData.asset"); - public string targetAssetFolder; - public string packageID; - public PackageMakerWindow.VRCPackageEnum relatedPackage; - - public static PackageMakerWindowData GetOrCreate() - { - var existingData = AssetDatabase.AssetPathToGUID(defaultAssetPath); - if (string.IsNullOrWhiteSpace(existingData)) - { - return Create(); - } - else - { - var saveData = AssetDatabase.LoadAssetAtPath(defaultAssetPath); - if (saveData == null) - { - Debug.LogError($"Could not load saved data but the save file exists. Resetting."); - return Create(); - } - return saveData; - } - } - - public static PackageMakerWindowData Create() - { - var saveData = CreateInstance(); - AssetDatabase.CreateAsset(saveData, defaultAssetPath); - AssetDatabase.SaveAssets(); - return saveData; - } - - public void Save() - { - AssetDatabase.SaveAssets(); - } -} diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs.meta deleted file mode 100644 index da310c35..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/PackageMaker/PackageMakerWindowData.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0adae93375f5d5840a30b6e47f324172 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver.meta deleted file mode 100644 index 25636fb8..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0aa72fa778aef5b4cb5fa177c19d3636 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs b/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs deleted file mode 100644 index 3f13c3e5..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs +++ /dev/null @@ -1,199 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Serilog; -using Serilog.Sinks.Unity3D; -using UnityEditor; -using UnityEngine; -using VRC.PackageManagement.Core; -using VRC.PackageManagement.Core.Types; -using VRC.PackageManagement.Core.Types.Packages; -using Version = VRC.PackageManagement.Core.Types.VPMVersion.Version; - -namespace VRC.PackageManagement.Resolver -{ - [InitializeOnLoad] - public class Resolver - { - private const string _projectLoadedKey = "PROJECT_LOADED"; - - private static string _projectDir; - - public static string ProjectDir - { - get - { - if (_projectDir != null) - { - return _projectDir; - } - - try - { - _projectDir = new DirectoryInfo(Assembly.GetExecutingAssembly().Location).Parent.Parent.Parent - .FullName; - return _projectDir; - } - catch (Exception) - { - return ""; - } - } - } - - static Resolver() - { - SetupLogging(); - if (!SessionState.GetBool(_projectLoadedKey, false)) - { -#pragma warning disable 4014 - CheckResolveNeeded(); -#pragma warning restore 4014 - } - } - - private static void SetupLogging() - { - VRCLibLogger.SetLoggerDirectly( - new LoggerConfiguration() - .MinimumLevel.Information() - .WriteTo.Unity3D() - .CreateLogger() - ); - } - - private static async Task CheckResolveNeeded() - { - SessionState.SetBool(_projectLoadedKey, true); - - //Wait for project to finish compiling - while (EditorApplication.isCompiling || EditorApplication.isUpdating) - { - await Task.Delay(250); - } - - try - { - if (string.IsNullOrWhiteSpace(ProjectDir)) - { - return; - } - - if (VPMProjectManifest.ResolveIsNeeded(ProjectDir)) - { - Debug.Log($"Resolve needed."); - var result = EditorUtility.DisplayDialog("VRChat Package Management", - $"This project requires some VRChat Packages which are not in the project yet.\n\nPress OK to download and install them.", - "OK", "Show Me What's Missing"); - if (result) - { - ResolveStatic(ProjectDir); - } - else - { - ResolverWindow.ShowWindow(); - } - } - } - catch (Exception) - { - // Unity says we can't open windows from this function so it throws an exception but also works fine. - } - } - - public static bool VPMManifestExists() - { - return VPMProjectManifest.Exists(ProjectDir, out _); - } - - public static void CreateManifest() - { - VPMProjectManifest.Load(ProjectDir); - ResolverWindow.Refresh(); - } - - public static void ResolveManifest() - { - ResolveStatic(ProjectDir); - } - - public static void ResolveStatic(string dir) - { - // Todo: calculate and show actual progress - EditorUtility.DisplayProgressBar($"Getting all VRChat Packages", "Downloading and Installing...", 0.5f); - VPMProjectManifest.Resolve(ProjectDir); - EditorUtility.ClearProgressBar(); - ForceRefresh(); - } - - public static List GetAllVersionsOf(string id) - { - var project = new UnityProject(ProjectDir); - - var versions = new List(); - foreach (var provider in Repos.GetAll) - { - var packagesWithVersions = provider.GetAllWithVersions(); - - foreach (var packageVersionList in packagesWithVersions) - { - foreach (var package in packageVersionList.Value.VersionsDescending) - { - if (package.Id != id) - continue; - if (Version.TryParse(package.Version, out var result)) - { - if (!versions.Contains(package.Version)) - versions.Add(package.Version); - } - } - } - } - - // Sort packages in project to the top - var sorted = from entry in versions orderby project.VPMProvider.HasPackage(entry) descending select entry; - - return sorted.ToList(); - } - - public static List GetAffectedPackageList(IVRCPackage package) - { - List list = new List(); - - var project = new UnityProject(ProjectDir); - - if (Repos.GetAllDependencies(package, out Dictionary dependencies, null)) - { - foreach (KeyValuePair item in dependencies) - { - project.VPMProvider.Refresh(); - if (project.VPMProvider.GetPackage(item.Key, item.Value) == null) - { - IVRCPackage d = Repos.GetPackageWithVersionMatch(item.Key, item.Value); - if (d != null) - { - list.Add(d.Id + " " + d.Version + "\n"); - } - } - } - - return list; - } - - return null; - } - - public static void ForceRefresh() - { - MethodInfo method = typeof(UnityEditor.PackageManager.Client).GetMethod("Resolve", - BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); - if (method != null) - method.Invoke(null, null); - - AssetDatabase.Refresh(); - } - } -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs.meta deleted file mode 100644 index a5403403..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/Resolver.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f872e3586f8b4f06bab3c9facd14f6e6 -timeCreated: 1659048476 \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs b/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs deleted file mode 100644 index fad3f543..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs +++ /dev/null @@ -1,292 +0,0 @@ -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using UnityEditor; -using UnityEditor.UIElements; -using UnityEngine; -using UnityEngine.UIElements; -using VRC.PackageManagement.Core; -using VRC.PackageManagement.Core.Types; -using VRC.PackageManagement.Core.Types.Packages; -using Version = VRC.PackageManagement.Core.Types.VPMVersion.Version; - -namespace VRC.PackageManagement.Resolver -{ - public class ResolverWindow : EditorWindow - { - // VisualElements - private static VisualElement _rootView; - private static Button _refreshButton; - private static Button _createButton; - private static Button _resolveButton; - private static Box _manifestInfo; - private static Label _manifestLabel; - private static bool _isUpdating; - private static Color _colorPositive = Color.green; - private static Color _colorNegative = new Color(1, 0.3f, 0.3f); - - - [MenuItem("VRChat SDK/Utilities/Package Resolver")] - public static void ShowWindow() - { - ResolverWindow wnd = GetWindow(); - wnd.titleContent = new GUIContent("Package Resolver"); - } - - public static void Refresh() - { - if (_rootView == null || string.IsNullOrWhiteSpace(Resolver.ProjectDir)) return; - - _manifestInfo.SetEnabled(!_isUpdating); - _refreshButton.SetEnabled(!_isUpdating); - _manifestLabel.text = (_isUpdating ? "Working ..." : "Required Packages"); - _manifestInfo.Clear(); - _manifestInfo.Add(_manifestLabel); - - bool needsResolve = VPMProjectManifest.ResolveIsNeeded(Resolver.ProjectDir); - string resolveStatus = needsResolve ? "Please press \"Resolve\" to Download them." : "All of them are in the project."; - - // check for vpm dependencies - if (!Resolver.VPMManifestExists()) - { - TextElement noManifestText = new TextElement(); - noManifestText.text = "No VPM Manifest"; - noManifestText.style.color = _colorNegative; - _manifestInfo.Add(noManifestText); - } - else - { - var manifest = VPMProjectManifest.Load(Resolver.ProjectDir); - var project = new UnityProject(Resolver.ProjectDir); - - // Here is where we detect if all dependencies are installed - var allDependencies = (manifest.locked != null && manifest.locked.Count > 0) - ? manifest.locked - : manifest.dependencies; - - foreach (var pair in allDependencies) - { - var id = pair.Key; - var version = pair.Value.version; - IVRCPackage package = project.VPMProvider.GetPackage(id, version); - _manifestInfo.Add(CreateDependencyRow(id, version, project, (package != null))); - } - - } - _resolveButton.SetEnabled(needsResolve); - Resolver.ForceRefresh(); - } - - /// - /// Unity calls the CreateGUI method automatically when the window needs to display - /// - private void CreateGUI() - { - _rootView = rootVisualElement; - _rootView.name = "root-view"; - _rootView.styleSheets.Add((StyleSheet)Resources.Load("ResolverWindowStyle")); - - // Main Container - var container = new Box() - { - name = "buttons" - }; - _rootView.Add(container); - - // Create Button - if (!Resolver.VPMManifestExists()) - { - _createButton = new Button(Resolver.CreateManifest) - { - text = "Create", - name = "create-button-base" - }; - container.Add(_createButton); - } - else - { - _resolveButton = new Button(Resolver.ResolveManifest) - { - text = "Resolve All", - name = "resolve-button-base" - }; - container.Add(_resolveButton); - } - - // Manifest Info - _manifestInfo = new Box() - { - name = "manifest-info", - }; - _manifestLabel = (new Label("Required Packages") { name = "manifest-header" }); - - _rootView.Add(_manifestInfo); - - // Refresh Button - var refreshBox = new Box(); - _refreshButton = new Button(Refresh) - { - text = "Refresh", - name = "refresh-button-base" - }; - refreshBox.Add(_refreshButton); - _rootView.Add(refreshBox); - - Refresh(); - } - - private static VisualElement CreateDependencyRow(string id, string version, UnityProject project, bool havePackage) - { - // Table - - VisualElement row = new Box() { name = "package-box" }; - VisualElement column1 = new Box() { name = "package-box" }; - VisualElement column2 = new Box() { name = "package-box" }; - VisualElement column3 = new Box() { name = "package-box" }; - VisualElement column4 = new Box() { name = "package-box" }; - - column1.style.minWidth = 200; - column2.style.minWidth = 100; - column3.style.minWidth = 100; - column4.style.minWidth = 100; - - row.Add(column1); - row.Add(column2); - row.Add(column3); - row.Add(column4); - - // Package Name + Status - - TextElement text = new TextElement { text = $"{id} {version} " }; - - column1.Add(text); - - if (!havePackage) - { - TextElement missingText = new TextElement { text = "MISSING" }; - missingText.style.color = _colorNegative; - missingText.style.display = (_isUpdating ? DisplayStyle.None : DisplayStyle.Flex); - column2.Add(missingText); - } - - // Version Popup - - var choices = new List(); - foreach (string n in Resolver.GetAllVersionsOf(id)) - { - choices.Add(n); - } - - var popupField = new PopupField(choices, 0); - popupField.value = choices[0]; - popupField.style.display = (_isUpdating ? DisplayStyle.None : DisplayStyle.Flex); - - column3.Add(popupField); - - // Button - - Button updateButton = new Button() { text = "Update" }; - if (havePackage) - RefreshUpdateButton(updateButton, version, choices[0]); - else - RefreshMissingButton(updateButton); - - updateButton.clicked += (() => - { - IVRCPackage package = Repos.GetPackageWithVersionMatch(id, popupField.value); - - // Check and warn on Dependencies if Updating or Downgrading - if (Version.TryParse(version, out var currentVersion) && - Version.TryParse(popupField.value, out var newVersion)) - { - Dictionary dependencies = new Dictionary(); - StringBuilder dialogMsg = new StringBuilder(); - List affectedPackages = Resolver.GetAffectedPackageList(package); - for (int v = 0; v < affectedPackages.Count; v++) - { - dialogMsg.Append(affectedPackages[v]); - } - - if (affectedPackages.Count > 1) - { - dialogMsg.Insert(0, "This will update multiple packages:\n\n"); - dialogMsg.AppendLine("\nAre you sure?"); - if (EditorUtility.DisplayDialog("Package Has Dependencies", dialogMsg.ToString(), "OK", "Cancel")) - OnUpdatePackageClicked(project, package); - } - else - { - OnUpdatePackageClicked(project, package); - } - } - - }); - column4.Add(updateButton); - - popupField.RegisterCallback>((evt) => - { - if (havePackage) - RefreshUpdateButton(updateButton, version, evt.newValue); - else - RefreshMissingButton(updateButton); - }); - - return row; - } - - private static void RefreshUpdateButton(Button button, string currentVersion, string highestAvailableVersion) - { - if (currentVersion == highestAvailableVersion) - { - button.style.display = DisplayStyle.None; - } - else - { - button.style.display = (_isUpdating ? DisplayStyle.None : DisplayStyle.Flex); - if (Version.TryParse(currentVersion, out var currentVersionObject) && - Version.TryParse(highestAvailableVersion, out var highestAvailableVersionObject)) - { - if (currentVersionObject < highestAvailableVersionObject) - { - SetButtonColor(button, _colorPositive); - button.text = "Update"; - } - else - { - SetButtonColor(button, _colorNegative); - button.text = "Downgrade"; - } - } - } - } - - private static void RefreshMissingButton(Button button) - { - button.text = "Resolve"; - SetButtonColor(button, Color.white); - button.style.display = (_isUpdating ? DisplayStyle.None : DisplayStyle.Flex); - } - - private static void SetButtonColor(Button button, Color color) - { - button.style.color = color; - color.a = 0.25f; - button.style.borderRightColor = - button.style.borderLeftColor = - button.style.borderTopColor = - button.style.borderBottomColor = - color; - } - - private static async void OnUpdatePackageClicked(UnityProject project, IVRCPackage package) - { - _isUpdating = true; - Refresh(); - await Task.Delay(500); - await Task.Run(() => project.UpdateVPMPackage(package)); - _isUpdating = false; - Refresh(); - } - - } -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs.meta deleted file mode 100644 index fbfb6ef9..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resolver/ResolverWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 32d2636186ee0834fa1dc2287750dd32 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resources.meta deleted file mode 100644 index 44742999..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8700b619eebc09545b4aaf4f69a2bf79 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss b/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss deleted file mode 100644 index 14ce0e79..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss +++ /dev/null @@ -1,16 +0,0 @@ -.unity-box { - margin: 10px; - padding:10px; -} - -.unity-box #description { - margin: 10px 0 10px 0; - white-space: normal; -} - -#action-button { - font-size: 20px; - -unity-font-style: bold; - padding: 10px; - margin:10px; -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss.meta deleted file mode 100644 index 80fa1a72..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/PackageMakerWindowStyle.uss.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8dfe8fb3b6d0f3e4693553ecc1cb23dd -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} - disableValidation: 0 diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss b/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss deleted file mode 100644 index 443e2e96..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss +++ /dev/null @@ -1,25 +0,0 @@ -.unity-box { - margin:2px; - padding:10px; - border-width:0px; -} - -#package-box { - margin:2px; - padding:10px; - border-width:0px; - flex-direction:row; - max-height:20px; - min-height:20px; - height:20px; - padding-top:0px; - padding-bottom:0px; - margin-top:0px; - margin-bottom:0px; - align-items:center; -} - -#manifest-header { - font-size: 20px; - margin-bottom: 10px; -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss.meta deleted file mode 100644 index 042729bb..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/Resources/ResolverWindowStyle.uss.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 346f7a547766ecb4396d15f585a15133 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} - disableValidation: 0 diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef b/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef deleted file mode 100644 index 2dd9d946..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "com.vrchat.core.vpm-resolver.Editor", - "references": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef.meta b/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef.meta deleted file mode 100644 index 73456806..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/Editor/com.vrchat.core.vpm-resolver.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d1e8c2ba944807d4a9213e2de6930a0b -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/License.md b/Packages/com.vrchat.core.vpm-resolver/License.md deleted file mode 100644 index 275530cd..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/License.md +++ /dev/null @@ -1,11 +0,0 @@ -# VRCHAT INC. -### VRCHAT DISTRO LICENSE FILE -Version: February 24, 2022 - -**SUMMARY OF TERMS:** Any materials subject to this Distro Asset License may be distributed by you, with or without modifications, on a non-commercial basis (i.e., at no charge), in accordance with the full terms of the Materials License Agreement. - -This Distro License File is a "License File" as defined in the VRChat Materials License Agreement, found at https://hello.vrchat.com/legal/sdk (or any successor link designated by VRChat) (as may be revised from time to time, the "Materials License Agreement"). - -This Distro License File applies to all the files in the Folder containing this Distro License File and those in all Child Folders within that Folder (except with respect to files in any Child Folder that contains a different License File) (such files, other than this Distro License File, the "Covered Files"). All capitalized terms used but not otherwise defined in this Distro License File have the meanings provided in the Materials License Agreement. - -This Distro License File only provides a summary of the terms applicable to the Covered Files. To understand your rights and obligations and the full set of terms that apply to use of the Covered Files, please see the relevant sections of the Materials License Agreement, including terms applicable to Distro Materials. \ No newline at end of file diff --git a/Packages/com.vrchat.core.vpm-resolver/License.md.meta b/Packages/com.vrchat.core.vpm-resolver/License.md.meta deleted file mode 100644 index 20b97519..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/License.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 7727f888edf4714448d5a0287deec6dd -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.vrchat.core.vpm-resolver/package.json b/Packages/com.vrchat.core.vpm-resolver/package.json deleted file mode 100644 index bd1e95db..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "com.vrchat.core.vpm-resolver", - "displayName": "VRChat Package Resolver Tool", - "version": "0.1.19", - "unity": "2019.4", - "description": "Tool to Download VPM Packages", - "vrchatVersion": "2022.1.1", - "author": { - "name": "VRChat", - "email": "developer@vrchat.com", - "url": "https://github.com/vrchat/packages" - }, - "url": "", - "dependencies": { - "com.unity.nuget.newtonsoft-json": "2.0.2" - } -} diff --git a/Packages/com.vrchat.core.vpm-resolver/package.json.meta b/Packages/com.vrchat.core.vpm-resolver/package.json.meta deleted file mode 100644 index b3235851..00000000 --- a/Packages/com.vrchat.core.vpm-resolver/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6b02e2915ebf04e4ea94e503d73e7411 -PackageManifestImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index 97863409..09d3cbad 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -9,6 +9,7 @@ "com.unity.textmeshpro": "2.1.6", "com.unity.timeline": "1.2.18", "com.unity.ugui": "1.0.0", + "com.unity.xr.oculus.android": "2.38.6", "com.unity.xr.oculus.standalone": "2.38.4", "com.unity.xr.openvr.standalone": "2.0.5", "de.thryrallo.vrc.avatar-performance-tools": "https://github.com/Thryrallo/VRC-Avatar-Performance-Tools.git", diff --git a/Packages/nadena.dev.modular-avatar/Editor/BuildContext.cs b/Packages/nadena.dev.modular-avatar/Editor/BuildContext.cs index 72a38b41..d6e82f63 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/BuildContext.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/BuildContext.cs @@ -101,20 +101,6 @@ public VRCExpressionsMenu CloneMenu(VRCExpressionsMenu menu) foreach (var control in newMenu.controls) { - if (Util.ValidateExpressionMenuIcon(control.icon) != Util.ValidateExpressionMenuIconResult.Success) - control.icon = null; - - for (int i = 0; i < control.labels.Length; i++) - { - var label = control.labels[i]; - var labelResult = Util.ValidateExpressionMenuIcon(label.icon); - if (labelResult != Util.ValidateExpressionMenuIconResult.Success) - { - label.icon = null; - control.labels[i] = label; - } - } - if (control.type == VRCExpressionsMenu.Control.ControlType.SubMenu) { control.subMenu = CloneMenu(control.subMenu); diff --git a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs index 76f9c922..984a6074 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/EasySetupOutfit.cs @@ -1,15 +1,121 @@ -using UnityEditor; +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using UnityEditor; using UnityEngine; +using Object = UnityEngine.Object; +using static nadena.dev.modular_avatar.core.editor.Localization; namespace nadena.dev.modular_avatar.core.editor { - public class EasySetupOutfit + internal class ESOErrorWindow : EditorWindow + { + private string header; + private string[] messageGroups; + private static readonly GUIStyle buttonStyle, labelStyle; + private const float SeparatorSize = 6f; + + static ESOErrorWindow() + { + buttonStyle = EditorStyles.miniButtonRight; + labelStyle = EditorStyles.label; + labelStyle.wordWrap = true; + + buttonStyle.fixedWidth = 40f; + buttonStyle.fixedHeight = EditorGUIUtility.singleLineHeight * 1.5f; + } + + private void OnEnable() + { + + } + + internal static void Show( + string header, + string[] messageGroups + ) + { + var window = CreateInstance(); + window.titleContent = new GUIContent("Setup Outfit"); + window.header = header; + window.messageGroups = messageGroups; + + // Compute required window size + var height = 0f; + var width = 450f; + + height += SeparatorSize; + height += EditorStyles.helpBox.CalcHeight(new GUIContent(header), width); + foreach (var message in messageGroups) + { + height += 6f; // TODO: constant + height += labelStyle.CalcHeight(new GUIContent(message), width); + } + + height += buttonStyle.fixedHeight; + height += SeparatorSize; + + window.minSize = new Vector2(width, height); + + window.ShowModal(); + } + + private void OnGUI() + { + EditorGUILayout.Space(SeparatorSize); + + EditorGUILayout.HelpBox(header, MessageType.Error); + + foreach (var message in messageGroups) + { + EditorGUILayout.Space(SeparatorSize); + EditorGUILayout.LabelField(message); + } + + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("OK", buttonStyle)) + { + Close(); + } + EditorGUILayout.EndHorizontal(); + + var finalRect = GUILayoutUtility.GetRect(SeparatorSize, SeparatorSize, GUILayout.ExpandWidth(true)); + + var size = this.minSize; + size.y = finalRect.position.y + finalRect.height; + + if (size.y > 10) + { + if (Vector2.Distance(this.minSize, size) > 1f) + { + this.minSize = size; + } + + if (Vector2.Distance(this.maxSize, size) > 1f) + { + this.maxSize = size; + } + } + } + } + + internal class EasySetupOutfit { private const int PRIORITY = 49; + private static string[] errorMessageGroups; + private static string errorHeader; [MenuItem("GameObject/ModularAvatar/Setup Outfit", false, PRIORITY)] static void SetupOutfit(MenuCommand cmd) { + if (!ValidateSetupOutfit()) + { + ESOErrorWindow.Show(errorHeader, errorMessageGroups); + return; + } + if (!FindBones(cmd.context, out var avatarRoot, out var avatarHips, out var outfitHips) ) return; @@ -18,14 +124,15 @@ static void SetupOutfit(MenuCommand cmd) var avatarArmature = avatarHips.transform.parent; var outfitArmature = outfitHips.transform.parent; - if (outfitArmature.GetComponent() == null) + var merge = outfitArmature.GetComponent(); + if (merge == null) { - var merge = Undo.AddComponent(outfitArmature.gameObject); + merge = Undo.AddComponent(outfitArmature.gameObject); merge.mergeTarget = new AvatarObjectReference(); merge.mergeTarget.referencePath = RuntimeUtil.RelativePath(avatarRoot, avatarArmature.gameObject); merge.InferPrefixSuffix(); - HeuristicBoneMapper.RenameBonesByHeuristic(merge); } + HeuristicBoneMapper.RenameBonesByHeuristic(merge); if (outfitRoot != null && outfitRoot.GetComponent() == null @@ -109,7 +216,7 @@ ref Bounds bounds else if (Vector3.Distance(bounds.center, skinnedMeshRenderer.bounds.center) > 0.01f || Vector3.Distance(bounds.extents, skinnedMeshRenderer.bounds.extents) > 0.01f) { - bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS; + bounds = TransformBounds(rootBone, ModularAvatarMeshSettings.DEFAULT_BOUNDS); } } @@ -117,13 +224,28 @@ ref Bounds bounds } } - [MenuItem("GameObject/ModularAvatar/Setup Outfit", true, PRIORITY)] + private static Bounds TransformBounds(Transform rootBone, Bounds bounds) + { + bounds.extents = bounds.extents / (Vector3.Dot(rootBone.lossyScale, Vector3.one) / 3); + + return bounds; + } + static bool ValidateSetupOutfit() { - if (Selection.objects.Length == 0) return false; + errorHeader = S("setup_outfit.err.header.notarget"); + errorMessageGroups = new string[] { S("setup_outfit.err.unknown") }; + + if (Selection.objects.Length == 0) + { + errorMessageGroups = new string[] { S("setup_outfit.err.no_selection") }; + return false; + } foreach (var obj in Selection.objects) { + errorHeader = S_f("setup_outfit.err.header", obj.name); + if (!(obj is GameObject gameObj)) return false; var xform = gameObj.transform; @@ -137,17 +259,28 @@ static bool ValidateSetupOutfit() // refusing to run if we detect multiple avatar descriptors above the current object (or if we're run on // the avdesc object itself) var nearestAvatar = RuntimeUtil.FindAvatarInParents(xform); - if (nearestAvatar == null || nearestAvatar.transform == xform) return false; + if (nearestAvatar == null || nearestAvatar.transform == xform) + { + errorMessageGroups = new string[] + {S_f("setup_outfit.err.multiple_avatar_descriptors", xform.gameObject.name)}; + return false; + } var parent = nearestAvatar.transform.parent; - if (parent != null && RuntimeUtil.FindAvatarInParents(parent) != null) return false; + if (parent != null && RuntimeUtil.FindAvatarInParents(parent) != null) + { + errorMessageGroups = new string[] + { + S_f("setup_outfit.err.no_avatar_descriptor", xform.gameObject.name) + }; + return false; + } } return true; } - private static bool FindBones(Object obj, out GameObject avatarRoot, out GameObject avatarHips, - out GameObject outfitHips) + private static bool FindBones(Object obj, out GameObject avatarRoot, out GameObject avatarHips, out GameObject outfitHips) { avatarHips = outfitHips = null; var outfitRoot = obj as GameObject; @@ -155,12 +288,46 @@ private static bool FindBones(Object obj, out GameObject avatarRoot, out GameObj ? RuntimeUtil.FindAvatarInParents(outfitRoot.transform)?.gameObject : null; if (outfitRoot == null || avatarRoot == null) return false; - + var avatarAnimator = avatarRoot.GetComponent(); - if (avatarAnimator == null) return false; + if (avatarAnimator == null) + { + errorMessageGroups = new string[] + { + S("setup_outfit.err.no_animator") + }; + return false; + } - avatarHips = avatarAnimator.GetBoneTransform(HumanBodyBones.Hips)?.gameObject; - if (avatarHips == null) return false; + var avatarBoneMappings = GetAvatarBoneMappings(avatarAnimator); + if (!avatarBoneMappings.ContainsKey(HumanBodyBones.Hips)) + { + errorMessageGroups = new string[] + { + S("setup_outfit.err.no_hips") + }; + return false; + } + + // We do an explicit search for the hips bone rather than invoking the animator, as we want to control + // traversal order. + foreach (var maybeHips in avatarRoot.GetComponentsInChildren()) + { + if (maybeHips.name == avatarBoneMappings[HumanBodyBones.Hips] && !maybeHips.IsChildOf(outfitRoot.transform)) + { + avatarHips = maybeHips.gameObject; + break; + } + } + + if (avatarHips == null) + { + errorMessageGroups = new string[] + { + S("setup_outfit.err.no_hips") + }; + return false; + } var outfitAnimator = outfitRoot.GetComponent(); if (outfitAnimator != null) @@ -168,22 +335,70 @@ private static bool FindBones(Object obj, out GameObject avatarRoot, out GameObj outfitHips = outfitAnimator.GetBoneTransform(HumanBodyBones.Hips)?.gameObject; } + var hipsCandidates = new List(); + if (outfitHips == null) { - // Heuristic search - usually there'll be root -> Armature -> (single child) Hips + // Heuristic search - usually there'll be root -> Armature -> (single child) Hips. + // First, look for an exact match. foreach (Transform child in outfitRoot.transform) { foreach (Transform tempHip in child) { - if (tempHip.name.Contains(avatarHips.name)) + if (tempHip.name.Contains(avatarBoneMappings[HumanBodyBones.Hips])) { outfitHips = tempHip.gameObject; } } } + hipsCandidates.Add(avatarBoneMappings[HumanBodyBones.Hips]); + + // If that doesn't work out, we'll check for heuristic bone mapper mappings. + foreach (var hbm in HeuristicBoneMapper.BoneToNameMap[HumanBodyBones.Hips]) + { + if (hipsCandidates[0] != hbm) + { + hipsCandidates.Add(hbm); + } + } + + foreach (Transform child in outfitRoot.transform) + { + foreach (Transform tempHip in child) + { + foreach (var candidate in hipsCandidates) + { + if (HeuristicBoneMapper.NormalizeName(tempHip.name).Contains(candidate)) + { + outfitHips = tempHip.gameObject; + } + } + } + } + } + + if (outfitHips == null) + { + errorMessageGroups = new string[] + { + S("setup_outfit.err.no_outfit_hips"), + string.Join("\n", hipsCandidates.Select(c => "・ " + c).ToArray()) + }; } return avatarHips != null && outfitHips != null; } + + private static ImmutableDictionary GetAvatarBoneMappings(Animator avatarAnimator) + { + var avatarHuman = avatarAnimator.avatar?.humanDescription.human ?? new HumanBone[0]; + return avatarHuman + .Where(hb => !string.IsNullOrEmpty(hb.boneName)) + .Select(hb => new KeyValuePair( + (HumanBodyBones) Enum.Parse(typeof(HumanBodyBones), hb.humanName.Replace(" ", "")), + hb.boneName + )) + .ToImmutableDictionary(); + } } } \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/FixupPasses.meta b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses.meta new file mode 100644 index 00000000..aa4a4bd8 --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 597d4035b7eb43e180a013ceac128a84 +timeCreated: 1694687629 \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs new file mode 100644 index 00000000..29d0fae0 --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using VRC.SDK3.Avatars.ScriptableObjects; + +namespace nadena.dev.modular_avatar.core.editor +{ + internal class FixupExpressionsMenuPass + { + internal static void FixupExpressionsMenu(BuildContext context) + { + var expressionsMenu = context.AvatarDescriptor.expressionsMenu; + if (expressionsMenu == null) return; + + var parameters = context.AvatarDescriptor.expressionParameters?.parameters + ?? new VRCExpressionParameters.Parameter[0]; + var parameterNames = parameters.Select(p=> p.name).ToImmutableHashSet(); + + if (!Util.IsTemporaryAsset(expressionsMenu)) + { + expressionsMenu = context.CloneMenu(expressionsMenu); + context.AvatarDescriptor.expressionsMenu = expressionsMenu; + } + + // Walk menu recursively + var visitedMenus = new HashSet(); + var iconMapping = new Dictionary(); + + VisitMenu(expressionsMenu); + + void VisitMenu(VRCExpressionsMenu menu) + { + if (!visitedMenus.Add(menu)) return; + + foreach (var control in menu.controls) + { + if (control.parameter != null && + !string.IsNullOrEmpty(control.parameter.name) && + !parameterNames.Contains(control.parameter.name)) + { + control.parameter.name = ""; + } + + foreach (var subParam in control.subParameters ?? Array.Empty()) + { + if (subParam != null && + !string.IsNullOrEmpty(subParam.name) && + !parameterNames.Contains(subParam.name)) + { + subParam.name = ""; + } + } + + if (control.icon != null) + { + if (!iconMapping.TryGetValue(control.icon, out var newIcon)) + { + iconMapping[control.icon] = newIcon = MaybeScaleIcon(context, control.icon); + } + + control.icon = newIcon; + } + + if (control.labels != null) + { + for (int i = 0; i < control.labels.Length; i++) + { + var label = control.labels[i]; + + if (label.icon != null) + { + if (!iconMapping.TryGetValue(label.icon, out var newIcon)) + { + iconMapping[label.icon] = newIcon = MaybeScaleIcon(context, label.icon); + } + + label.icon = newIcon; + control.labels[i] = label; + } + } + } + } + } + } + + #if UNITY_ANDROID + private const TextureFormat TargetFormat = TextureFormat.ASTC_4x4; + #else + private const TextureFormat TargetFormat = TextureFormat.DXT5; + #endif + + private static Texture2D MaybeScaleIcon(BuildContext context, Texture2D original) + { + if (original.width <= 256 && original.height <= 256 && IsCompressedFormat(original.format)) + { + return original; + } + + var newRatio = Math.Min(256f / original.width, 256f / original.height); + var newWidth = Math.Min(256, Mathf.RoundToInt(original.width * newRatio)); + var newHeight = Math.Min(256, Mathf.RoundToInt(original.height * newRatio)); + + var newTex = new Texture2D(newWidth, newHeight, TextureFormat.RGBA32, true); + context.SaveAsset(newTex); + + var tmpRenderTex = RenderTexture.GetTemporary(newWidth, newHeight, 0, RenderTextureFormat.ARGB32); + var originalActiveRenderTex = RenderTexture.active; + + try + { + Graphics.Blit(original, tmpRenderTex); + RenderTexture.active = tmpRenderTex; + newTex.ReadPixels(new Rect(0, 0, newWidth, newHeight), 0, 0); + newTex.Apply(); + EditorUtility.CompressTexture(newTex, TargetFormat, TextureCompressionQuality.Normal); + + return newTex; + } + finally + { + RenderTexture.active = originalActiveRenderTex; + RenderTexture.ReleaseTemporary(tmpRenderTex); + } + } + + private static bool IsCompressedFormat(TextureFormat format) + { + var name = format.ToString(); + return name.StartsWith("DXT") || name.StartsWith("ASTC"); + } + } +} \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs.meta b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs.meta new file mode 100644 index 00000000..889510ab --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/FixupPasses/FixupExpressionsMenuPass.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1020bef86d91452ba6b138c249d25bb5 +timeCreated: 1694688050 \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/HeuristicBoneMapper.cs b/Packages/nadena.dev.modular-avatar/Editor/HeuristicBoneMapper.cs index 966df029..b2bcdba3 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/HeuristicBoneMapper.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/HeuristicBoneMapper.cs @@ -10,6 +10,146 @@ internal class HeuristicBoneMapper { private static readonly Regex PAT_END_NUMBER = new Regex(@"[_\.][0-9]+"); + private static readonly ImmutableDictionary> BoneChildren = + ImmutableDictionary>.Empty + .Add(HumanBodyBones.Hips, ImmutableList.Create( + HumanBodyBones.LeftUpperLeg, + HumanBodyBones.RightUpperLeg, + HumanBodyBones.Spine + )) + .Add(HumanBodyBones.LeftUpperLeg, ImmutableList.Create( + HumanBodyBones.LeftLowerLeg + )) + .Add(HumanBodyBones.RightUpperLeg, ImmutableList.Create( + HumanBodyBones.RightLowerLeg + )) + .Add(HumanBodyBones.LeftLowerLeg, ImmutableList.Create( + HumanBodyBones.LeftFoot + )) + .Add(HumanBodyBones.RightLowerLeg, ImmutableList.Create( + HumanBodyBones.RightFoot + )) + .Add(HumanBodyBones.LeftFoot, ImmutableList.Create( + HumanBodyBones.LeftToes + )) + .Add(HumanBodyBones.RightFoot, ImmutableList.Create( + HumanBodyBones.RightToes + )) + .Add(HumanBodyBones.Spine, ImmutableList.Create( + HumanBodyBones.Chest, + HumanBodyBones.UpperChest + )) + .Add(HumanBodyBones.Chest, ImmutableList.Create( + HumanBodyBones.Neck, + HumanBodyBones.LeftShoulder, + HumanBodyBones.RightShoulder + )) + .Add(HumanBodyBones.UpperChest, ImmutableList.Create( + HumanBodyBones.Neck, + HumanBodyBones.LeftShoulder, + HumanBodyBones.RightShoulder + )) + .Add(HumanBodyBones.Neck, ImmutableList.Create( + HumanBodyBones.Head + )) + .Add(HumanBodyBones.Head, ImmutableList.Create( + HumanBodyBones.LeftEye, + HumanBodyBones.RightEye, + HumanBodyBones.Jaw + )) + .Add(HumanBodyBones.LeftShoulder, ImmutableList.Create( + HumanBodyBones.LeftUpperArm + )) + .Add(HumanBodyBones.RightShoulder, ImmutableList.Create( + HumanBodyBones.RightUpperArm + )) + .Add(HumanBodyBones.LeftUpperArm, ImmutableList.Create( + HumanBodyBones.LeftLowerArm + )) + .Add(HumanBodyBones.RightUpperArm, ImmutableList.Create( + HumanBodyBones.RightLowerArm + )) + .Add(HumanBodyBones.LeftLowerArm, ImmutableList.Create( + HumanBodyBones.LeftHand + )) + .Add(HumanBodyBones.RightLowerArm, ImmutableList.Create( + HumanBodyBones.RightHand + )) + .Add(HumanBodyBones.LeftHand, ImmutableList.Create( + HumanBodyBones.LeftThumbProximal, + HumanBodyBones.LeftIndexProximal, + HumanBodyBones.LeftMiddleProximal, + HumanBodyBones.LeftRingProximal, + HumanBodyBones.LeftLittleProximal + )) + .Add(HumanBodyBones.RightHand, ImmutableList.Create( + HumanBodyBones.RightThumbProximal, + HumanBodyBones.RightIndexProximal, + HumanBodyBones.RightMiddleProximal, + HumanBodyBones.RightRingProximal, + HumanBodyBones.RightLittleProximal + )) + .Add(HumanBodyBones.LeftThumbProximal, ImmutableList.Create( + HumanBodyBones.LeftThumbIntermediate + )) + .Add(HumanBodyBones.RightThumbProximal, ImmutableList.Create( + HumanBodyBones.RightThumbIntermediate + )) + .Add(HumanBodyBones.LeftThumbIntermediate, ImmutableList.Create( + HumanBodyBones.LeftThumbDistal + )) + .Add(HumanBodyBones.RightThumbIntermediate, ImmutableList.Create( + HumanBodyBones.RightThumbDistal + )) + .Add(HumanBodyBones.LeftIndexProximal, ImmutableList.Create( + HumanBodyBones.LeftIndexIntermediate + )) + .Add(HumanBodyBones.RightIndexProximal, ImmutableList.Create( + HumanBodyBones.RightIndexIntermediate + )) + .Add(HumanBodyBones.LeftIndexIntermediate, ImmutableList.Create( + HumanBodyBones.LeftIndexDistal + )) + .Add(HumanBodyBones.RightIndexIntermediate, ImmutableList.Create( + HumanBodyBones.RightIndexDistal + )) + .Add(HumanBodyBones.LeftMiddleProximal, ImmutableList.Create( + HumanBodyBones.LeftMiddleIntermediate + )) + .Add(HumanBodyBones.RightMiddleProximal, ImmutableList.Create( + HumanBodyBones.RightMiddleIntermediate + )) + .Add(HumanBodyBones.LeftMiddleIntermediate, ImmutableList.Create( + HumanBodyBones.LeftMiddleDistal + )) + .Add(HumanBodyBones.RightMiddleIntermediate, ImmutableList.Create( + HumanBodyBones.RightMiddleDistal + )) + .Add(HumanBodyBones.LeftRingProximal, ImmutableList.Create( + HumanBodyBones.LeftRingIntermediate + )) + .Add(HumanBodyBones.RightRingProximal, ImmutableList.Create( + HumanBodyBones.RightRingIntermediate + )) + .Add(HumanBodyBones.LeftRingIntermediate, ImmutableList.Create( + HumanBodyBones.LeftRingDistal + )) + .Add(HumanBodyBones.RightRingIntermediate, ImmutableList.Create( + HumanBodyBones.RightRingDistal + )) + .Add(HumanBodyBones.LeftLittleProximal, ImmutableList.Create( + HumanBodyBones.LeftLittleIntermediate + )) + .Add(HumanBodyBones.RightLittleProximal, ImmutableList.Create( + HumanBodyBones.RightLittleIntermediate + )) + .Add(HumanBodyBones.LeftLittleIntermediate, ImmutableList.Create( + HumanBodyBones.LeftLittleDistal + )) + .Add(HumanBodyBones.RightLittleIntermediate, ImmutableList.Create( + HumanBodyBones.RightLittleDistal + )); + // This list is originally from https://github.com/HhotateA/AvatarModifyTools/blob/d8ae75fed8577707253d6b63a64d6053eebbe78b/Assets/HhotateA/AvatarModifyTool/Editor/EnvironmentVariable.cs#L81-L139 // Copyright (c) 2021 @HhotateA_xR // Licensed under the MIT License @@ -359,15 +499,31 @@ internal static void RenameBonesByHeuristic(ModularAvatarMergeArmature config) var target = config.mergeTarget.Get(RuntimeUtil.FindAvatarInParents(config.transform)); if (target == null) return; + bool changedSuffix = false; + var newSuffix = config.suffix; + if (config.prefix == "" && config.suffix == "") + { + newSuffix = ".1"; + changedSuffix = true; + } + Traverse(config.transform, target.transform); + config.suffix = newSuffix; + + if (changedSuffix) + { + Undo.RecordObject(config, "Applying heuristic mapping"); + PrefabUtility.RecordPrefabInstancePropertyModifications(config); + } + void Traverse(Transform src, Transform dst) { var mappings = AssignBoneMappings(config, src.gameObject, dst.gameObject); foreach (var pair in mappings) { - var newName = config.prefix + pair.Value.gameObject.name + config.suffix; + var newName = config.prefix + pair.Value.gameObject.name + newSuffix; var srcGameObj = pair.Key.gameObject; var oldName = srcGameObj.name; diff --git a/Packages/nadena.dev.modular-avatar/Editor/Localization/Localization.cs b/Packages/nadena.dev.modular-avatar/Editor/Localization/Localization.cs index aa815ce6..e50dea93 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Localization/Localization.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/Localization/Localization.cs @@ -92,6 +92,18 @@ public static string S(string key) { return S(key, key); } + + public static string S_f(string key, params string[] format) + { + try + { + return string.Format(S(key, key), format); + } + catch (FormatException e) + { + return S(key, key) + "(" + string.Join(", ", format) + ")"; + } + } public static string S(string key, string defValue) { diff --git a/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json b/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json index c525b97f..a9fa0b84 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json +++ b/Packages/nadena.dev.modular-avatar/Editor/Localization/en.json @@ -151,5 +151,14 @@ "animation_gen.duplicate_binding": "Controls from different control groups are trying to animate the same parameter. Parameter: {0}", "animation_gen.multiple_defaults": "Multiple default menu items were found in the same control group.", "menuitem.misc.add_item": "Add menu item", - "replace_object.target_object": "Object to replace" + "replace_object.target_object": "Object to replace", + "setup_outfit.err.header.notarget": "Setup outfit failed", + "setup_outfit.err.header": "Setup Outfit failed to process {0}", + "setup_outfit.err.unknown": "Unknown error", + "setup_outfit.err.no_selection": "No object selected.", + "setup_outfit.err.multiple_avatar_descriptors": "Multiple avatar descriptors found in {0} and its parents.", + "setup_outfit.err.no_avatar_descriptor": "No avatar descriptor found in {0} or its parents.", + "setup_outfit.err.no_animator": "Your avatar does not have an Animator component.", + "setup_outfit.err.no_hips": "Your avatar does not have a Hips bone. Setup Outfit only works on humanoid avatars.", + "setup_outfit.err.no_outfit_hips": "Unable to identify the Hips object for the outfit. Searched for objects containing the following names:" } \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json b/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json index 871f9ace..3282beb1 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json +++ b/Packages/nadena.dev.modular-avatar/Editor/Localization/ja.json @@ -149,5 +149,14 @@ "animation_gen.duplicate_binding": "別々のコントロールグループから、同じパラメーターが操作されています。パラメーター:{0}", "animation_gen.multiple_defaults": "同じコントロールグループに初期設定に指定されたメニューアイテムが複数あります。", "menuitem.misc.add_item": "メニューアイテムを追加", - "replace_object.target_object": "上書き先" + "replace_object.target_object": "上書き先", + "setup_outfit.err.header.notarget": "Setup outfit の処理が失敗しました", + "setup_outfit.err.header": "Setup outfit が「{0}」を処理中に失敗しました。", + "setup_outfit.err.unknown": "原因不明のエラーが発生しました。", + "setup_outfit.err.no_selection": "オブジェクトが選択されていません。", + "setup_outfit.err.multiple_avatar_descriptors": "「{}」とその親に、複数のavatar descriptorを発見しました。", + "setup_outfit.err.no_avatar_descriptor": "「{}」とその親に、avatar descriptorが見つかりませんでした。", + "setup_outfit.err.no_animator": "アバターにAnimatorコンポーネントがありません。", + "setup_outfit.err.no_hips": "アバターにHipsボーンがありません。なお、Setup Outfitはヒューマノイドアバター以外には対応していません。", + "setup_outfit.err.no_outfit_hips": "衣装のHipsボーンを発見できませんでした。以下の名前を含むボーンを探しました:" } diff --git a/Packages/nadena.dev.modular-avatar/Editor/MergeArmatureHook.cs b/Packages/nadena.dev.modular-avatar/Editor/MergeArmatureHook.cs index a6dad482..4f7d19e8 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/MergeArmatureHook.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/MergeArmatureHook.cs @@ -418,6 +418,34 @@ private void RecursiveMerge(ModularAvatarMergeArmature config, throw new Exception("Cannot merge prefab instances or prefab assets"); } + if (mergedSrcBone == newParent + && ( + Vector3.SqrMagnitude(mergedSrcBone.transform.localScale - src.transform.localScale) > 0.00001f + || Quaternion.Angle(mergedSrcBone.transform.localRotation, src.transform.localRotation) > 0.00001f + || Vector3.SqrMagnitude(mergedSrcBone.transform.localPosition - src.transform.localPosition) > 0.00001f + ) + && src.GetComponent() != null + ) + { + // Constraints are sensitive to changes in local reference frames in some cases. In this case we'll + // inject a dummy object in between in order to retain the local parent scale of the retargeted bone. + var objName = src.gameObject.name + "$ConstraintRef " + Guid.NewGuid(); + + var constraintScaleRef = new GameObject(objName); + constraintScaleRef.transform.SetParent(src.transform.parent); + constraintScaleRef.transform.localPosition = Vector3.zero; + constraintScaleRef.transform.localRotation = Quaternion.identity; + constraintScaleRef.transform.localScale = Vector3.one; + + constraintScaleRef.transform.SetParent(newParent.transform, true); + mergedSrcBone = constraintScaleRef; + + BoneDatabase.AddMergedBone(mergedSrcBone.transform); + BoneDatabase.RetainMergedBone(mergedSrcBone.transform); + PathMappings.MarkTransformLookthrough(mergedSrcBone); + thisPassAdded.Add(mergedSrcBone.transform); + } + src.transform.SetParent(mergedSrcBone.transform, true); if (config.mangleNames) { diff --git a/Packages/nadena.dev.modular-avatar/Editor/MeshRetargeter.cs b/Packages/nadena.dev.modular-avatar/Editor/MeshRetargeter.cs index 181df1f9..ba7cecc3 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/MeshRetargeter.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/MeshRetargeter.cs @@ -243,7 +243,7 @@ private void RetargetBones() { // Sometimes meshes have no root bone set. This is usually not ideal, but let's make sure we don't // choke on the scale computation below. - scaleBone = renderer.bones[0]; + scaleBone = renderer.transform; } renderer.bones = newBones; @@ -252,12 +252,15 @@ private void RetargetBones() dst.bindposes = newBindPoses; renderer.sharedMesh = dst; } - + var newRootBone = _boneDatabase.GetRetargetedBone(rootBone, true); - var newScaleBone = _boneDatabase.GetRetargetedBone(scaleBone, true); + if (newRootBone == null) + { + newRootBone = renderer.transform; + } var oldLossyScale = scaleBone.transform.lossyScale; - var newLossyScale = newScaleBone.transform.lossyScale; + var newLossyScale = newRootBone.transform.lossyScale; var bounds = renderer.localBounds; bounds.extents = new Vector3( @@ -265,10 +268,8 @@ private void RetargetBones() bounds.extents.y * oldLossyScale.y / newLossyScale.y, bounds.extents.z * oldLossyScale.z / newLossyScale.z ); - bounds.center = new Vector3( - bounds.center.x * oldLossyScale.x / newLossyScale.x, - bounds.center.y * oldLossyScale.y / newLossyScale.y, - bounds.center.z * oldLossyScale.z / newLossyScale.z + bounds.center = newRootBone.transform.InverseTransformPoint( + scaleBone.transform.TransformPoint(bounds.center) ); renderer.localBounds = bounds; diff --git a/Packages/nadena.dev.modular-avatar/Editor/OptimizationPasses/GCGameObjectsPass.cs b/Packages/nadena.dev.modular-avatar/Editor/OptimizationPasses/GCGameObjectsPass.cs index a982ff09..23c2e939 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/OptimizationPasses/GCGameObjectsPass.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/OptimizationPasses/GCGameObjectsPass.cs @@ -99,6 +99,28 @@ private void MarkAll() MarkObject(t.gameObject); } } + + // https://github.com/bdunderscore/modular-avatar/issues/308 + // If we have duplicate Armature bones, retain them all in order to deal with some horrible hacks that are + // in use in the wild. + try + { + var trueArmature = animator?.GetBoneTransform(HumanBodyBones.Hips)?.parent; + if (trueArmature != null) + { + foreach (Transform t in _root.transform) + { + if (t.name == trueArmature.name) + { + MarkObject(t.gameObject); + } + } + } + } + catch (MissingComponentException e) + { + // No animator? weird. Move on. + } } private void MarkPhysBone(VRCPhysBone pb) diff --git a/Packages/nadena.dev.modular-avatar/Runtime/AvatarObjectReference.cs b/Packages/nadena.dev.modular-avatar/Runtime/AvatarObjectReference.cs index dec35e8c..2b2682fd 100644 --- a/Packages/nadena.dev.modular-avatar/Runtime/AvatarObjectReference.cs +++ b/Packages/nadena.dev.modular-avatar/Runtime/AvatarObjectReference.cs @@ -43,7 +43,27 @@ public GameObject Get(Component container) return _cachedReference; } - return (_cachedReference = avatar.transform.Find(referencePath)?.gameObject); + _cachedReference = avatar.transform.Find(referencePath)?.gameObject; + if (_cachedReference == null) return null; + + // https://github.com/bdunderscore/modular-avatar/issues/308 + // Some avatars have multiple "Armature" objects in order to confuse VRChat into changing the avatar eye + // position. We need to be smarter than VRChat and find the "true" armature in this case. + var targetName = _cachedReference.name; + var parent = _cachedReference.transform.parent; + if (targetName == "Armature" && parent != null && _cachedReference.transform.childCount == 0) + { + foreach (Transform possibleTarget in parent) + { + if (possibleTarget.gameObject.name == targetName && possibleTarget.childCount > 0) + { + _cachedReference = possibleTarget.gameObject; + break; + } + } + } + + return _cachedReference; } public void Set(GameObject target) diff --git a/Packages/nadena.dev.modular-avatar/package.json b/Packages/nadena.dev.modular-avatar/package.json index 7d393630..08bf6038 100644 --- a/Packages/nadena.dev.modular-avatar/package.json +++ b/Packages/nadena.dev.modular-avatar/package.json @@ -1,7 +1,7 @@ { "name": "nadena.dev.modular-avatar", "displayName": "Modular Avatar", - "version": "1.7.4", + "version": "1.7.6", "unity": "2019.4", "description": "A suite of tools for assembling your avatar out of reusable components", "author": { diff --git a/Packages/vpm-manifest.json b/Packages/vpm-manifest.json index 80003a52..2a2a5d27 100644 --- a/Packages/vpm-manifest.json +++ b/Packages/vpm-manifest.json @@ -3,26 +3,19 @@ "com.vrchat.avatars": { "version": "3.2.0" }, - "com.vrchat.core.vpm-resolver": { - "version": "0.1.19" - }, "vrchat.blackstartx.gesture-manager": { "version": "3.8.4" } }, "locked": { "com.vrchat.avatars": { - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "com.vrchat.base": "3.2.0" + "com.vrchat.base": "3.3.0" } }, "com.vrchat.base": { - "version": "3.2.0", - "dependencies": {} - }, - "com.vrchat.core.vpm-resolver": { - "version": "0.1.19", + "version": "3.3.0", "dependencies": {} }, "vrchat.blackstartx.gesture-manager": { diff --git a/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json new file mode 100644 index 00000000..ad11087f --- /dev/null +++ b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -0,0 +1,7 @@ +{ + "m_Name": "Settings", + "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", + "m_Dictionary": { + "m_DictionaryValues": [] + } +} \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1f1a1391..72a22bf9 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -176,7 +176,7 @@ PlayerSettings: applicationIdentifier: {} buildNumber: {} AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 19 + AndroidMinSdkVersion: 25 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -184,7 +184,7 @@ PlayerSettings: iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 0 ForceInternetPermission: 0 - ForceSDCardPermission: 0 + ForceSDCardPermission: 1 CreateWallpaper: 0 APKExpansionFiles: 0 keepLoadedShadersAlive: 0 @@ -250,7 +250,7 @@ PlayerSettings: clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea templatePackageId: com.vrchat.template.base@1.0.0 templateDefaultScene: Assets/VRCWelcome.unity - AndroidTargetArchitectures: 1 + AndroidTargetArchitectures: 2 AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -313,7 +313,7 @@ PlayerSettings: - m_BuildTarget: LuminSupport m_GraphicsJobs: 0 - m_BuildTarget: AndroidPlayer - m_GraphicsJobs: 0 + m_GraphicsJobs: 1 - m_BuildTarget: WebGLSupport m_GraphicsJobs: 0 m_BuildTargetGraphicsJobMode: @@ -347,6 +347,12 @@ PlayerSettings: - None - OpenVR - Oculus + - m_BuildTarget: Android + m_Enabled: 1 + m_Devices: + - None + - OpenVR + - Oculus openGLRequireES31: 0 openGLRequireES31AEP: 0 openGLRequireES32: 0 @@ -623,7 +629,7 @@ PlayerSettings: webGLWasmStreaming: 0 scriptingDefineSymbols: 1: VRC_SDK_VRCSDK3;UNITY_POST_PROCESSING_STACK_V2 - 7: UNITY_POST_PROCESSING_STACK_V2 + 7: UNITY_POST_PROCESSING_STACK_V2;VRC_SDK_VRCSDK3 13: UNITY_POST_PROCESSING_STACK_V2 14: UNITY_POST_PROCESSING_STACK_V2 19: UNITY_POST_PROCESSING_STACK_V2 @@ -637,17 +643,20 @@ PlayerSettings: 33: UNITY_POST_PROCESSING_STACK_V2 platformArchitecture: {} scriptingBackend: {} - il2cppCompilerConfiguration: {} + il2cppCompilerConfiguration: + Android: 1 + Standalone: 1 managedStrippingLevel: {} incrementalIl2cppBuild: {} suppressCommonWarnings: 1 allowUnsafeCode: 0 - additionalIl2CppArgs: + additionalIl2CppArgs: --compiler-flags="" --linker-flags="" scriptingRuntimeVersion: 1 gcIncremental: 1 assemblyVersionValidation: 1 gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: + Android: 3 Standalone: 3 m_RenderingPath: 1 m_MobileRenderingPath: 1 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 42131f31..0c8e050c 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -4,13 +4,13 @@ QualitySettings: m_ObjectHideFlags: 0 serializedVersion: 5 - m_CurrentQuality: 3 + m_CurrentQuality: 2 m_QualitySettings: - serializedVersion: 2 name: VRC Low pixelLightCount: 4 shadows: 2 - shadowResolution: 2 + shadowResolution: 1 shadowProjection: 1 shadowCascades: 2 shadowDistance: 75 @@ -58,7 +58,7 @@ QualitySettings: skinWeights: 4 textureQuality: 0 anisotropicTextures: 2 - antiAliasing: 4 + antiAliasing: 2 softParticles: 1 softVegetation: 1 realtimeReflectionProbes: 1 @@ -86,43 +86,6 @@ QualitySettings: shadows: 2 shadowResolution: 3 shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 75 - shadowNearPlaneOffset: 2 - shadowCascade2Split: 0.33333334 - shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} - shadowmaskMode: 0 - skinWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 4 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 0 - lodBias: 2 - maximumLODLevel: 0 - streamingMipmapsActive: 0 - streamingMipmapsAddAllCameras: 1 - streamingMipmapsMemoryBudget: 512 - streamingMipmapsRenderersPerFrame: 512 - streamingMipmapsMaxLevelReduction: 2 - streamingMipmapsMaxFileIORequests: 1024 - particleRaycastBudget: 4096 - asyncUploadTimeSlice: 2 - asyncUploadBufferSize: 128 - asyncUploadPersistentBuffer: 1 - resolutionScalingFixedDPIFactor: 1 - customRenderPipeline: {fileID: 0} - excludedTargetPlatforms: - - Android - - serializedVersion: 2 - name: VRC Ultra - pixelLightCount: 8 - shadows: 2 - shadowResolution: 3 - shadowProjection: 1 shadowCascades: 4 shadowDistance: 150 shadowNearPlaneOffset: 2 diff --git a/ProjectSettings/lilToonSetting.json b/ProjectSettings/lilToonSetting.json index ddc41af5..9db1ea51 100644 --- a/ProjectSettings/lilToonSetting.json +++ b/ProjectSettings/lilToonSetting.json @@ -11,6 +11,7 @@ "LIL_FEATURE_SHADOW": true, "LIL_FEATURE_RECEIVE_SHADOW": true, "LIL_FEATURE_SHADOW_3RD": true, + "LIL_FEATURE_SHADOW_LUT": true, "LIL_FEATURE_EMISSION_1ST": true, "LIL_FEATURE_EMISSION_2ND": true, "LIL_FEATURE_ANIMATE_EMISSION_UV": true, @@ -34,6 +35,8 @@ "LIL_FEATURE_AUDIOLINK_VERTEX": true, "LIL_FEATURE_AUDIOLINK_LOCAL": true, "LIL_FEATURE_DISSOLVE": true, + "LIL_FEATURE_IDMASK": true, + "LIL_FEATURE_DITHER": true, "LIL_FEATURE_ENCRYPTION": false, "LIL_FEATURE_ANIMATE_OUTLINE_UV": true, "LIL_FEATURE_OUTLINE_TONE_CORRECTION": true, @@ -99,6 +102,7 @@ "LIL_OPTIMIZE_USE_FORWARDADD_SHADOW": false, "LIL_OPTIMIZE_USE_VERTEXLIGHT": true, "LIL_OPTIMIZE_USE_LIGHTMAP": false, + "LIL_OPTIMIZE_DEFFERED": false, "isLocked": false, "isDebugOptimize": false, "isOptimizeInTestBuild": false, @@ -109,6 +113,12 @@ "defaultBeforeExposureLimit": 10000.0, "defaultMonochromeLighting": 0.0, "defaultlilDirectionalLightStrength": 1.0, + "mainLightModeName": "", + "outlineLightModeName": "", + "preLightModeName": "", + "furLightModeName": "", + "furPreLightModeName": "", + "gemPreLightModeName": "", "presetSkin": { "instanceID": 0 }, diff --git a/docs/package.json b/docs/package.json index 0405a3d2..cbdfab88 100644 --- a/docs/package.json +++ b/docs/package.json @@ -26,7 +26,7 @@ "react-loadable": "^5.5.0", "react-medium-image-zoom": "^5.1.8", "react-modal": "^3.16.1", - "react-player": "^2.12.0" + "react-player": "^2.13.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.1", diff --git a/docs/yarn.lock b/docs/yarn.lock index 4a1180bf..67d14da7 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -7385,7 +7385,7 @@ __metadata: react-loadable: ^5.5.0 react-medium-image-zoom: ^5.1.8 react-modal: ^3.16.1 - react-player: ^2.12.0 + react-player: ^2.13.0 typescript: ^5.2.2 languageName: unknown linkType: soft @@ -8812,9 +8812,9 @@ __metadata: languageName: node linkType: hard -"react-player@npm:^2.12.0": - version: 2.12.0 - resolution: "react-player@npm:2.12.0" +"react-player@npm:^2.13.0": + version: 2.13.0 + resolution: "react-player@npm:2.13.0" dependencies: deepmerge: ^4.0.0 load-script: ^1.0.0 @@ -8823,7 +8823,7 @@ __metadata: react-fast-compare: ^3.0.1 peerDependencies: react: ">=16.6.0" - checksum: 77d3e55ed67cd9c1e2300a990d8015d270072daad41f8a0750c32748f3fbfbc5bd2a2f06e78ac6828c2260b84537b9571d0abac31d3e888b74a3dccb59a56365 + checksum: 7e0e69e0ac37227ab5bfdda73991d4f5d4741585562f3ad9cfb787ae2c427510b69ddf6ef3f23f319d699b790af852fca57f3e9b1dae94f385d545a3db200d67 languageName: node linkType: hard