Skip to content

Instantly share code, notes, and snippets.

@emilianavt
emilianavt / Cluster.md
Last active July 3, 2018 20:16
Uploading an avatar to cluster

Uploading an avatar to cluster

In this guide, I assume you already know the basics of Unity and probably have previously uploaded an avatar to VRChat. If you haven't, you can still try to follow along, but some descriptions might be a bit too brief.


Setup

You need Unity 2018.1.1f1 and the cluster. SDK. In the Player Settings found inside the Build Settings, set the Scripting Runtime Version to .NET 4.x Equivalent before importing the cluster SDK.

Shader "PositionMapper" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_FactorX ("Object width scale factor (X)", Float) = 1.0
_FactorY ("Object height scale factor (Y)", Float) = 1.0
_FactorZ ("Object depth scale factor (Z)", Float) = 1.0
}
SubShader {
ColorMask RGBA
Pass
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TrackerLerp : MonoBehaviour {
public Transform target;
public float targetFPS = 90.0f;
public float influence = 0.985f;
void LateUpdate () {
@emilianavt
emilianavt / VirtualKeyNames.cs
Created June 30, 2020 15:20
A reliable mapping of virtual key codes to human readable names
private Dictionary<int, string> keyNames = new Dictionary<int, string>() {
{0x8, "Backspace"},
{0x9, "Tab"},
{0xd, "Return"},
{0x13, "Pause"},
{0x20, "Space"},
{0x21, "PgUp"},
{0x22, "PgDown"},
{0x23, "End"},
{0x24, "Home"},
using System.IO;
using UnityEngine;
// Attach this to a camera and position it. You can use "Align With View" from the "Game Object" menu to help with this.
// Check the snap box to take a picture. It will log the path to the console.
// It works in Editor mode too, no need to play the scene.
[ExecuteInEditMode]
public class CameraSnap : MonoBehaviour {
public int resolutionX = 2048;
@emilianavt
emilianavt / VRM.md
Last active July 26, 2023 19:05
Converting an avatar to VRM format

Converting an avatar to VRM format

In this guide, I assume you already know the basics of Unity and probably have previously uploaded an avatar to VRChat. If you haven't, you can still try to follow along, but some descriptions might be a bit too brief.

A more in-depth guide with screenshots can be found here.


Setup

For downloads and more information about VSeeFace, please check out the website.

Version 1.13.38c2:

  • Blacklisted 3tene virtual camera to avoid freezing at startup.

Version 1.13.38c:

  • Blacklisted virtual cameras that might cause issues when installed at certain versions from the camera selection menu. This should solve the NVIDIA driver issue in most cases.
  • Applied another fix to the virtual camera driver for better compatibility.
  • Separated out wrist bone reception from arm and shoulder reception for the VMC protocol receiver settings to allow better Mocopi with Leap Motion support.
  • No longer set realtime priority along with GPU background priority.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class ReassignBoneWeigthsToNewMesh : MonoBehaviour {
public Transform newArmature;
public string rootBoneName = "Hips";
public bool resetPose = false;
public bool PressToReassign;
/**
FinalIKを使ったLeapMotion Orion用HandController
(VRIKバージョン)
Author: MiyuMiyu (https://twitter.com/miyumiyuna5)
Source: https://qiita.com/miyumiyu/items/72b965df46a79f3ec523
Modified by: Emiliana (https://twitter.com/Emiliana_vt)
Modifications: Updated for current SDK version, supports hand position reset on tracking loss, hand mirroring and interpolation.
*/
/*
@emilianavt
emilianavt / IKRunner.cs
Last active February 8, 2024 10:42
This component uses the UnityEngine.LowLevel API to run Final IK things before Unity constraints and particle systems are evaluated.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.LowLevel;
using RootMotion.FinalIK;
// Disable IK and TwistRelaxers and set them on this to have them run before constraints and particle systems are evaluated.
// Only one instance of IKRunner is possible, but it should be easy enough to extend.
// Remember to call Start() on the TwistRelaxers once if they are disabled from the beginning. The IK may also need manual initialization.