Skip to content
Snippets Groups Projects
Commit ea861fa5 authored by John Phan's avatar John Phan
Browse files

error fixed on mesh and armature bones count

parent 670952bb
Branches
Tags v2.63 v2.63a
No related merge requests found
...@@ -907,6 +907,8 @@ def parse_smooth_groups( mesh ): ...@@ -907,6 +907,8 @@ def parse_smooth_groups( mesh ):
edge_sharing_list = determine_edge_sharing(mesh) edge_sharing_list = determine_edge_sharing(mesh)
#print("faces:",len(mesh.tessfaces)) #print("faces:",len(mesh.tessfaces))
interval = math.floor(len(mesh.tessfaces) / 100) interval = math.floor(len(mesh.tessfaces) / 100)
if interval == 0: #if the faces are few do this
interval = math.floor(len(mesh.tessfaces) / 10)
#print("FACES:",len(mesh.tessfaces),"//100 =" "interval:",interval) #print("FACES:",len(mesh.tessfaces),"//100 =" "interval:",interval)
for face in mesh.tessfaces: for face in mesh.tessfaces:
#print(dir(face)) #print(dir(face))
...@@ -1588,8 +1590,11 @@ def find_armature_and_mesh(): ...@@ -1588,8 +1590,11 @@ def find_armature_and_mesh():
else: else:
raise Error("No mesh parented to armature") raise Error("No mesh parented to armature")
verbose("Found mesh: {}".format(mesh.name)) verbose("Found mesh: {}".format(mesh.name))
if len(armature.pose.bones) == len(mesh.vertex_groups):
print("Armature and Mesh Vertex Groups matches Ok!")
else:
raise Error("Armature bones:" + str(len(armature.pose.bones)) + " Mesh Vertex Groups:" + str(len(mesh.vertex_groups)) +" doesn't match!")
return armature, mesh return armature, mesh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment