mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-12 21:59:05 +08:00
added draco mesh
This commit is contained in:
parent
9c48f45d28
commit
fae76dd191
@ -64,27 +64,13 @@ class DracoTranslator(OpenMayaMPx.MPxFileTranslator):
|
|||||||
# Get current polygons index
|
# Get current polygons index
|
||||||
polyList.append(polygonsIterator.index())
|
polyList.append(polygonsIterator.index())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Get current polygons vertices
|
# Get current polygons vertices
|
||||||
verts = OpenMaya.MIntArray()
|
verts = OpenMaya.MIntArray()
|
||||||
polygonsIterator.getVertices(verts)
|
polygonsIterator.getVertices(verts)
|
||||||
|
|
||||||
normalIndices = []
|
|
||||||
# Append the current polygons vertex indices
|
# Append the current polygons vertex indices
|
||||||
for i in range(verts.length()):
|
for i in range(verts.length()):
|
||||||
vertexList.append(verts[i])
|
vertexList.append(verts[i])
|
||||||
normalIndices.append(polygonsIterator.normalIndex()) #return the index in the normals buffer
|
|
||||||
|
|
||||||
# Get current polygons normals
|
|
||||||
norms = OpenMaya.MVectorArray()
|
|
||||||
# polygonsIterator.getNormals(norms)
|
|
||||||
|
|
||||||
#Append current polygons normal indices
|
|
||||||
for index in normalIndices:
|
|
||||||
normalList.append(norms[index].x)
|
|
||||||
normalList.append(norms[index].y)
|
|
||||||
normalList.append(norms[index].z)
|
|
||||||
|
|
||||||
# Get current polygons edges
|
# Get current polygons edges
|
||||||
edges = OpenMaya.MIntArray()
|
edges = OpenMaya.MIntArray()
|
||||||
@ -127,6 +113,8 @@ class DracoTranslator(OpenMayaMPx.MPxFileTranslator):
|
|||||||
drcMesh.vertices_len = len(vertexList)
|
drcMesh.vertices_len = len(vertexList)
|
||||||
drcMesh.vertices = vertexList
|
drcMesh.vertices = vertexList
|
||||||
|
|
||||||
|
#SAVE FILE
|
||||||
|
|
||||||
# print data for current selection being iterated on,
|
# print data for current selection being iterated on,
|
||||||
print ("Object name: {}".format(dagPath.fullPathName()))
|
print ("Object name: {}".format(dagPath.fullPathName()))
|
||||||
print ("Vertex list: {} size: {}".format(vertexList, len(vertexList)))
|
print ("Vertex list: {} size: {}".format(vertexList, len(vertexList)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user