Skip to content

Instantly share code, notes, and snippets.

View yakumo-proj's full-sized avatar

Yakumo Sayo yakumo-proj

View GitHub Profile
@yakumo-proj
yakumo-proj / hair_merge.rb
Last active March 12, 2022 03:38
VRoid Studio Hair-Preset Merge Tool (old ver.)
#!/usr/bin/ruby
require 'JSON'
require 'fileutils'
#merge JSON
x, y = ARGV[0..1].map {|path| JSON.parse( open(path + '/preset.json').readlines.join) }
x["Hairishes"] += y["Hairishes"][1..-1]
x["_MaterialSet"]["_Materials"] += y["_MaterialSet"]["_Materials"]
x["_HairBoneStore"]["Groups"] += y["_HairBoneStore"]["Groups"]
@yakumo-proj
yakumo-proj / VRoidCustomItemThumbnailer.cs
Last active January 10, 2022 03:12
vroidcustomitemをサムネイル表示 for .NET(SharpShell)
using System;
using System.Drawing;
using SharpShell.SharpThumbnailHandler;
using System.IO.Compression;
using SharpShell.Attributes;
using System.Runtime.InteropServices;
using System.Linq;
using System.IO;
namespace AlterCoord
@yakumo-proj
yakumo-proj / Transferable.proto
Created January 9, 2022 04:35
vroidcustomitem
syntax = "proto3";
import "google/protobuf/wrappers.proto";
//import "google/protobuf/any.proto";
package com.AlterCoord;
option csharp_namespace = "com.AlterCoord";
// Common  
@yakumo-proj
yakumo-proj / VRoidLegacyFaceShapeKeyReplacer.cs
Last active December 18, 2021 03:33
VRoid正式版の表情ブレンドシェイプをVRoidモバイル用に置換するコード in C#
using System;
using System.Collections.Generic;
using System.Json;
using System.Linq;
namespace VRMTextureUtil
{
public class VRoidLegacyFaceShapeKeyReplacer
{
static Dictionary<string, string> tables = new Dictionary<string, string>() {
@yakumo-proj
yakumo-proj / VRoidCustomItemInstalllerMac.rb
Created November 16, 2021 12:21
VRoidカスタムアイテムインストーラ
require 'json'
require 'fileutils'
base_dir = Dir.home + '/Library/Containers/net.pixiv.vroid.macosx/Data' +
'/Library/Application Support/net.pixiv.vroid.macosx/custom_items/'
folders = readlines.map(&:chomp).map {|filename|
j = `unzip -p #{filename} v1customitem/meta.json`
objs = JSON.parse(j)
dest_path = base_dir + 'N00-' + objs['rootTransferableGroupTypeId'].split('.').last
@yakumo-proj
yakumo-proj / cluster_vs_neoket.md
Last active January 25, 2021 04:14
clusterとNEOKETのアバター制限比較

clusterとNEOKETのアバター制限比較

制限 cluster NEOKET
モデル GameObjectの数(maxNodeCount) 256
ポリゴンの数(maxPolygonCount) 32,000 48,000
メッシュの数(maxMeshCount) 16 16
サブメッシュの数(maxPrimitiveCount) 32 32
ブレンドシェイプの数(maxMorphTargetCount) 64 128
ボーン ボーンの数(maxJointCount) 128 150
@yakumo-proj
yakumo-proj / TinyVRMFileUtil.cs
Created December 14, 2020 11:05
UniVRMを使わずにC#でVRMの画像リサイズを実装してみたやつ
using System;
using System.Json;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
@yakumo-proj
yakumo-proj / vrm-extract.rb
Created December 13, 2020 20:16
VRM image file extract tools (Ruby)
#!/usr/bin/ruby -Ks
# Copyright (C) 2020 Yakumo Sayo. All rights reserved.
# Dual Licence (BSD 2-Crause or GPLv3)
require 'pathname'
require 'JSON'
buf = File.open(ARGV[0], "rb")
def read_uint32(buffer)
buffer.read(4).bytes.reverse.inject(0){|s,i| s*256 + i}
@yakumo-proj
yakumo-proj / ClothingDefs.proto
Last active June 13, 2022 12:49
protocol buffer definition(analyzed) for .vroid(clothing_editor/clothing_defs.bin).
syntax = "proto3";
import "google/protobuf/wrappers.proto";
//import "google/protobuf/any.proto";
package Sayo.VRoid;
option csharp_namespace = "Sayo.VRoid";
// clothing_defs.bin file format
message ClothingDefs {
@yakumo-proj
yakumo-proj / DotVRoidToHairPreset.rb
Created August 15, 2020 08:57
.vroidファイルからへアプリセットを生成するRubyスクリプト
#!/usr/bin/ruby
# Copyright (C) 2020 Yakumo Sayo, Susanoo Lab. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but