https://github.com/pykeio/vmc
Rust implementation of Virtual Motion Capture protocol
https://github.com/pykeio/vmc
rust virtual-motion-capture vmc vrm
Last synced: 5 months ago
JSON representation
Rust implementation of Virtual Motion Capture protocol
- Host: GitHub
- URL: https://github.com/pykeio/vmc
- Owner: pykeio
- License: apache-2.0
- Created: 2023-08-10T02:10:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T08:04:11.000Z (6 months ago)
- Last Synced: 2025-05-11T07:09:38.684Z (5 months ago)
- Topics: rust, virtual-motion-capture, vmc, vrm
- Language: Rust
- Homepage: https://docs.rs/vmc
- Size: 151 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# `vmc`
An asynchronous implementation of the [Virtual Motion Capture Protocol](https://protocol.vmc.info/) in Rust.## Examples
See [`examples/`](https://github.com/vitri-ent/vmc/tree/main/examples/) for more detailed examples.### Performer
```rs
use vmc::{ApplyBlendShapes, BlendShape, ModelState, StandardVRMBlendShape, State, Time};#[tokio::main]
async fn main() -> vmc::Result<()> {
let socket = vmc::performer!("127.0.0.1:39539").await?;
loop {
socket.send(BlendShape::new(StandardVRMBlendShape::Joy, 1.0)).await?;
socket.send(ApplyBlendShapes).await?;
socket.send(State::new(ModelState::Loaded)).await?;
socket.send(Time::elapsed()).await?;
}
}
```### Marionette
```rs
use tokio_stream::StreamExt;
use vmc::Message;#[tokio::main]
async fn main() -> vmc::Result<()> {
let mut socket = vmc::marionette!("127.0.0.1:39539").await?;
while let Some(packet) = socket.next().await {
let (packet, _) = packet?;
for message in vmc::parse(packet)? {
match message {
Message::BoneTransform(transform) => {
println!("\tTransform bone: {} (pos {:?}; rot {:?})", transform.bone, transform.position, transform.rotation)
}
_ => {}
}
}
}Ok(())
}
```## License
❤️ This crate is based on [`async-osc`](https://github.com/Frando/async-osc) by Franz Heinzmann. Licensed under MIT License or Apache-2.0.