Skip to content
Snippets Groups Projects
Commit 70eada0e authored by Aurel W's avatar Aurel W
Browse files

io_raw_mesh: fixes,.. already were done but gone 'lost' (no svn history,...

io_raw_mesh: fixes,.. already were done but gone 'lost' (no svn history, nothing in patch tracker,...). wtf?!?
parent 67ea44b8
No related branches found
No related tags found
No related merge requests found
......@@ -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": "",
......
......@@ -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
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment