fix_lightmap script
authorJohn Tsiombikas <nuclear@mutantstargoat.com>
Thu, 5 Jan 2017 19:41:11 +0000 (21:41 +0200)
committerJohn Tsiombikas <nuclear@mutantstargoat.com>
Thu, 5 Jan 2017 19:41:11 +0000 (21:41 +0200)
tools/fix_lightmap [new file with mode: 0755]

diff --git a/tools/fix_lightmap b/tools/fix_lightmap
new file mode 100755 (executable)
index 0000000..383617e
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+       echo "usage: $0 <lightmap> [<mesh file>]" >2
+       exit 1
+fi
+
+lmap=$1
+
+if [ -z "$2" ]; then
+       mesh=`echo $lmap | sed 's/_lightmap\..*/.fbx/'`
+else
+       mesh=$2
+fi
+
+res=exp-$lmap
+
+cmd="texpand -o $res -uvset 1 -f -mesh $mesh $lmap"
+echo "cmd: $cmd"
+$cmd
+# && feh exp-$lmap