Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-04-11 04:00:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-04-11 04:00:07 +0400
commit32e516695e7883f949eab4204667cf9709cd6ee0 (patch)
tree7135f96dc5b1788c9b44f8fa87df43bcf80b1f84
parentaab49dff0e7bce08762874a51df0ee86541bb85f (diff)
Some Maya dev thaught it would be a fun joke to format floats with a comma instead of a full stop.
Obj importer now supports 4,845 as well as the more useual 4.845 floating point value.
-rw-r--r--release/scripts/obj_import.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/release/scripts/obj_import.py b/release/scripts/obj_import.py
index 1e5e53426f3..ab9055d3c57 100644
--- a/release/scripts/obj_import.py
+++ b/release/scripts/obj_import.py
@@ -294,8 +294,18 @@ def load_obj(file, IMPORT_MTL=1, IMPORT_EDGES=1, IMPORT_SMOOTH_ALL=0, IMPORT_FGO
# Ignore normals and comments.
fileLines= [lsplit for l in fileLines if not l.startswith('vn') if not l.startswith('#') for lsplit in (l.split(),) if lsplit]
Vert= NMesh.Vert
- vertList= [Vert(float(l[1]), float(l[2]), float(l[3]) ) for l in fileLines if l[0] == 'v']
- uvMapList= [(float(l[1]), float(l[2])) for l in fileLines if l[0] == 'vt']
+ try:
+ vertList= [Vert(float(l[1]), float(l[2]), float(l[3]) ) for l in fileLines if l[0] == 'v']
+ except ValueError:
+ # What??? Maya 7 uses "6,45" instead of "6.45"
+ vertList= [Vert(float(l[1].replace(',', '.')), float(l[2].replace(',', '.')), float(l[3].replace(',', '.')) ) for l in fileLines if l[0] == 'v']
+
+ try:
+ uvMapList= [(float(l[1]), float(l[2])) for l in fileLines if l[0] == 'vt']
+ except ValueError:
+ # Same amazement as above. call that a float?
+ uvMapList= [(float(l[1].replace(',', '.')), float(l[2].replace(',', '.'))) for l in fileLines if l[0] == 'vt']
+
if IMPORT_SMOOTH_GROUPS:
smoothingGroups= dict([('_'.join(l[1:]), None) for l in fileLines if l[0] == 's' ])
else: