diff options
| author | yum <yum.food.vr@gmail.com> | 2022-09-30 13:13:57 -0700 |
|---|---|---|
| committer | yum <yumfood@airmail.cc> | 2022-09-30 13:13:57 -0700 |
| commit | 73bbba9de5210ae7f895ae82bd2524eb76e3a38c (patch) | |
| tree | 79104c9fb250ef4645ad441326fb2593664b403c | |
| parent | 0f2df6dc021fe0a7d6f5764473198558dafe7ad6 (diff) | |
begin unity-native port
| -rw-r--r-- | TaSTT.cs | 78 | ||||
| -rw-r--r-- | osc_ctrl.py | 4 |
2 files changed, 80 insertions, 2 deletions
diff --git a/TaSTT.cs b/TaSTT.cs new file mode 100644 index 0000000..d9901d6 --- /dev/null +++ b/TaSTT.cs @@ -0,0 +1,78 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEditor.Animations;
+using UnityEngine;
+using VRC.SDK3.Avatars.Components;
+using VRC.SDK3.Avatars.ScriptableObjects;
+
+namespace TaSTT
+{
+ public class TaSTT : EditorWindow
+ {
+ private static TaSTT instance_;
+ private GameObject avatar_root_;
+ private AnimatorController fx_controller_;
+
+ [MenuItem("Window/TaSTT")]
+ private static void ShowWindow()
+ {
+ instance_ = GetWindow<TaSTT>();
+ instance_.titleContent = new GUIContent("TaSTT");
+ }
+
+ private void Draw()
+ {
+ GUILayout.Label("TaSTT: A free VRChat STT");
+ GUILayout.Label("Made with love by yum_food");
+ GUILayout.Label("");
+
+ avatar_root_ = (GameObject)EditorGUILayout.ObjectField(
+ new GUIContent("Avatar Root"), avatar_root_,
+ typeof(GameObject), true);
+ fx_controller_ = (AnimatorController)EditorGUILayout.ObjectField(
+ new GUIContent("FX Controller"), fx_controller_,
+ typeof(AnimatorController), true);
+
+ if (GUILayout.Button("Create animations!"))
+ {
+ if (avatar_root_ == null || !fx_controller_ == null)
+ {
+ // TODO(yum_food) why doesn't EditorGUILayout.HelpBox() work here?
+ Debug.LogError("Avatar root or FX controller are not set! Cannot create animations.");
+ return;
+ }
+ // TODO(yum_food)
+ }
+ if (GUILayout.Button("Create FX layer!"))
+ {
+ if (!avatar_root_ == null || !fx_controller_ == null)
+ {
+ Debug.LogError("Avatar root or FX controller are not set! Cannot create FX layer.");
+ return;
+ }
+ // TODO(yum_food)
+ }
+ }
+
+ private static void CreateAnimations()
+ {
+ VRCAvatarDescriptor descriptor = avatar_root_.GetComponent<VRCAvatarDescriptor>();
+ if (descriptor == null)
+ {
+ Debug.LogError("Failed to get avatar descriptor");
+ return;
+ }
+ AnimationClip anim = new AnimationClip();
+ clip.frameRate = 1f;
+ }
+
+ private void OnGUI()
+ {
+ if (instance_ != null)
+ {
+ Draw();
+ }
+ }
+ }
+}
diff --git a/osc_ctrl.py b/osc_ctrl.py index 918b636..21386c4 100644 --- a/osc_ctrl.py +++ b/osc_ctrl.py @@ -26,7 +26,7 @@ for row in range(0, 6): addr="/avatar/parameters/TaSTT_Col" client.send_message(addr, col) - time.sleep(0.01) + time.sleep(.5) addr="/avatar/parameters/TaSTT_Active" client.send_message(addr, True) @@ -35,7 +35,7 @@ for row in range(0, 6): client.send_message(addr, (seed + row * 14 + col) % 65) print("sent {} at {},{}".format((seed + row * 14 + col) % 65, row, col)) - time.sleep(0.01) + time.sleep(.5) addr="/avatar/parameters/TaSTT_Active" client.send_message(addr, False) |
