vrchat-community / osc

Files and Info on using OSC to communicate with VRChat
MIT License
234 stars 5 forks source link

ability to change gesture parameters via osc #42

Open EIA485 opened 2 years ago

EIA485 commented 2 years ago

*What's the idea?** id like to change my Gesture and GestureWeight parameters via osc /avatar/parameters/GestureLeft /avatar/parameters/GestureLeftWeight /avatar/parameters/GestureRight /avatar/parameters/GestureRightWeight

RicardoEscobar commented 11 months ago

YouTube Video YoutubeVideo Hello, I'm trying to change facial gestures via Python using OSC. I'm using the python-osc library

However, I have managed to successfully send messages using OSC in VRChat; however, the hands remain stationary, and the facial expression remains unchanged.

No gestures.

I was wondering if this is yet to be implemented or if I'm doing something wrong. Please check the video for a demo of what I'm trying to do.

I even tried using PyAutoGUI a python keyboard library to try to use (left shit + F1..F8) and (left shit + F1..F8) from Python but VRchat does not allow those scripts to press buttons. I may only use my actual keyboard for that.

Thanks for your time, I leave an example script describing what I'm trying to achieve.


import time
from pythonosc.udp_client import SimpleUDPClient

# Constants
ip = "127.0.0.1"
port = 9000
address_gesture_left = "/avatar/parameters/GestureLeft"
address_gesture_right = "/avatar/parameters/GestureRight"

# Create client
client = SimpleUDPClient(ip, port)

def loop_messages(
        address: str = address_emote,
        sleep_time: int = 3,
        start_value: int = 0,
        end_value: int = 26,
        step: int = 1):
    """Send messages to the server."""
    for x in range(start_value,end_value, step):
        client.send_message(address, x)
        print("Sent message to {} with value {}".format(address, x))
        time.sleep(sleep_time)

def main():
    loop_messages(
        address="/avatar/parameters/GestureLeft",
        sleep_time=1,
        start_value=0,
        end_value=8,
    )

    send_chatbox_message("Testing GestureRight")
    loop_messages(
        address="/avatar/parameters/GestureRight",
        sleep_time=1,
        start_value=0,
        end_value=8,
    )