diff --git a/BFI_VRCFT_Module/BFI_VRCFT_Module.cs b/BFI_VRCFT_Module/BFI_VRCFT_Module.cs index 1b9058a..76d6ca8 100644 --- a/BFI_VRCFT_Module/BFI_VRCFT_Module.cs +++ b/BFI_VRCFT_Module/BFI_VRCFT_Module.cs @@ -1,6 +1,7 @@ namespace BFI_VRCFT_Module { using Microsoft.Extensions.Logging; + using System.IO; using System.Linq.Expressions; using System.Net; using System.Text.Json; @@ -202,7 +203,7 @@ public override void Update() { if (reciever.expressions.Expressions.ContainsKey(tagSmile)) { - frown.Weight = Clampf01((-reciever.expressions.Expressions[tagSmile].Weight) + reciever.expressions.Expressions[tagFrown].Weight); + frown.Weight = ClampfMinus11((-reciever.expressions.Expressions[tagSmile].Weight) + reciever.expressions.Expressions[tagFrown].Weight); } else { @@ -319,6 +320,11 @@ private float Clampf01(float value)//clamps value between 0 and 1 return Math.Clamp(value, 0, 1); } + private float ClampfMinus11(float value)//clamps value between 0 and 1 + { + return Math.Clamp(value, -1, 1); + } + } } \ No newline at end of file diff --git a/BFI_VRCFT_Module/BFI_VRCFT_Module.csproj b/BFI_VRCFT_Module/BFI_VRCFT_Module.csproj index 5ef48da..9ce75d0 100644 --- a/BFI_VRCFT_Module/BFI_VRCFT_Module.csproj +++ b/BFI_VRCFT_Module/BFI_VRCFT_Module.csproj @@ -26,4 +26,8 @@ + + + + diff --git a/ReadMe.md b/ReadMe.md index 2120e52..fd42258 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -62,9 +62,8 @@ Here's the command to launch BFI with the right launch option if you leave the p ⚠️The port can be configured at the bottom of `config.json` -### 3 - Drag and drop the latest release of the module in your VRCFT CustomLibs folder 📁 +### 3 - Go to VRCFT's modules registery tab, click the `+` button and select the latest release of the module 📁 -Make sure that the name of the folder containing `BFI_VRCFT_Module.dll` & `module.json` & `config.json` is named `91a90618-b020-4064-8832-809b2ca2b3be` ### 4 - Launch VRCFT ✔️ @@ -74,12 +73,12 @@ Enjoy >todo: record gifs to show what the expressions to train for look like -| Reference | Expression | Description | -|:---:| :-------------: | :-------------: | -| gif | eyeclosed | eyelids closing fully | -| gif | smile | smile with mouth opened | -| gif | frown | n shaped frown | -| gif | anger | brow going down | -| gif | cringe | mouth stretches and reveles the bottom teeth | -| gif | cheekpuff | cheek puffs | -| gif | apeshape | lower jaw while keeping the mouth closed | \ No newline at end of file +| Reference | Expression | Description | +|:---: | :-------------: | :-------------: | +| eyeclosed | eyeclosed | eyelids closing fully | +| smile | smile | smile with mouth opened | +| frown | frown | n shaped frown | +| anger | anger | brow going down | +| cringe | cringe | mouth stretches and reveles the bottom teeth | +| cheekpuff | cheekpuff | cheek puffs | +| apeshape | apeshape | lower jaw while keeping the mouth closed | \ No newline at end of file diff --git a/debugTools/fakeBFI.py b/debugTools/fakeBFI.py new file mode 100644 index 0000000..c9cdc63 --- /dev/null +++ b/debugTools/fakeBFI.py @@ -0,0 +1,58 @@ +import tkinter as tk +from tkinter import ttk +from pythonosc import udp_client + +class OSCSliderApp: + def __init__(self, root, num_sliders): + self.root = root + self.num_sliders = num_sliders + self.clients = [None] * num_sliders + + self.osc_addresses = [tk.StringVar(value="127.0.0.1:8999") for _ in range(num_sliders)] + self.osc_paths = [tk.StringVar(value=f"/BFI/MLAction/Action{i}") for i in range(num_sliders)] + self.sliders = [] + + self.setup_ui() + + def setup_ui(self): + for i in range(self.num_sliders): + frame = ttk.Frame(self.root) + frame.pack(pady=10, fill=tk.X) + + # OSC Address input for each slider + ttk.Label(frame, text=f"OSC Address for Slider {i+1} (ip:port):").pack(side=tk.LEFT) + ttk.Entry(frame, textvariable=self.osc_addresses[i]).pack(side=tk.LEFT) + + # OSC Path input for each slider + ttk.Label(frame, text=f"OSC Path for Slider {i+1}:").pack(side=tk.LEFT) + ttk.Entry(frame, textvariable=self.osc_paths[i]).pack(side=tk.LEFT) + + # Slider + slider = tk.Scale(frame, from_=0, to=1, resolution=0.01, orient=tk.HORIZONTAL, command=lambda val, idx=i: self.send_osc_message(idx, val)) + slider.pack(fill=tk.X, padx=10, pady=5) + self.sliders.append(slider) + + def send_osc_message(self, slider_index, value): + address = self.osc_addresses[slider_index].get() + path = self.osc_paths[slider_index].get() + if not address or not path: + print(f"OSC address or path for slider {slider_index+1} is not set.") + return + + if self.clients[slider_index] is None: + try: + ip, port = address.split(':') + self.clients[slider_index] = udp_client.SimpleUDPClient(ip, int(port)) + except ValueError: + print(f"Invalid OSC address format for slider {slider_index+1}. Expected format is ip:port.") + return + + osc_path = path + self.clients[slider_index].send_message(osc_path, float(value)) + print(f"Sent {value} to {osc_path}") + +if __name__ == "__main__": + root = tk.Tk() + root.title("OSC Slider App") + app = OSCSliderApp(root, num_sliders=8) # Change the number of sliders as needed + root.mainloop() \ No newline at end of file diff --git a/debugTools/readme b/debugTools/readme new file mode 100644 index 0000000..e9cb06b --- /dev/null +++ b/debugTools/readme @@ -0,0 +1 @@ +This is a dummy app to emulate BFI actions \ No newline at end of file diff --git a/demogifs/anger.gif b/demogifs/anger.gif new file mode 100644 index 0000000..d00c959 Binary files /dev/null and b/demogifs/anger.gif differ diff --git a/demogifs/apeshape.gif b/demogifs/apeshape.gif new file mode 100644 index 0000000..918f658 Binary files /dev/null and b/demogifs/apeshape.gif differ diff --git a/demogifs/cheekpuff.gif b/demogifs/cheekpuff.gif new file mode 100644 index 0000000..cb5a9bd Binary files /dev/null and b/demogifs/cheekpuff.gif differ diff --git a/demogifs/cringe.gif b/demogifs/cringe.gif new file mode 100644 index 0000000..cf961ef Binary files /dev/null and b/demogifs/cringe.gif differ diff --git a/demogifs/eyeclosed.gif b/demogifs/eyeclosed.gif new file mode 100644 index 0000000..a533983 Binary files /dev/null and b/demogifs/eyeclosed.gif differ diff --git a/demogifs/frown.gif b/demogifs/frown.gif new file mode 100644 index 0000000..496e63a Binary files /dev/null and b/demogifs/frown.gif differ diff --git a/demogifs/smile.gif b/demogifs/smile.gif new file mode 100644 index 0000000..9b364e7 Binary files /dev/null and b/demogifs/smile.gif differ diff --git a/module.json b/res/module.json similarity index 70% rename from module.json rename to res/module.json index ad42771..5e5d785 100644 --- a/module.json +++ b/res/module.json @@ -2,14 +2,14 @@ "InstallationState": 0, "ModuleId": "91a90618-b020-4064-8832-809b2ca2b3be", "LastUpdated": "2024-01-30T17:18:18Z", - "Version": "0.2", + "Version": "0.3.6", "Downloads": 69420, "Ratings": 69420, "Rating": 5.0, "AuthorName": "Hash", "ModuleName": "BFIVRC Module", - "ModuleDescription": "Let's you use specific BFI actions to control VRCFT Parameters", - "UsageInstructions": "You need to have the following actions mapped:\n Action1:EyeClosed, Action2:Smile, Action3:Frown, Action4:Angry, Action5:Confused", + "ModuleDescription": "Let's you use specific BFI actions to control expressions on VRCFT compatible avatars", + "UsageInstructions": "Please map actions and rederict BFI's OSC data to 127.0.0.1:8999, more infos on the GitHub", "DownloadUrl": "https://github.com/HashEdits/BFI_VRCFT_Module", "ModulePageUrl": "https://github.com/HashEdits/BFI_VRCFT_Module", "DllFileName": "BFI_VRCFT_Module.dll" diff --git a/res/moduleupdate.py b/res/moduleupdate.py new file mode 100644 index 0000000..ccfe3df --- /dev/null +++ b/res/moduleupdate.py @@ -0,0 +1,15 @@ +import json +import datetime +from json import JSONEncoder +f = open("module.json") + +data = json.load(f) +versionstr = data["Version"] +x,y,z = versionstr.split(".") +z = str(int(z)+1) +data["Version"] = x+ "." + y + "." + z +data["LastUpdated"] = datetime.datetime.now().isoformat() +f.close() +f = open("module.json", "w+") +json.dump(data, f, ensure_ascii=False, indent=4) +f.close() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy