查看: 4392|回复: 2

[原创] SAI材质自动导入程序

  [复制链接]
梦石
0
星屑
65
在线时间
400 小时
注册时间
2005-10-24
回帖
579
发表于 2009-12-9 13:13:59 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 叶子 于 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)

巫女会长

梦石
0
星屑
60
在线时间
1028 小时
注册时间
2009-10-24
回帖
3425

贵宾

发表于 2009-12-9 14:05:36 | 显示全部楼层
叶子前辈开始进军美工了啊...虽然咱不用SAI,还是支持你一下
回复

使用道具 举报

梦石
0
星屑
115
在线时间
0 小时
注册时间
2010-9-10
回帖
1
发表于 2010-9-10 17:39:34 | 显示全部楼层
好东西 正烦怎么写个批处理 来搞这个呢

评分

参与人数 1星屑 -60 收起 理由
小角色 -60 挖坟

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部