diff options
author | Geoffrey Bantle <hairbat@yahoo.com> | 2008-05-24 22:43:02 +0400 |
---|---|---|
committer | Geoffrey Bantle <hairbat@yahoo.com> | 2008-05-24 22:43:02 +0400 |
commit | 7b069b9b6041ca2e5170414a0d4082ba78ca1380 (patch) | |
tree | b8698c6e6e13a67be563d88824d2b082352f583d /release | |
parent | cc6dac8c425bf0914df1cf3422577c28c617fbc4 (diff) |
-> FLT import: Zero area N-gon bug fix
FLT importer would throw errors when importing ngons with
zero area. These faces are now ignored
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/flt_import.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/release/scripts/flt_import.py b/release/scripts/flt_import.py index 74cd4c036a8..f8d31f7bb57 100644 --- a/release/scripts/flt_import.py +++ b/release/scripts/flt_import.py @@ -16,7 +16,7 @@ This script imports OpenFlight files into Blender. OpenFlight is a registered trademark of MultiGen-Paradigm, Inc. Feature overview and more availible at: -http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_flt +http://wiki.blender.org/index.php/Scripts/Manual/Import/openflight_fltss Note: This file is a grab-bag of old and new code. It needs some cleanup still. """ @@ -44,6 +44,7 @@ import BPyMesh import BPyImage import flt_filewalker import flt_properties +import sys reload(flt_properties) from flt_properties import * @@ -1036,8 +1037,9 @@ class InterNode(Node): else: # fgon mesh_face_indicies = [i+vert_index for i in xrange(face_len)] tri_ngons= ngon(self.mesh, mesh_face_indicies) - new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons]) - new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ]) + if len(tri_ngons) != 1: + new_faces.extend([ [mesh_face_indicies[t] for t in tri] for tri in tri_ngons]) + new_faces_props.extend( [ (None, image, (uvs[tri[0]], uvs[tri[1]], uvs[tri[2]]), [flt_face.uverts[tri[0]], flt_face.uverts[tri[1]], flt_face.uverts[tri[2]]], flt_face.uvlayers, flt_face.color_index, flt_face.props,FLT_OrigIndex,1, flt_face.subfacelevel) for tri in tri_ngons ]) vert_index+= face_len FLT_OrigIndex+=1 @@ -2296,7 +2298,6 @@ def fixscale(root,childhash): for v in rmesh.verts: v.co = v.co * smat - def reparent(root,childhash,sce): for child in childhash[root]: reparent(child,childhash,sce) @@ -2452,7 +2453,7 @@ def but_event(evt): select_file(global_prefs['fltfile'], GRR) except: import traceback - FLTWarn = Draw.PupBlock("Export Error", ["See console for output!"]) + FLTWarn = Draw.PupBlock("Ixport Error", ["See console for output!"]) traceback.print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback) #choose base path for export |