From 2a54ab5a7981c19e5f0bfdf7083ffbfc478c65b3 Mon Sep 17 00:00:00 2001 From: emperorofmars Date: Tue, 22 Oct 2024 23:49:55 +0200 Subject: [PATCH] prepare for vpm packaging --- AVA/VRChat/Editor/AVAVRCRegistry.cs | 7 +++-- .../Editor/Features/VRCEyeTrackingBones.cs | 2 +- .../Features/VRCEyelidTrackingBlendshapes.cs | 4 +-- .../Editor/IAVAFeatureVRC.cs} | 2 +- .../Editor/IAVAFeatureVRC.cs.meta} | 2 +- .../Editor/Processors/VRCAvatarProcessor.cs | 6 ++-- AVA/VRChat/package.json | 30 +++++++++++++++++++ AVA/VRChat/package.json.meta | 7 +++++ NNA/package.json | 14 ++++++--- 9 files changed, 60 insertions(+), 14 deletions(-) rename AVA/{IAVAFeature.cs => VRChat/Editor/IAVAFeatureVRC.cs} (84%) rename AVA/{IAVAFeature.cs.meta => VRChat/Editor/IAVAFeatureVRC.cs.meta} (83%) create mode 100644 AVA/VRChat/package.json create mode 100644 AVA/VRChat/package.json.meta diff --git a/AVA/VRChat/Editor/AVAVRCRegistry.cs b/AVA/VRChat/Editor/AVAVRCRegistry.cs index 62dff54..06f31ad 100644 --- a/AVA/VRChat/Editor/AVAVRCRegistry.cs +++ b/AVA/VRChat/Editor/AVAVRCRegistry.cs @@ -5,12 +5,15 @@ namespace nna.ava.vrchat { - public static class AVAVRChatFeatures + // Very placeholder-y implementation, final system is going to work more comprehensively, with layers of functionality fallback. + public static class AVAVRCRegistry { - public static readonly Dictionary Features = new() { + public static readonly Dictionary DefaultFeatures = new() { {VRCEyeTrackingBones._Type, new VRCEyeTrackingBones()}, {VRCEyelidTrackingBlendshapes._Type, new VRCEyelidTrackingBlendshapes()} }; + + public static Dictionary Features {get => DefaultFeatures;} } } diff --git a/AVA/VRChat/Editor/Features/VRCEyeTrackingBones.cs b/AVA/VRChat/Editor/Features/VRCEyeTrackingBones.cs index 56539b6..93aa979 100644 --- a/AVA/VRChat/Editor/Features/VRCEyeTrackingBones.cs +++ b/AVA/VRChat/Editor/Features/VRCEyeTrackingBones.cs @@ -8,7 +8,7 @@ namespace nna.ava.vrchat { - public class VRCEyeTrackingBones : IAVAFeature + public class VRCEyeTrackingBones : IAVAFeatureVRC { public const string _Type = "ava.eyetracking"; public string Type => _Type; diff --git a/AVA/VRChat/Editor/Features/VRCEyelidTrackingBlendshapes.cs b/AVA/VRChat/Editor/Features/VRCEyelidTrackingBlendshapes.cs index e72c0c5..bdc5a2d 100644 --- a/AVA/VRChat/Editor/Features/VRCEyelidTrackingBlendshapes.cs +++ b/AVA/VRChat/Editor/Features/VRCEyelidTrackingBlendshapes.cs @@ -8,7 +8,7 @@ namespace nna.ava.vrchat { - public class VRCEyelidTrackingBlendshapes : IAVAFeature + public class VRCEyelidTrackingBlendshapes : IAVAFeatureVRC { public const string _Type = "ava.eyelidtracking"; public string Type => _Type; @@ -33,7 +33,7 @@ public bool AutoDetect(NNAContext Context, Component UnityComponent, JObject Jso avatar.customEyeLookSettings.eyelidsSkinnedMesh = smr; avatar.customEyeLookSettings.eyelidsBlendshapes = new int[3]; - // Also allow for these to be explicitely mapped in the nna component + // TODO: Also allow for these to be explicitely mapped in the nna component. if(MapEyeLidBlendshapes(smr.sharedMesh, "eye_closed") is var mappingEyeClosed && mappingEyeClosed != null) avatar.customEyeLookSettings.eyelidsBlendshapes[0] = GetBlendshapeIndex(smr.sharedMesh, mappingEyeClosed); diff --git a/AVA/IAVAFeature.cs b/AVA/VRChat/Editor/IAVAFeatureVRC.cs similarity index 84% rename from AVA/IAVAFeature.cs rename to AVA/VRChat/Editor/IAVAFeatureVRC.cs index eef225d..a3abaa0 100644 --- a/AVA/IAVAFeature.cs +++ b/AVA/VRChat/Editor/IAVAFeatureVRC.cs @@ -4,7 +4,7 @@ namespace nna.ava { - public interface IAVAFeature + public interface IAVAFeatureVRC { string Type {get;} bool AutoDetect(NNAContext Context, Component UnityComponent, JObject Json); diff --git a/AVA/IAVAFeature.cs.meta b/AVA/VRChat/Editor/IAVAFeatureVRC.cs.meta similarity index 83% rename from AVA/IAVAFeature.cs.meta rename to AVA/VRChat/Editor/IAVAFeatureVRC.cs.meta index 8c89f27..32cfda6 100644 --- a/AVA/IAVAFeature.cs.meta +++ b/AVA/VRChat/Editor/IAVAFeatureVRC.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: eb75b13d38abde5408c3a50236da4bc5 +guid: 7003e5509aa5a7b49a6bb3a51c07c1c9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/AVA/VRChat/Editor/Processors/VRCAvatarProcessor.cs b/AVA/VRChat/Editor/Processors/VRCAvatarProcessor.cs index da4fc49..2568498 100644 --- a/AVA/VRChat/Editor/Processors/VRCAvatarProcessor.cs +++ b/AVA/VRChat/Editor/Processors/VRCAvatarProcessor.cs @@ -25,9 +25,9 @@ public void Process(NNAContext Context) var animator = AVAVRCUtils.GetOrInitAnimator(Context); // Autodetect avatar features - foreach(var feature in AVAVRChatFeatures.Features) + foreach(var feature in AVAVRCRegistry.Features) { - //feature.Value.AutoDetect(Context, avatar, Json); + feature.Value.AutoDetect(Context, avatar, new JObject()); } } })); @@ -53,7 +53,7 @@ public void ProcessJson(NNAContext Context, Transform Node, JObject Json) else { // Autodetect avatar features - foreach(var feature in AVAVRChatFeatures.Features) + foreach(var feature in AVAVRCRegistry.Features) { feature.Value.AutoDetect(Context, avatar, Json); } diff --git a/AVA/VRChat/package.json b/AVA/VRChat/package.json new file mode 100644 index 0000000..2f0b4c5 --- /dev/null +++ b/AVA/VRChat/package.json @@ -0,0 +1,30 @@ +{ + "name": "com.squirrelbite.nna.unity.ava.vrc", + "displayName": "NNA-AVA implementation for VRChat", + "version": "0.0.1", + "description": "Converter for NNA-AVA components for VRChat", + "unity": "2022.3", + "unityRelease": "6f1", + "license": "MIT", + "dependencies": {}, + "keywords": [ + "nna", + "file", + "import" + ], + "author": { + "name": "Emperor of Mars", + "email": "mars@squirrel.pub", + "url": "https://github.com/emperorofmars/nna-unity" + }, + "type": "library", + "url": "", + "gitDependencies": {}, + "vpmDependencies": { + "com.vrchat.avatars" : "3.7.x", + "com.squirrelbite.nna.unity": "0.0.x" + }, + "legacyFolders": {}, + "legacyFiles": {}, + "hideInEditor": false +} diff --git a/AVA/VRChat/package.json.meta b/AVA/VRChat/package.json.meta new file mode 100644 index 0000000..0ffe35f --- /dev/null +++ b/AVA/VRChat/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc1a5e0bc33e8a94180d891f6efdfc4f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/NNA/package.json b/NNA/package.json index 7d8ff7c..4f33b50 100644 --- a/NNA/package.json +++ b/NNA/package.json @@ -1,8 +1,8 @@ { - "name": "com.squirrelbite.nna-unity", - "version": "0.0.1", + "name": "com.squirrelbite.nna.unity", "displayName": "Node Name Abuse", - "description": "AssetPostprocessor which converts information serialized into node-names into Unity constructs.", + "version": "0.0.1", + "description": "AssetPostprocessor which converts information serialized into FBX node-names into Unity constructs.", "unity": "2022.3", "unityRelease": "6f1", "license": "MIT", @@ -19,5 +19,11 @@ "email": "mars@squirrel.pub", "url": "https://github.com/emperorofmars/nna-unity" }, - "type": "library" + "type": "library", + "url": "", + "gitDependencies": {}, + "vpmDependencies": {}, + "legacyFolders": {}, + "legacyFiles": {}, + "hideInEditor": false }