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:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-11-30 05:27:46 +0300
committerWillian Padovani Germano <wpgermano@gmail.com>2004-11-30 05:27:46 +0300
commit6d9c02be4cfd61b985af789e167f7fa78dbc0868 (patch)
tree1bb8758f454cb90e0659e6122f11ec13b02a7b3f /release/scripts/off_import.py
parente4562134d28af07b6115436fdfaa4523020ea733 (diff)
Scripts:
- Fixes by Jean-Michel Soler: mod_ai2obj.py, mod_svg2obj.py; - Fixes by Campbell Barton: obj_import.py; - Small fix to mod_meshtools.py (fixes bug #1605: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1605&group_id=9); - Updates by Jean-Baptiste (Jiba) to his blender2cal3d.py; - Updates to all his import / export scripts (added doc data) by Anthony D'Agostino; - Update to off_import: support for uv data, by Arne Schmitz. BPython: - Removed Object.get and .getSelected (deprecated long ago, we use .Get and .GetSelected) -- fixes #1861: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1861&group_id=9 - Applied patch by Michael Reimpell: quat.c - fix for wrong initialization with newQuaternionObject; Mathutils documentation improvements. - Stani reported a wrong return msg in IpoCurve.Get (that is unimplemented). Thanks to all coders mentioned above!
Diffstat (limited to 'release/scripts/off_import.py')
-rw-r--r--release/scripts/off_import.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/release/scripts/off_import.py b/release/scripts/off_import.py
index b70a935b4a9..94b6423149a 100644
--- a/release/scripts/off_import.py
+++ b/release/scripts/off_import.py
@@ -1,10 +1,10 @@
#!BPY
"""
-Name: 'Object File Format (.off)...'
+Name: 'DEC Object File Format (.off)...'
Blender: 232
Group: 'Import'
-Tooltip: 'Import Object File Format (*.off)'
+Tooltip: 'Import DEC Object File Format (*.off)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
@@ -13,12 +13,20 @@ __url__ = ("blender", "elysiun",
__version__ = "Part of IOSuite 0.5"
__bpydoc__ = """\
-This script imports Object File Format files to Blender.
+This script imports DEC Object File Format files to Blender.
-Usage:
+The DEC (Digital Equipment Corporation) OFF format is very old and
+almost identical to Wavefront's OBJ. I wrote this so I could get my huge
+meshes into Moonlight Atelier. (DXF can also be used but the file size
+is five times larger than OFF!) Blender/Moonlight users might find this
+script to be very useful.
-Execute this script from the "File->Import" menu and choose an OFF file to
+Usage:<br>
+ Execute this script from the "File->Import" menu and choose an OFF file to
open.
+
+Notes:<br>
+ UV Coordinate support has been added.
"""
@@ -45,19 +53,27 @@ def read(filename):
verts = []
faces = []
+ uv = []
# === OFF Header ===
offheader = file.readline()
numverts, numfaces, null = file.readline().split()
numverts = int(numverts)
numfaces = int(numfaces)
+ if offheader.find('ST') >= 0:
+ has_uv = True
+ else:
+ has_uv = False
# === Vertex List ===
for i in range(numverts):
if not i%100 and mod_meshtools.show_progress:
Blender.Window.DrawProgressBar(float(i)/numverts, "Reading Verts")
- x, y, z = file.readline().split()
- x, y, z = float(x), float(y), float(z)
+ if has_uv:
+ x, y, z, u, v = map(float, file.readline().split())
+ uv.append((u, v))
+ else:
+ x, y, z = map(float, file.readline().split())
verts.append((x, y, z))
# === Face List ===
@@ -75,7 +91,7 @@ def read(filename):
objname = Blender.sys.splitext(Blender.sys.basename(filename))[0]
- mod_meshtools.create_mesh(verts, faces, objname)
+ mod_meshtools.create_mesh(verts, faces, objname, faces, uv)
Blender.Window.DrawProgressBar(1.0, '') # clear progressbar
file.close()
#end = time.clock()