mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-29 10:12:02 +05:30
Added getuvs()
This commit is contained in:
parent
650178f3a4
commit
c45c8d758a
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user