设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3972|回复: 2
打印 上一主题 下一主题

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

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
65
在线时间
400 小时
注册时间
2005-10-24
帖子
634
跳转到指定楼层
1
发表于 2009-12-9 13:13:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

Lv1.梦旅人

巫女会长

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

贵宾

2
发表于 2009-12-9 14:05:36 | 只看该作者
叶子前辈开始进军美工了啊...虽然咱不用SAI,还是支持你一下
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
115
在线时间
0 小时
注册时间
2010-9-10
帖子
1
3
发表于 2010-9-10 17:39:34 | 只看该作者
好东西 正烦怎么写个批处理 来搞这个呢

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-22 09:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表