diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-01-27 07:58:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-01-27 07:58:09 +0300 |
commit | 8f075f9518c8173523e3726b436fa02de6fea994 (patch) | |
tree | a32c7b56c76132e2ecc4a84bac8913bd8d1ef4e0 /release/scripts/slp_import.py | |
parent | 853785782e5fea7805b05ce834a661271fd24358 (diff) |
minor tweaks from testing scripts. correction in my last commit.
Diffstat (limited to 'release/scripts/slp_import.py')
-rw-r--r-- | release/scripts/slp_import.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/release/scripts/slp_import.py b/release/scripts/slp_import.py index 4944c34045d..9c2458b2ba5 100644 --- a/release/scripts/slp_import.py +++ b/release/scripts/slp_import.py @@ -68,14 +68,14 @@ def read(filename): file = open(filename, "rb") raw = [] - for line in file.readlines(): + for line in file.xreadlines(): data = line.split() if data[0] == "vertex": vert = map(float, data[1:]) raw.append(vert) - + tri = [] - for i in range(0, len(raw), 3): + for i in xrange(0, len(raw), 3): tri.append(raw[i] + raw[i+1] + raw[i+2]) #$import pprint; pprint.pprint(tri) @@ -90,8 +90,8 @@ def read(filename): verts = [] coords = {} index = 0 - for i in range(len(faces)): - for j in range(len(faces[i])): + for i in xrange(len(faces)): + for j in xrange(len(faces[i])): vertex = faces[i][j] if not coords.has_key(vertex): coords[vertex] = index @@ -112,4 +112,5 @@ def read(filename): def fs_callback(filename): read(filename) -Blender.Window.FileSelector(fs_callback, "Import SLP") +if __name__ == '__main__': + Blender.Window.FileSelector(fs_callback, "Import SLP", "*.slp") |