normals.sh 668 B

12345678910111213
  1. #!/bin/bash
  2. function normalMap()
  3. {
  4. gimp -i -b "(define (normalMap-fbx-conversion fileName newFileName nscale) (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE fileName fileName))) (drawable (car (gimp-image-get-active-layer image)))) (plug-in-normalmap RUN-NONINTERACTIVE image drawable 7 0.0 nscale 0 0 0 0 0 0 0 0 0.0 drawable ) (gimp-file-save RUN-NONINTERACTIVE image drawable newFileName newFileName) (gimp-image-delete image))) (normalMap-fbx-conversion \"$1\" \"$2\" $3)" -b '(gimp-quit 0)'
  5. }
  6. # ignore normal files. hacky, but it works
  7. for file in `ls *.png | grep -v _normal`
  8. do
  9. normalMap $file `echo $file | sed 's/.png/_normal.png/'` 8
  10. done