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 / png_decode.rb
Created April 9, 2020 15:57
前にPNGファイルのチャンク構造調べるために作った突貫スクリプト
#!/usr/bin/ruby -Ks
buf = File.open(ARGV[0], "rb")
header = buf.read(8)
p header
return 1 if header.bytes != "\x89PNG\r\n\x1A\n".bytes
chunk_reader = ->(buffer) {
length = buffer.read(4).bytes.inject(0){|s,i| s*256 + i}
tags = buffet.read(4)
@yakumo-proj
yakumo-proj / clothing_info.rb
Created August 8, 2020 09:36
*.vroidの中身の衣装プリセットの一覧を作成するツール
#!/usr/bin/ruby -Ku
=begin
-----------------------------------------------------------------------
BSD-2-Clause
Copyright (c)2020, Yakumo Sayo, Susanoo Lab. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@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
@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 / 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 / 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 / DotVRoidMaterialReducer.rb
Last active March 13, 2021 21:59
.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
@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 / 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 / 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