-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UI button actions to send arbitrary OSC values. #140
Conversation
a button action that sends an osc parameter. struggling with borrows in openxr.rs and openvr.rs when getting the osc sender.
by passing a ref to the device list to send_params instead of the entire app state.
i love the idea! |
i just want to use OscType directly, but since it doesn't derive serde::Deserialize, i can't just have one OscType action or list of actions...
i'm not 100% happy with having a separate action per-type, and it's currently limited to one argument per parameter (so no vrchat chatbox messages, for example), but i'm not sure if i can do that without modifying something somewhere to make OscType serialisable. ideally i want to use something like the following format:
but, i'll mark this as ready if you're happy to merge this as-is. edit: i came back and tried again with a "stepping-stone" enum for deserialisation that gets converted to the appropriate OscType when sending. much happier, but needs testing. |
i added a new struct OscValue that has Deserialize, and now the action just converts that to the corresponding OscType when sending the parameters. perhaps not the most elegant solution, but it's the best i can think of without modifying the rosc crate.
ok, after a brief test it seems to be working, and my avatar's issue of not detecting the True value is resolved now that it's actually a Bool. (perhaps was a vrchat bug...) here's the testing buttons i used:
osc.mp4 |
wrote a section for |
did you do a |
looks good otherwise |
|
Just adds an action to buttons that sends a Float to an address over OSC. (e.g. to control a VRChat avatar, or some other OSC application)
I've just implemented it with
OscType::Float
for now since it can represent Float, Int, and Bool. (at least for VRChat)Unsure if making separate actions for each type or trying to handle the type internally somehow (
type: float
orfloat_value: 3.5
) is better. (in draft for feedback)It also merges the OSC client creation from openxr.rs and openvr.rs into state.rs
state.app
, and makes osc.rssend_params()
take in a list of devices instead ofapp_state
itself, since I was having borrow issues callingapp.sender.send_params(overlays, app)
(approximately).Small note, setting a bool to 0 works as False, and setting it to 1 shows up as True in VRChat's OSC debug panel, but my avatar doesn't react to the True state. Not sure if I broke something on my avatar, or what. Needs some more testing.
Would also need to update documentation here:
https://github.com/galister/wlx-overlay-s/wiki/Customize-UI#button-actions