#osc #protocols #vrm #time #virtual-motion-capture #performer

vmc

Implementation of Virtual Motion Capture protocol for virtual avatar tracking

6 releases (breaking)

new 0.5.1 Apr 14, 2025
0.5.0 Apr 14, 2025
0.4.0 Oct 28, 2024
0.3.0 Aug 17, 2023
0.1.0 Aug 11, 2023

#639 in Network programming

Download history 13/week @ 2024-12-22 5/week @ 2024-12-29 5/week @ 2025-01-05 1/week @ 2025-01-12 7/week @ 2025-02-09 3/week @ 2025-02-16 3/week @ 2025-02-23 1/week @ 2025-03-02 10/week @ 2025-03-23 44/week @ 2025-03-30 7/week @ 2025-04-06

61 downloads per month

MIT/Apache

59KB
1.5K SLoC

vmc

An asynchronous implementation of the Virtual Motion Capture Protocol in Rust.

Examples

See examples/ for more detailed examples.

Performer

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

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 by Franz Heinzmann. Licensed under MIT License or Apache-2.0.

Dependencies

~5–12MB
~130K SLoC