Added getuvs()

This commit is contained in:
_ 2018-05-13 09:54:57 -07:00
parent 650178f3a4
commit c45c8d758a

View File

@ -140,6 +140,9 @@ class UVs(ctypes.Structure):
("v", ctypes.c_short) ("v", ctypes.c_short)
] ]
def __str__(self):
return "(%s, %s)" % (str(self.u), str(self.v))
class BoneIndexes(ctypes.Structure): class BoneIndexes(ctypes.Structure):
_pack_ = 1 _pack_ = 1
_fields_ = [ _fields_ = [
@ -372,6 +375,10 @@ class MEsh:
length = self.cstruct.b.contents.bd.contents.numVertex length = self.cstruct.b.contents.bd.contents.numVertex
return self.cstruct.b.contents.vd.normals[:length] return self.cstruct.b.contents.vd.normals[:length]
def getuvs(self):
length = self.cstruct.b.contents.bd.contents.numVertex
return self.cstruct.b.contents.vd.u[:length]
#--------------------------------------+ #--------------------------------------+
# Regular Python # Regular Python
#--------------------------------------+ #--------------------------------------+
@ -460,11 +467,17 @@ if __name__ == "__main__":
m = MEsh(0, data) m = MEsh(0, data)
m.show() m.show()
p = m.getpositions() p = m.getpositions()
print("positions:")
for point in p: for point in p:
print(point) print(point)
n = m.getnormals() n = m.getnormals()
print("normals:")
for point in n: for point in n:
print(point) print(point)
u = m.getuvs()
print("uvs:")
for point in u:
print(point)
#---------------------------------------+ #---------------------------------------+
# main() # main()
mainx() mainx()