Skip to content

Commit

Permalink
[GestureManager 3.8.3] Fidelity Update~
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackStartx committed Mar 13, 2023
1 parent 0a14e71 commit 57aa88f
Show file tree
Hide file tree
Showing 26 changed files with 184 additions and 139 deletions.
Binary file added .markdown/Debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .markdown/Options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .markdown/ThanksTo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .markdown/Tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .support
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"early":[{"name":"Stack_"},{"name":"Ahri~"},{"name":"Nayu"},{"name":"♡ GaNyan ♡"},{"name":"TheIceDragonz"},{"name":"NinaV2"},{"name":"emymin"},{"name":"Zettai Ryouiki"},{"name":"NekOwneD"},{"name":"lindesu"},{"name":"OptoCloud"},{"name":"lukasong"}],"supporter":[{"name":"Hiro N.","background":{"r":1.0,"g":0.4000000059604645,"b":0.8199999928474426,"a":1.0},"text":{"r":1.0,"g":0.6899999976158142,"b":0.019999999552965165,"a":1.0}},{"name":"Dominhiho","background":{"r":0.0,"g":1.0,"b":0.6899999976158142,"a":1.0},"text":{"r":1.0,"g":0.46000000834465029,"b":0.0,"a":1.0}},{"name":"maple","background":{"r":0.0,"g":0.0,"b":0.5099999904632568,"a":1.0},"text":{"r":0.0,"g":0.8899999856948853,"b":0.029999999329447748,"a":1.0}}]}
{"early":[{"name":"Stack_"},{"name":"Ahri~"},{"name":"Nayu"},{"name":"♡ GaNyan ♡"},{"name":"TheIceDragonz"},{"name":"NinaV2"},{"name":"emymin"},{"name":"Zettai Ryouiki"},{"name":"NekOwneD"},{"name":"lindesu"},{"name":"OptoCloud"},{"name":"lukasong"},{"name":".Rei."},{"name":""},{"name":""}],"supporter":[{"name":"Hiro N.","background":{"r":1.0,"g":0.4000000059604645,"b":0.8199999928474426,"a":1.0},"text":{"r":1.0,"g":0.6899999976158142,"b":0.019999999552965165,"a":1.0}},{"name":"Dominhiho","background":{"r":0.0,"g":1.0,"b":0.6899999976158142,"a":1.0},"text":{"r":1.0,"g":0.46000000834465029,"b":0.0,"a":1.0}},{"name":"maple","background":{"r":0.0,"g":0.0,"b":0.5099999904632568,"a":1.0},"text":{"r":0.0,"g":0.8899999856948853,"b":0.029999999329447748,"a":1.0}}]}
4 changes: 2 additions & 2 deletions .v3rsion
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.8.2
https://github.com/BlackStartx/VRC-Gesture-Manager/releases/tag/v3.8.2
3.8.3
https://github.com/BlackStartx/VRC-Gesture-Manager/releases/tag/v3.8.3
12 changes: 0 additions & 12 deletions GestureManager.prefab
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1196135828297054}
m_IsPrefabParent: 1
--- !u!1 &1196135828297054
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -54,4 +43,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2398979b1d0d84349abc5ee9f0571350, type: 3}
m_Name:
m_EditorClassIdentifier:
customAnim: {fileID: 0}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 BlackStartx
Copyright © 2019-2023 BlackStartx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,30 @@ the RadialMenu bellow.

![img.png](.markdown/3.8/TestingStart.png)

### Option Button!
![img.png](.markdown/Tools.png)

There are other features that can help you creating and testing your avatar easier.

Those feature are under the "Tools" tab.

# - Scene Camera

This tool will match the GameView camera with the SceneView camera.

Useful to move the camera around and test PhysBones and Contacts~

https://user-images.githubusercontent.com/26898122/224570606-125f3838-c97e-4379-afdf-42c989bad5cb.mp4

# - Clickable Contacts

