Point entity works. Default colours are sensible.
[Procustean.git] / get-g3d.py
blob52d11e80d1eb08353fa95a742edb92a51c85e366
2 # simple script to download and build g3d in-place
4 import sys
5 import os
6 import urllib2
7 import zipfile
8 import popen2
10 print "Connecting to http://downloads.sourceforge.net"
11 response = urllib2.urlopen("http://downloads.sourceforge.net/g3d-cpp/G3D-7.00-src.zip")
12 print "Connected"
13 g3d_src = open("G3D-7.00-src.zip","wb")
14 print "Downloading G3D.."
15 g3d_src.write( response.read() )
16 g3d_src.close()
17 print "Downloaded."
18 response.close()
19 dir = os.getcwd()
20 zipf = open("G3D-7.00-src.zip", "rb")
21 zip = zipfile.ZipFile(zipf)
22 for name in zip.namelist():
23 print "Extracting " + name
24 if name.endswith('/'):
25 os.mkdir(os.path.join(os.getcwd(),name))
26 else:
27 outfile = open(os.path.join(dir, name), "wb")
28 outfile.write(zip.read(name))
29 outfile.close()
30 zipf.close()
32 os.chdir("G3D")
33 (build_out,build_in) = popen2.popen2("./buildg3d lib")
34 for line in build_out:
35 print line
36 os.chdir("..")
38 print "Connecting to http://downloads.sourceforge.net"
39 response = urllib2.urlopen("http://downloads.sourceforge.net/g3d-cpp/G3D-7.00-data.zip")
40 print "Connected"
41 g3d_src = open("G3D-7.00-data.zip","wb")
42 print "Downloading G3D Data pack. Will take awhile.."
43 g3d_src.write( response.read() )
44 g3d_src.close()
45 print "Downloaded."
46 response.close()
47 dir = os.getcwd()
48 zipf = open("G3D-7.00-data.zip", "rb")
49 zip = zipfile.ZipFile(zipf)
50 for name in zip.namelist():
51 print "Extracting " + name
52 if name.endswith('/'):
53 os.mkdir(os.path.join(os.getcwd(),name))
54 else:
55 outfile = open(os.path.join(dir, name), "wb")
56 outfile.write(zip.read(name))
57 outfile.close()
58 zipf.close()
59 # TO DO .. copy dlls to exe dir