Skip to content

Instantly share code, notes, and snippets.

View anatawa12's full-sized avatar

anatawa12 anatawa12

View GitHub Profile
@anatawa12
anatawa12 / RemoveUnusedAnimatorParameters.cs
Last active September 22, 2024 08:50
Simple tool to remove unused animator parameter from animator controller
/*
* RemoveUnusedAnimatorParameters
* Simple tool to remove unused animator parameter from animator controller
* https://gist.github.com/anatawa12/9d6d69fdb042d636cc640f85ce0c5fae
*
* Click `Tools/anatawa12 gists/RemoveUnusedAnimatorParameters` to open this window.
*
* MIT License
*
* Copyright (c) 2023 anatawa12
@anatawa12
anatawa12 / shuffle-guid-in-folder.ts
Created August 26, 2024 08:47
simple tool to shuffle guid of unity asset file in folder
#!/bin/sh
":" /*
exec deno run --allow-read --allow-write "$0" "$@"
exit $?
":" */
const folder = Deno.args[0];
if (!folder) {
console.error("Usage: shuffle-guid-in-folder.ts <folder>");
@anatawa12
anatawa12 / gc-entries-in-asset,ts
Created August 25, 2024 15:32
This script removes all entries in the unity asset file that are not needed internally
#!/usr/bin/env node
/*
* This script removes all entries in the asset file that are not needed.
* Please note that this doesn't consider external references.
*/
const fs = require('fs');
const path = process.argv[2];
@anatawa12
anatawa12 / CreateEmptyVRChatAvatar.cs
Last active August 21, 2024 08:36
CreateEmptyVRChatAvatar: Fast way to create a new empty VRChat avatar.
/*
* CreateEmptyVRChatAvatar
* Fast way to create a new empty VRChat avatar.
* https://gist.github.com/anatawa12/2acd16939ef597895d8298ae97ba4122
*
* Left Click hierarchy and select `Create Empty VRChat Avatar` to create a new empty VRChat avatar.
*
* Empty VRChat Avatr will have:
* - VRC Avatar Descriptor
* - Pipeline Manager
@anatawa12
anatawa12 / main.cpp
Created July 10, 2024 04:45
Winget-cli version comparator and MPS Versions on winget-pkgs test
#include <iostream>
using namespace std::string_view_literals;
#define THROW_HR_IF(error, condition) if (condition) throw std::runtime_error(#error);
// region Utility shim
namespace Utility {
constexpr std::string_view s_SpaceChars = " \f\n\r\t\v"sv;
@anatawa12
anatawa12 / CombineAssetsToSingleFile.cs
Last active June 2, 2024 14:20
Combines multiple assets into a single file.
/*
* Combine Assets To Single File
* https://gist.github.com/anatawa12/1b304b398945ec547912239328708b6b
*
* Combines multiple assets into a single file.
* Select Multiple Files and Right Click -> Assets -> Combine Assets To Single File
*
* MIT License
*
* Copyright (c) 2023 anatawa12
@anatawa12
anatawa12 / ManualBakePreprocessAvatarCallbacks.cs
Created June 2, 2024 12:32
Manual Bake Preprocess Avatar Callbacks
/*
* Manual Bake Preprocess Avatar Callbacks
* Calls IVRCSDKPreprocessAvatarCallback.OnPreprocessAvatar on selected Avatar
* https://gist.github.com/anatawa12/9e2bf687b1dbc23c78d513bfa96f07d8
*
* Left-click on an Avatar in the Hierarchy and select "Manual Bake Preprocess Avatar Callbacks" from the context menu.
*
* MIT License
*
* Copyright (c) 2023 anatawa12
@anatawa12
anatawa12 / ExportTextureAsPNG.cs
Last active June 1, 2024 08:50
Save existing texture asset as PNG
/*
* Export Texture as PNG
* Save existing texture asset as PNG
* https://gist.github.com/anatawa12/TODO
*
* Open `Tools/anatawa12 gists/MultiGizmo` and select objects to show gizmo
*
* MIT License
*
* Copyright (c) 2023 anatawa12
#if UNITY_EDITOR && (!ANATAWA12_GISTS_VPM_PACKAGE || GIST_a4bb4e2e5d75b4fa5ba42e236aae564d)
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using HarmonyLib;
using JetBrains.Annotations;
using UnityEditor;
using UnityEditorInternal;
@anatawa12
anatawa12 / ShowAssetsInPackagesByDefaultInSelector.cs
Created January 5, 2024 13:33
Show Assets in Packages by Default in Selector Window
/*
* Show Assets in Packages by Default in Selector Window
* https://gist.github.com/anatawa12/b128ca8fc819b9684f3ed15be1f76e8c
*
* Copy this cs file to anywhere in your asset folder is the only step to install this tool.
*
* In Unity, the selector window will not show assets in packages by default.
* This tool will change the default behavior to show assets in packages by default.
*
* MIT License