diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2007-01-30 23:12:30 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2007-01-30 23:12:30 +0300 |
commit | 2d14f8c224719fde43c3c5edf01a9364b8a7dd33 (patch) | |
tree | af9b0006bd58c9556439e7987faf6e64753dfeff /release/scripts/ac3d_import.py | |
parent | f0e18a8b940d5e1e3ee362a8c5c1c0cea9da25b1 (diff) |
Scripts:
- Fixing another bug in the ac3d import script, thanks again Melchior Franz for testing and reporting.
Diffstat (limited to 'release/scripts/ac3d_import.py')
-rw-r--r-- | release/scripts/ac3d_import.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/release/scripts/ac3d_import.py b/release/scripts/ac3d_import.py index ecb647a8728..9ba664f9c5d 100644 --- a/release/scripts/ac3d_import.py +++ b/release/scripts/ac3d_import.py @@ -339,10 +339,14 @@ class AC3DImport: NUMSURF = numsurf while numsurf: - flags = lines[i].split() - flaglow = 0 - if len(flags[1]) > 3: flaglow = int(flags[1][3]) - flaghigh = int(flags[1][2]) + flags = lines[i].split()[1][2:] + if len(flags) > 1: + flaghigh = int(flags[0]) + flaglow = int(flags[1]) + else: + flaghigh = 0 + flaglow = int(flags[0]) + is_smooth = flaghigh & 1 twoside = flaghigh & 2 mat = lines[i+1].split() @@ -366,14 +370,14 @@ class AC3DImport: fuv.append(Vector(uv)) rfs -= 1 i += 1 - + if flaglow: # it's a line or closed line, not a polygon while len(face) >= 2: cut = face[:2] edges.append(cut) face = face[1:] - if flaglow == 1 and edges: + if flaglow == 1 and edges: # closed line face = [edges[-1][-1], edges[0][0]] edges.append(face) @@ -568,10 +572,14 @@ class AC3DImport: if obj.flist_v: mesh.faces.extend(obj.flist_v) - mesh.faceUV = True facesnum = len(mesh.faces) + if facesnum == 0: # shouldn't happen, of course + continue + + mesh.faceUV = True + # checking if the .ac file had duplicate faces (Blender ignores them): if facesnum != len(obj.flist_v): # it has, ugh. Let's clean the uv list: |