Skip to content

Instantly share code, notes, and snippets.

@Ooseykins
Ooseykins / NormalizeBones.py
Created October 7, 2024 23:49
Point all bones up (z-axis) to "Normalize" them. This will mean when imported into Unity their rotations should all be euler (0, 0, 0). This is for apps like Warudo or VMC so you can preserve your workflow without having to use an in-Unity script.
bl_info = {
"name": "Normalize bones",
"blender": (3, 4, 1),
"category": "Object",
}
import bpy
import mathutils
class NormalizeBonesOperator(bpy.types.Operator):
using System;
using System.Collections.Generic;
using System.Linq;
using Cysharp.Threading.Tasks;
using Klak.Spout;
using Unity.Collections;
using Warudo.Core.Attributes;
using Warudo.Core.Graphs;
using UnityEngine;
using UnityEngine.Rendering;
@Ooseykins
Ooseykins / CultOfTheLambHatCopyBlendshapes.json
Created August 14, 2024 05:43
Warudo blueprint to copy ARKit blendshapes from a character to a prop
{"id":"7da1be07-c59d-42c2-9020-c5dc3396445f","enabled":true,"name":"Cult of the Lamb copy face blendshapes","order":0,"group":null,"panningX":2269.62256,"panningY":1709.69165,"scaling":0.394318044,"nodes":{"325cefef-f9f5-4fa8-81d0-56e9e582661d":{"id":"325cefef-f9f5-4fa8-81d0-56e9e582661d","dataInputs":{"Prop":{"type":"Warudo.Plugins.Core.Assets.Prop.PropAsset","value":"{\"id\":\"c3084f7e-c1ef-4abc-aa85-8a07a1283a2d\",\"name\":\"Cult of the Lamb Hat\"}"},"TargetSkinnedMesh":{"type":"string","value":"\"Prop(Clone)\""},"BlendShape":{"type":"string","value":"\"eyeLookOutRight\""},"Value":{"type":"float","value":"0.0249997433"},"TransitionTime":{"type":"float","value":"0.0"},"TransitionEasing":{"type":"DG.Tweening.Ease","value":"{\"label\":\"OutCubic\",\"value\":9,\"description\":null,\"icon\":null}"}},"typeId":"607f4b4d-5017-4255-a0dd-65d8a926038b","name":"SET_PROP_BLENDSHAPE","x":-725.2151,"y":-183.253784},"bf588367-7ebf-426b-906e-934d404ac08b":{"id":"bf588367-7ebf-426b-906e-934d404ac08b","dataInputs":{"Characte
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using BepInEx;
using UniVRM10;
using GameNetcodeStuff;
using UniGLTF;
using UnityEngine;
using UnityEngine.Rendering;
@Ooseykins
Ooseykins / IFacialMocapReciever.cs
Created August 15, 2022 02:57
Simpler Unity receiver for IFacialMocap. Statically access IFacialMocapReciever.currentFrame to get the most recent weights and transforms.
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
public class IFacialMocapReciever : MonoBehaviour
{
@Ooseykins
Ooseykins / TransformSlider.cs
Created August 15, 2022 02:52
Script for sliding bracelets up and down a character's arm, or other simple incline-plane-like simulations. SliderTransform origins will be placed along the topmost edge of the rendered gizmo.
using UnityEngine;
public class TransformSlider : MonoBehaviour {
[Min(0.01f)]
public float length = 0.1f;
float totalOffset;
public float scale = 0.05f;
public AnimationCurve scaleCurve = AnimationCurve.Linear(0f,1f,1f,0.5f);
public Vector3 gravity;
[System.Serializable]
@Ooseykins
Ooseykins / ScriptableObjectWithColorEditor.cs
Last active August 3, 2022 04:41
Override of RenderStaticPreview for tinting an asset preview icon to a scriptable object's color
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(ScriptableObjectWithColor))]
public class ScriptableObjectWithColorEditor : Editor
{
public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
{
ScriptableObjectWithColor targetObj = (ScriptableObjectWithColor)target;
if (targetObj == null)
@Ooseykins
Ooseykins / VRMSwapBoneNames.py
Last active April 15, 2025 11:51
Imported vrm/vroid models have bone names that aren't compatible with Blender's mirrored bone editing. This will toggle the vertex group names and bone names between the two versions. This script adds a menu option for object mode "VRM Swap Bone Names".
bl_info = {
"name": "VRM Swap Bone Names",
"blender": (3, 4, 1),
"category": "Object",
}
import bpy
class VRMSwapBoneNamesOperator(bpy.types.Operator):
@Ooseykins
Ooseykins / DesktopCapture.cs
Last active September 10, 2021 10:32
Unity component to read uDesktopDuplication (or other) texture as single colour
using UnityEngine;
using System;
public class DesktopCapture : MonoBehaviour
{
[SerializeField]
uDesktopDuplication.Texture uddTexture;
public Light spotLight;
[Tooltip("Power of 2 to use for the texture size")]