Changeset View
Changeset View
Standalone View
Standalone View
io_export_unreal_psk_psa.py
| Context not available. | |||||
| if (face in group.faces): | if (face in group.faces): | ||||
| return | return | ||||
| smoothgroup = SmoothingGroup(); | smoothgroup = SmoothingGroup() | ||||
| add_face_to_smoothgroup( mesh, face, edge_sharing_list, smoothgroup ) | add_face_to_smoothgroup( mesh, face, edge_sharing_list, smoothgroup ) | ||||
| if not smoothgroup in smoothgroup_list: | if not smoothgroup in smoothgroup_list: | ||||
| Context not available. | |||||
| elif dot < 0: | elif dot < 0: | ||||
| (tri.WedgeIndex0, tri.WedgeIndex1, tri.WedgeIndex2) = wedge_list | (tri.WedgeIndex0, tri.WedgeIndex1, tri.WedgeIndex2) = wedge_list | ||||
| else: | else: | ||||
| dindex0 = face.vertices[0]; | dindex0 = face.vertices[0] | ||||
| dindex1 = face.vertices[1]; | dindex1 = face.vertices[1] | ||||
| dindex2 = face.vertices[2]; | dindex2 = face.vertices[2] | ||||
| mesh.data.vertices[dindex0].select = True | mesh.data.vertices[dindex0].select = True | ||||
| mesh.data.vertices[dindex1].select = True | mesh.data.vertices[dindex1].select = True | ||||
| Context not available. | |||||
| status = "Ok" | status = "Ok" | ||||
| bones.append(bone); | bones.append(bone) | ||||
| if not bone.use_deform: | if not bone.use_deform: | ||||
| status = "No effect" | status = "No effect" | ||||
| Context not available. | |||||
| for pb in armature.pose.bones: | for pb in armature.pose.bones: | ||||
| if b.name == pb.name: | if b.name == pb.name: | ||||
| udk_pose_bones.append(pb) | udk_pose_bones.append(pb) | ||||
| break; | break | ||||
| # sort in the order the bones appear in the PSA file | # sort in the order the bones appear in the PSA file | ||||
| ordered_bones = {} | ordered_bones = {} | ||||
| Context not available. | |||||
| for i in bpy.context.scene.objects: i.select = False #deselect all objects | for i in bpy.context.scene.objects: i.select = False #deselect all objects | ||||
| obj.select = True #set current object select | obj.select = True #set current object select | ||||
| bpy.context.scene.objects.active = obj #set active object | bpy.context.scene.objects.active = obj #set active object | ||||
| mesh = bmesh.new(); | mesh = bmesh.new() | ||||
| mesh.from_mesh(obj.data) | mesh.from_mesh(obj.data) | ||||
| for face in mesh.faces: | for face in mesh.faces: | ||||
| face.select = False | face.select = False | ||||
| Context not available. | |||||
| blender_tface = uvtex.data[i] #face | blender_tface = uvtex.data[i] #face | ||||
| mfaceuv = uvfaces[i] | mfaceuv = uvfaces[i] | ||||
| if len(mfaceuv) == 3: | if len(mfaceuv) == 3: | ||||
| blender_tface.uv1 = mfaceuv[0]; | blender_tface.uv1 = mfaceuv[0] | ||||
| blender_tface.uv2 = mfaceuv[1]; | blender_tface.uv2 = mfaceuv[1] | ||||
| blender_tface.uv3 = mfaceuv[2]; | blender_tface.uv3 = mfaceuv[2] | ||||
| if len(mfaceuv) == 4: | if len(mfaceuv) == 4: | ||||
| blender_tface.uv1 = mfaceuv[0]; | blender_tface.uv1 = mfaceuv[0] | ||||
| blender_tface.uv2 = mfaceuv[1]; | blender_tface.uv2 = mfaceuv[1] | ||||
| blender_tface.uv3 = mfaceuv[2]; | blender_tface.uv3 = mfaceuv[2] | ||||
| blender_tface.uv4 = mfaceuv[3]; | blender_tface.uv4 = mfaceuv[3] | ||||
| me_ob.update()#need to update the information to able to see into the secne | me_ob.update()#need to update the information to able to see into the secne | ||||
| obmesh = bpy.data.objects.new(("Re_"+obj.name),me_ob) | obmesh = bpy.data.objects.new(("Re_"+obj.name),me_ob) | ||||
| Context not available. | |||||
| elif dot < 0: | elif dot < 0: | ||||
| (tri.WedgeIndex0, tri.WedgeIndex1, tri.WedgeIndex2) = wedge_list | (tri.WedgeIndex0, tri.WedgeIndex1, tri.WedgeIndex2) = wedge_list | ||||
| else: | else: | ||||
| dindex0 = face.vertices[0]; | dindex0 = face.vertices[0] | ||||
| dindex1 = face.vertices[1]; | dindex1 = face.vertices[1] | ||||
| dindex2 = face.vertices[2]; | dindex2 = face.vertices[2] | ||||
| vertex_list.append(dindex0) | vertex_list.append(dindex0) | ||||
| vertex_list.append(dindex1) | vertex_list.append(dindex1) | ||||
| vertex_list.append(dindex2) | vertex_list.append(dindex2) | ||||
| Context not available. | |||||
| for actionlist in my_sett: | for actionlist in my_sett: | ||||
| #print("action name:",actionlist.name) | #print("action name:",actionlist.name) | ||||
| if actionlist.name == actname: | if actionlist.name == actname: | ||||
| my_sett.remove(actioncount); | my_sett.remove(actioncount) | ||||
| break | break | ||||
| actioncount += 1 | actioncount += 1 | ||||
| return{'FINISHED'} | return{'FINISHED'} | ||||
| Context not available. | |||||