Skip to content

Commit

Permalink
prepare for vpm packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
emperorofmars committed Oct 22, 2024
1 parent 3da2ee2 commit 2a54ab5
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 14 deletions.
7 changes: 5 additions & 2 deletions AVA/VRChat/Editor/AVAVRCRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, IAVAFeature> Features = new() {
public static readonly Dictionary<string, IAVAFeatureVRC> DefaultFeatures = new() {
{VRCEyeTrackingBones._Type, new VRCEyeTrackingBones()},
{VRCEyelidTrackingBlendshapes._Type, new VRCEyelidTrackingBlendshapes()}
};

public static Dictionary<string, IAVAFeatureVRC> Features {get => DefaultFeatures;}
}
}

Expand Down
2 changes: 1 addition & 1 deletion AVA/VRChat/Editor/Features/VRCEyeTrackingBones.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions AVA/VRChat/Editor/Features/VRCEyelidTrackingBlendshapes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion AVA/IAVAFeature.cs → AVA/VRChat/Editor/IAVAFeatureVRC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace nna.ava
{
public interface IAVAFeature
public interface IAVAFeatureVRC
{
string Type {get;}
bool AutoDetect(NNAContext Context, Component UnityComponent, JObject Json);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions AVA/VRChat/Editor/Processors/VRCAvatarProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}));
Expand All @@ -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);
}
Expand Down
30 changes: 30 additions & 0 deletions AVA/VRChat/package.json
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 7 additions & 0 deletions AVA/VRChat/package.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions NNA/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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
}

0 comments on commit 2a54ab5

Please sign in to comment.