Skip to content

Instantly share code, notes, and snippets.

@yakumo-proj
Last active March 12, 2022 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yakumo-proj/512f6e58a6e5fe88d80e827a62051410 to your computer and use it in GitHub Desktop.
Save yakumo-proj/512f6e58a6e5fe88d80e827a62051410 to your computer and use it in GitHub Desktop.
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"]
#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