Skip to content

Instantly share code, notes, and snippets.

@lyuma
lyuma / calibrated_tracker.gd
Last active July 7, 2024 08:58
Godot calibration system from raw XRNode3D to calibrated bone offset / IK target. (MIT License)
# Copyright 2024 V-Sekai contributors
# SPDX-License-Identifier: MIT
@tool
extends Node3D
#@export_node_path("Node3D") var raw_tracker: NodePath:
#set(value):
#raw_tracker = value
#raw_tracker_node = get_node_or_null(raw_tracker)
@export var raw_tracker_node: Node3D
@lyuma
lyuma / compact_godot_editor_theme.tres
Created October 15, 2023 21:27
Editor theme for Godot 4 which makes the inspector and tree view compact, removing unnecessary spaces between items.
[gd_resource type="Theme" load_steps=32 format=3]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fnqu7"]
content_margin_left = 4.0
content_margin_top = 1.0
content_margin_right = 4.0
content_margin_bottom = 1.0
bg_color = Color(0.1, 0.1, 0.1, 0.3)
corner_radius_top_left = 3
corner_radius_top_right = 3
@lyuma
lyuma / resource_parser.gd
Created August 21, 2023 15:48
Validates a given Godot 4 resource file for embedded Resource types or references to external file paths.
# resource_parser.gd for Godot 4.0
# Copyright (c) 2023 Lyuma <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
// WIP Godot port. Lighting function not yet implemented. Clouds need #define and are not transparent.
/*
MIT License
Godot Port Copyright (c) 2022 Lyuma
Copyright (c) 2022 SCRN-VRC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
/*************************************************************************/
/* default_godot_light_function.gdshader */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
@lyuma
lyuma / SimpleOSC.gd
Created February 24, 2022 05:55
Simple single-file OSC library for GDScript 4.0a with all base and extended types defined in OSC 1.1, bundle support and an integrated UDP sender and receiver.
# SimpleOSC for Godot 4.0 alpha3 , version 0.1
# Copyright (c) 2022 Lyuma <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@lyuma
lyuma / SimpleOSC.cs
Created February 24, 2022 05:45
Simple single-file OSC library with all base and extended types defined in OSC 1.1, bundle support and an integrated UDP sender and receiver.
/* SimpleOSC for C#, version 0.1
Copyright (c) 2022 Lyuma <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@lyuma
lyuma / endif_colors.py
Created January 29, 2022 22:06
Indents and colorizes lines based on the number of levels of preprocessor if statements
# Copyright 2021 Lyuma
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
@lyuma
lyuma / SimpleParallax.shader
Created April 19, 2021 15:13
Simple parallax Unity surface shader using tangent space constructed in the vertex shader.
Shader "Custom/SimpleParallax"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
_ParallaxMap ("Height Map", 2D) = "black" {}
@lyuma
lyuma / VRMChecker.cs
Created March 3, 2021 12:58
Prints out pre- and post- quaternion values from Unity's Humanoid Avatar
// MIT License
// Copyright (c) 2021 Lyuma <[email protected]> and lox9973
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: