Last active
March 12, 2022 03:38
-
-
Save yakumo-proj/512f6e58a6e5fe88d80e827a62051410 to your computer and use it in GitHub Desktop.
VRoid Studio Hair-Preset Merge Tool (old ver.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"] | |
#write JSON | |
File.open(ARGV[0] + '/preset.json', mode = 'w') {|f| f.write(JSON.generate(x)) } | |
#copy textures | |
textures = "/materials/rendered_textures/" | |
FileUtils.cp_r( Dir.glob(ARGV[1] + textures + "*"), ARGV[0] + textures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment