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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurel W <aurel.w@gmail.com>2011-02-22 01:57:53 +0300
committerAurel W <aurel.w@gmail.com>2011-02-22 01:57:53 +0300
commit70eada0ece98454bf9a0913973c68428ecbc127d (patch)
tree8a192a5efc95a2421e827a0923f720dacc458e3d /io_mesh_raw
parent67ea44b8eacf262f061b894302c475b69748b348 (diff)
io_raw_mesh: fixes,.. already were done but gone 'lost' (no svn history, nothing in patch tracker,...). wtf?!?
Diffstat (limited to 'io_mesh_raw')
-rw-r--r--io_mesh_raw/__init__.py4
-rw-r--r--io_mesh_raw/export_raw.py4
-rw-r--r--io_mesh_raw/import_raw.py13
3 files changed, 11 insertions, 10 deletions
diff --git a/io_mesh_raw/__init__.py b/io_mesh_raw/__init__.py
index d5a0bd86..0b5023cf 100644
--- a/io_mesh_raw/__init__.py
+++ b/io_mesh_raw/__init__.py
@@ -20,8 +20,8 @@ bl_info = {
"name": "Raw mesh",
"author": "Anthony D,Agostino (Scorpius), Aurel Wildfellner",
"version": (0, 2),
- "blender": (2, 5, 3),
- "api": 31667,
+ "blender": (2, 5, 6),
+ "api": 35040,
"location": "File > Import-Export > Raw faces ",
"description": "Import Raw Faces (.raw format)",
"warning": "",
diff --git a/io_mesh_raw/export_raw.py b/io_mesh_raw/export_raw.py
index d683d670..67b6a892 100644
--- a/io_mesh_raw/export_raw.py
+++ b/io_mesh_raw/export_raw.py
@@ -49,8 +49,8 @@ def faceToTriangles(face):
def faceValues(face, mesh, matrix):
fv = []
- for verti in face.vertices_raw:
- fv.append(matrix * mesh.vertices[verti].co)
+ for verti in face.vertices:
+ fv.append(mesh.vertices[verti].co * matrix)
return fv
diff --git a/io_mesh_raw/import_raw.py b/io_mesh_raw/import_raw.py
index 4b5b7304..eb772585 100644
--- a/io_mesh_raw/import_raw.py
+++ b/io_mesh_raw/import_raw.py
@@ -79,8 +79,10 @@ def readMesh(filename, objName):
verts = []
coords = {}
index_tot = 0
+ faces_indices = []
for f in faces:
+ fi = []
for i, v in enumerate(f):
index = coords.get(v)
@@ -89,13 +91,12 @@ def readMesh(filename, objName):
index_tot += 1
verts.append(v)
- fi[i] = index
+ fi.append(index)
+
+ faces_indices.append(fi)
mesh = bpy.data.meshes.new(objName)
- mesh.vertices.add(len(verts))
- mesh.faces.add(len(faces))
- mesh.vertices.foreach_set("co", unpack_list(verts))
- mesh.faces.foreach_set("vertices_raw", unpack_face_list(faces))
+ mesh.from_pydata(verts, [], faces_indices)
return mesh
@@ -129,7 +130,7 @@ class RawImporter(bpy.types.Operator):
def execute(self, context):
#convert the filename to an object name
- objName = bpy.path.display_name(self.filename.split("\\")[-1].split("/")[-1])
+ objName = bpy.path.display_name(self.filepath.split("\\")[-1].split("/")[-1])
mesh = readMesh(self.filepath, objName)
addMeshObj(mesh, objName)