Changeset View
Changeset View
Standalone View
Standalone View
io_export_unreal_psk_psa.py
| Context not available. | |||||
| or cmp(self.Z, other.Z) | or cmp(self.Z, other.Z) | ||||
| def _key(self): | def _key(self): | ||||
| return (type(self).__name__, self.X, self.Y, self.Z) | return type(self).__name__, self.X, self.Y, self.Z | ||||
| def __hash__(self): | def __hash__(self): | ||||
| return hash(self._key()) | return hash(self._key()) | ||||
| Context not available. | |||||
| or cmp(self.SmoothGroup, other.SmoothGroup ) | or cmp(self.SmoothGroup, other.SmoothGroup ) | ||||
| def _key(self): | def _key(self): | ||||
| return (type(self).__name__, self.PointIndex, self.U, self.V, self.MatIndex, self.Reserved) | return type(self).__name__, self.PointIndex, self.U, self.V, self.MatIndex, self.Reserved | ||||
| def __hash__(self): | def __hash__(self): | ||||
| return hash(self._key()) | return hash(self._key()) | ||||
| Context not available. | |||||
| return hash(self._key()) | return hash(self._key()) | ||||
| def _key(self): | def _key(self): | ||||
| return (type(self).__name__, self.Point) | return type(self).__name__, self.Point | ||||
| def __eq__(self, other): | def __eq__(self, other): | ||||
| if not hasattr(other, '_key'): | if not hasattr(other, '_key'): | ||||
| Context not available. | |||||
| or cmp(self.SmoothGroup, other.SmoothGroup) | or cmp(self.SmoothGroup, other.SmoothGroup) | ||||
| def _key(self): | def _key(self): | ||||
| return (type(self).__name__, self.Point, self.SmoothGroup) | return type(self).__name__, self.Point, self.SmoothGroup | ||||
| def __hash__(self): | def __hash__(self): | ||||
| return hash(self._key()) \ | return hash(self._key()) \ | ||||
| Context not available. | |||||
| return self.Bones.Data[bone_index] | return self.Bones.Data[bone_index] | ||||
| def IsEmpty(self): | def IsEmpty(self): | ||||
| return (len(self.Bones.Data) == 0 or len(self.Animations.Data) == 0) | return len(self.Bones.Data) == 0 or len(self.Animations.Data) == 0 | ||||
| def StoreBone(self, b): | def StoreBone(self, b): | ||||
| self.BoneLookup[b.Name] = [-1, b] | self.BoneLookup[b.Name] = [-1, b] | ||||
| Context not available. | |||||
| self.neighboring_groups.append( new_neighbor ) | self.neighboring_groups.append( new_neighbor ) | ||||
| def contains_face(self, face): | def contains_face(self, face): | ||||
| return (face in self.faces) | return face in self.faces | ||||
| def add_neighbor_face(self, face): | def add_neighbor_face(self, face): | ||||
| if not face in self.neighboring_faces: | if not face in self.neighboring_faces: | ||||
| Context not available. | |||||
| if edge_id != None: | if edge_id != None: | ||||
| # not sharp | # not sharp | ||||
| if not( mesh.edges[edge_id].use_edge_sharp): | if not mesh.edges[edge_id].use_edge_sharp: | ||||
| for shared_face in edge_sharing_list[key]: | for shared_face in edge_sharing_list[key]: | ||||
| if shared_face != face: | if shared_face != face: | ||||
| Context not available. | |||||
| def determine_smoothgroup_for_face( mesh, face, edge_sharing_list, smoothgroup_list ): | def determine_smoothgroup_for_face( mesh, face, edge_sharing_list, smoothgroup_list ): | ||||
| for group in smoothgroup_list: | for group in smoothgroup_list: | ||||
| if (face in group.faces): | if face in group.faces: | ||||
| return | return | ||||
| smoothgroup = SmoothingGroup(); | smoothgroup = SmoothingGroup(); | ||||
| Context not available. | |||||
| vert = mesh.data.vertices[vert_index] | vert = mesh.data.vertices[vert_index] | ||||
| uv = [] | uv = [] | ||||
| #assumes 3 UVs Per face (for now) | #assumes 3 UVs Per face (for now) | ||||
| if (has_uv): | if has_uv: | ||||
| if len(face_uv.uv) != 3: | if len(face_uv.uv) != 3: | ||||
| print("WARNING: face has more or less than 3 UV coordinates - writing 0,0...") | print("WARNING: face has more or less than 3 UV coordinates - writing 0,0...") | ||||
| uv = [0.0, 0.0] | uv = [0.0, 0.0] | ||||
| Context not available. | |||||
| # clamp UV coords if udk_option_clamp_uv is True | # clamp UV coords if udk_option_clamp_uv is True | ||||
| if bpy.context.scene.udk_option_clamp_uv: | if bpy.context.scene.udk_option_clamp_uv: | ||||
| if (uv[0] > 1): | if uv[0] > 1: | ||||
| uv[0] = 1 | uv[0] = 1 | ||||
| if (uv[0] < 0): | if uv[0] < 0: | ||||
| uv[0] = 0 | uv[0] = 0 | ||||
| if (uv[1] > 1): | if uv[1] > 1: | ||||
| uv[1] = 1 | uv[1] = 1 | ||||
| if (uv[1] < 0): | if uv[1] < 0: | ||||
| uv[1] = 0 | uv[1] = 0 | ||||
| # RE - Append untransformed vector (for normal calc below) | # RE - Append untransformed vector (for normal calc below) | ||||
| Context not available. | |||||