Quellcode durchsuchen

Messing with the blender exporters

Panagiotis Christopoulos Charitos vor 15 Jahren
Ursprung
Commit
2880b304e7
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      blenderscripts/mesh.py

+ 4 - 4
blenderscripts/mesh.py

@@ -1,7 +1,7 @@
 import sys
 import sys
 import common
 import common
 import os
 import os
-import copy
+from copy import deepcopy
 from Blender import Mathutils
 from Blender import Mathutils
 from Blender.Mathutils import *
 from Blender.Mathutils import *
 
 
@@ -169,7 +169,7 @@ def	getAnkiMeshScript(mesh, skeleton, mtlName, flipYZ):
 			ankiTris[i] = Tri() # create new tri
 			ankiTris[i] = Tri() # create new tri
 			
 			
 			# for verts in the face
 			# for verts in the face
-			for j in [2, 1, 0]:
+			for j in [0, 1, 2]:
 				vertId = face.verts[j].index
 				vertId = face.verts[j].index
 			
 			
 				# vert does not exist
 				# vert does not exist
@@ -188,7 +188,7 @@ def	getAnkiMeshScript(mesh, skeleton, mtlName, flipYZ):
 					while 1:
 					while 1:
 						# if in end of the list, create new vert and link list
 						# if in end of the list, create new vert and link list
 						if vertId == -1:
 						if vertId == -1:
-							ankiVerts[vertsNum] = copy.copy(ankiVerts[prevId])
+							ankiVerts[vertsNum] = deepcopy(ankiVerts[prevId])
 							ankiVerts[vertsNum].s = face.uv[j].x
 							ankiVerts[vertsNum].s = face.uv[j].x
 							ankiVerts[vertsNum].t = face.uv[j].y
 							ankiVerts[vertsNum].t = face.uv[j].y
 							ankiVerts[vertsNum].nextId = -1
 							ankiVerts[vertsNum].nextId = -1
@@ -294,4 +294,4 @@ def export(meshInit):
 	print("Trying to export mesh \"" + mesh.name + "\"")
 	print("Trying to export mesh \"" + mesh.name + "\"")
 	filename = os.path.abspath(meshInit.saveDir + mesh.name + ".mesh")
 	filename = os.path.abspath(meshInit.saveDir + mesh.name + ".mesh")
 	common.WriteFile(filename, getAnkiMeshScript(mesh, skeleton, meshInit.mtlName, meshInit.flipYZ))
 	common.WriteFile(filename, getAnkiMeshScript(mesh, skeleton, meshInit.mtlName, meshInit.flipYZ))
-	print("Mesh exported!! \"" + filename + "\"")	
+	print("Mesh exported!! \"" + filename + "\"")