This tool will trigger contact if clicked over with the mouse, similar to how PhysBones works.

You can also define a tag to filter the affected contacts!

https://user-images.githubusercontent.com/26898122/224572259-252527e0-b1ee-4121-8940-3e3ba618025a.mp4

![img.png](.markdown/Options.png)

The Option button in the RadialMenu contains a lot of sub-category that helps you change parameters usually
controlled by the VRChat client.

Expand All @@ -67,7 +90,7 @@ In the **Extra** category you can change Gesture Weights, MuteSelf, IsLocal and

> If a button have a gray text it means that the parameter is not used by your avatar.
### Edit-Mode Feature
# - Edit Mode
In the Option Menu you can find a button called: Edit-Mode.

Clicking that button will enable the Edit-Mode feature and will create a clone of your avatar
Expand All @@ -85,10 +108,12 @@ From here, you can edit your animation as you usually do, by clicking the record

![img.png](.markdown/3.2/Editing.png)

### Avatar Debug Menu
![alt text](.markdown/Debug.png)

The Debug tab of the Gesture Manager is where you can check lots of information about the current state of your avatar.

# Avatar Debug

This window contains: Animator Parameters, Tracking Controls, Animation Controllers Weight, Animator States and Layer
Weights as well as Locomotion and Pose Space current values.

Expand All @@ -98,15 +123,13 @@ clicking the `Undock Debug Window` button bellow.
This will create a floating window that you can move independently.
You can maximize it on another screen too, if you wish.

You can put the floating debug window wherever you want and use the Gesture Manager as you usually do.

> The Debug Window is responsive, it will change the way content displayed inside of it depending of the width of the window.
#### Debug Window Example

![img.gif](.markdown/Debug/DebugAvatar.gif)

### Osc Debug Menu
# Osc Menu

In the Debug tab you can enable the integration for OSC data packages.

Expand Down Expand Up @@ -166,7 +189,7 @@ each gesture has the name of the animation file its related.

![alt text](.markdown/2.0/TestingStart.png)

## Special Thanks~
![alt text](.markdown/ThanksTo.png)
Thanks to every friend and person who helped or supported me during the development of this tool~

- Stack_
Expand All @@ -181,6 +204,7 @@ Thanks to every friend and person who helped or supported me during the developm
- [lindesu](https://github.vrlabs.dev/)
- OptoCloud
- lukasong
- .Rei.

Special thanks to:

Expand Down
Binary file removed Resources/Vrc3/.psdData/BSX_GM_Emojis (Troll).png
Binary file not shown.
Binary file removed Resources/Vrc3/.psdData/BSX_GM_Emojis.png
Binary file not shown.
Binary file removed Resources/Vrc3/.psdData/BSX_GM_Option.psd
Binary file not shown.
8 changes: 4 additions & 4 deletions Scripts/Editor/GestureManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GestureManagerEditor : UnityEditor.Editor
{
private GestureManager Manager => target as GestureManager;
private static IEnumerable<GmgAvatarDescriptor> Descriptors => FindSceneObjectsOfTypeAll<GmgAvatarDescriptor>();
private IEnumerable<ModuleBase> Modules => Descriptors.Select(descriptor => ModuleHelper.GetModuleFor(Manager, descriptor)).Where(module => module != null);
private static IEnumerable<ModuleBase> Modules => Descriptors.Select(ModuleHelper.GetModuleFor).Where(module => module != null);
private static bool IsValidObject(GameObject g) => g.hideFlags != HideFlags.NotEditable && g.hideFlags != HideFlags.HideAndDontSave && g.scene.name != null;
private static IEnumerable<T> FindSceneObjectsOfTypeAll<T>() where T : Component => Resources.FindObjectsOfTypeAll<T>().Where(t => IsValidObject(t.gameObject));

Expand Down Expand Up @@ -171,15 +171,15 @@ private void OnAvatarSwitch(GameObject obj)
{
if (obj)
{
var module = ModuleHelper.GetModuleFor(Manager, obj);
var module = ModuleHelper.GetModuleFor(obj);
if (module != null && module.IsValidDesc()) Manager.SetModule(module);
}
else Manager.UnlinkModule();
}

private ModuleBase GetValidDescriptor() => CheckActiveModules().FirstOrDefault(module => module.IsPerfectDesc());
private static ModuleBase GetValidDescriptor() => CheckActiveModules().FirstOrDefault(module => module.IsPerfectDesc());

private List<ModuleBase> CheckActiveModules() => GestureManager.LastCheckedActiveModules = Modules.ToList();
private static List<ModuleBase> CheckActiveModules() => GestureManager.LastCheckedActiveModules = Modules.ToList();

private static void DiscordPopup(string discord)
{
Expand Down
8 changes: 4 additions & 4 deletions Scripts/Editor/Modules/ModuleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ namespace BlackStartX.GestureManager.Editor.Modules
{
public static class ModuleHelper
{
public static ModuleBase GetModuleFor(GestureManager manager, GameObject gameObject) => GetModuleFor(manager, gameObject.GetComponent<GmgAvatarDescriptor>());
public static ModuleBase GetModuleFor(GameObject gameObject) => GetModuleFor(gameObject.GetComponent<GmgAvatarDescriptor>());

public static ModuleBase GetModuleFor(GestureManager manager, GmgAvatarDescriptor descriptorComponent)
public static ModuleBase GetModuleFor(GmgAvatarDescriptor descriptorComponent)
{
switch (descriptorComponent)
{
#if VRC_SDK_VRCSDK2
case VRCSDK2.VRC_AvatarDescriptor descriptorV2:
return new Vrc2.ModuleVrc2(manager, descriptorV2);
return new Vrc2.ModuleVrc2(descriptorV2);
#endif
#if VRC_SDK_VRCSDK3
case VRC.SDK3.Avatars.Components.VRCAvatarDescriptor descriptorV3:
return new Vrc3.ModuleVrc3(manager, descriptorV3);
return new Vrc3.ModuleVrc3(descriptorV3);
#endif
default: return null;
}
Expand Down
32 changes: 16 additions & 16 deletions Scripts/Editor/Modules/Vrc2/ModuleVrc2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,22 @@ public class ModuleVrc2 : ModuleBase
HumanBodyBones.UpperChest
};

public ModuleVrc2(GestureManager manager, VRC_AvatarDescriptor avatarDescriptor) : base(manager, avatarDescriptor) => _avatarDescriptor = avatarDescriptor;
public ModuleVrc2(VRC_AvatarDescriptor avatarDescriptor) : base(avatarDescriptor) => _avatarDescriptor = avatarDescriptor;

public override void Update()
{
if (_emote != 0 || Manager.PlayingCustomAnimation) _controlDelay = 5;
if (_emote != 0 || PlayingCustomAnimation) _controlDelay = 5;
else if (_controlDelay <= 0) SavePose(AvatarAnimator);
else _controlDelay--;

AvatarAnimator.SetInteger(_handGestureLeft, Manager.PlayingCustomAnimation || _emote != 0 ? 8 : Left);
AvatarAnimator.SetInteger(_handGestureRight, Manager.PlayingCustomAnimation || _emote != 0 ? 8 : Right);
AvatarAnimator.SetInteger(_emoteHash, Manager.PlayingCustomAnimation ? 9 : _emote);
AvatarAnimator.SetInteger(_handGestureLeft, PlayingCustomAnimation || _emote != 0 ? 8 : Left);
AvatarAnimator.SetInteger(_handGestureRight, PlayingCustomAnimation || _emote != 0 ? 8 : Right);
AvatarAnimator.SetInteger(_emoteHash, PlayingCustomAnimation ? 9 : _emote);
}

public override void LateUpdate()
{
if (_emote != 0 || Manager.PlayingCustomAnimation) return;
if (_emote != 0 || PlayingCustomAnimation) return;
SetPose(AvatarAnimator);
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public override void EditorContent(object editor, VisualElement element)
{
("Gestures", () =>
{
if (_emote != 0 || Manager.PlayingCustomAnimation)
if (_emote != 0 || PlayingCustomAnimation)
{
using (new GUILayout.HorizontalScope(GestureManagerStyles.EmoteError))
{
Expand Down Expand Up @@ -225,16 +225,16 @@ public override void EditorContent(object editor, VisualElement element)
GUILayout.Label("Force animation.", GestureManagerStyles.GuiHandTitle);
using (new GUILayout.HorizontalScope())
{
if (!(_selectingCustomAnim = GmgLayoutHelper.ObjectField("Animation: ", _selectingCustomAnim, Manager.SetCustomAnimation))) GUI.enabled = false;
if (!Manager.PlayingCustomAnimation || _emote != 0)
if (!(_selectingCustomAnim = GmgLayoutHelper.ObjectField("Animation: ", _selectingCustomAnim, SetCustomAnimation))) GUI.enabled = false;
if (!PlayingCustomAnimation || _emote != 0)
{
if (GUILayout.Button("Play", _options))
{
_emote = 0;
Manager.PlayCustomAnimation(_selectingCustomAnim);
PlayCustomAnimation(_selectingCustomAnim);
}
}
else if (GUILayout.Button("Stop", GuiGreenButton)) Manager.StopCustomAnimation();
else if (GUILayout.Button("Stop", GuiGreenButton)) StopCustomAnimation();

GUI.enabled = true;
}
Expand All @@ -248,7 +248,7 @@ public override void EditorContent(object editor, VisualElement element)

public override string GetGestureTextNameByIndex(int gestureIndex) => GetFinalGestureByIndex(gestureIndex).name;

public override Animator OnCustomAnimationPlay(AnimationClip animationClip)
protected override Animator OnCustomAnimationPlay(AnimationClip animationClip)
{
SetupOverride(_usingType, false);
AvatarAnimator.applyRootMotion = animationClip;
Expand Down Expand Up @@ -296,19 +296,19 @@ private void OnEmoteButton(int current, Action<int> play, Action stop)
private void OnEmoteStart(int emoteIndex)
{
_emote = emoteIndex;
Manager.PlayCustomAnimation(GetEmoteByIndex(emoteIndex - 1));
PlayCustomAnimation(GetEmoteByIndex(emoteIndex - 1));
}

private void OnEmoteStop()
{
_emote = 0;
Manager.StopCustomAnimation();
StopCustomAnimation();
}

private void StopCurrentEmote()
{
if (_emote != 0) OnEmoteStop();
if (Manager.PlayingCustomAnimation) Manager.StopCustomAnimation();
if (PlayingCustomAnimation) StopCustomAnimation();
}

private void SetupOverride(ControllerType controllerType, bool saveController)
Expand All @@ -325,7 +325,7 @@ private void SetupOverride(ControllerType controllerType, bool saveController)

var finalOverride = new List<KeyValuePair<AnimationClip, AnimationClip>>
{
new KeyValuePair<AnimationClip, AnimationClip>(_myRuntimeOverrideController["[EXTRA] CustomAnimation"], Manager.customAnim)
new KeyValuePair<AnimationClip, AnimationClip>(_myRuntimeOverrideController["[EXTRA] CustomAnimation"], CustomAnim)
};

var validOverrides = new List<KeyValuePair<AnimationClip, AnimationClip>>();
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Editor/Modules/Vrc3/DummyModes/Vrc3TestMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal Vrc3TestMode(ModuleVrc3 module) : base(module, "[Testing]")
{
}

protected internal override void StopExecution() => Module.Manager.StopCustomAnimation();
protected internal override void StopExecution() => Module.StopCustomAnimation();

public override RadialDescription DummyDescription() => null;

Expand Down
Loading

0 comments on commit 57aa88f

Please sign in to comment.