Project1

标题: SAI材质自动导入程序 [打印本页]

作者: 叶子    时间: 2009-12-9 13:13
标题: SAI材质自动导入程序
本帖最后由 叶子 于 2009-12-9 13:19 编辑

研究SAI材质的副产品,用途不大,就是在导入材质的时候省了一点麻烦

用途:
自动将SAI程序文件夹下blotmap, brushtex, elemap, papertex四个文件夹内的bmp文件信息加入到相应的.conf文件中,不再需要手动设置conf

使用方法:
在SAI程序文件夹下运行即可。如果你有装ruby,可以直接运行下面的ruby脚本;否则可以使用我上传的压好的exe。(其实贴到RM的脚本编辑器中运行也行囧)
在Windows Vista下测试通过,虽然文件名中数字的排列有点诡异,不过那是小问题,小问题哈哈..
  1. =begin

  2. AutoConfig for SAI

  3. Usage:
  4. Must have ruby installed or obtain the compiled exe version.
  5. Place this script into the SAI program folder and run it.
  6. It will populate the SAI .conf files with the textures in
  7. blotmap, brushtex, elemap and papertex.

  8. Disclaimer:
  9. Save your original .conf files before you use the script.
  10. Don't blame me for destroying ur precious SAI lol.

  11. =end

  12. # hash map to store info about how to populate the .conf files
  13. # key = folder name, value = [config file name, id]
  14. folders = {}
  15. folders['blotmap'] = ['brushform.conf', 1]
  16. folders['elemap'] = ['brushform.conf', 2]
  17. folders['brushtex'] = ['brushtex.conf', 1]
  18. folders['papertex'] = ['papertex.conf', 1]

  19. # clear the files
  20. for config_pair in folders.values
  21.   File.open(config_pair[0], 'w'){}
  22. end

  23. # do the job
  24. for folder in folders.keys
  25.   config_file = File.open(folders[folder][0], 'a')
  26.   Dir.chdir(folder)
  27.   begin
  28.     for texture in Dir.glob("*.bmp").sort
  29.       config_file.write("#{folders[folder][1]},#{folder}\\#{texture}\n")  
  30.     end
  31.   ensure
  32.     Dir.chdir('..')
  33.     config_file.close
  34.   end
  35. end
复制代码
exe压缩包下载:
autoconfig.rar (1.41 MB, 下载次数: 127)
作者: dukesward    时间: 2009-12-9 14:05
叶子前辈开始进军美工了啊...虽然咱不用SAI,还是支持你一下
作者: y2443    时间: 2010-9-10 17:39
好东西 正烦怎么写个批处理 来搞这个呢




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1