Yo, so doing a instance to mesh tool, but got some problem with the 
setFaceVertexNormals function, I have no idea how to solve this. 



        normalsVectors = outMeshFn.getNormals()   # if print len = 3200 
normals

        newFaceList = []
        newVertexList = []
        for i in range(num_polygons):  #400
            for j in range(instancePolygonCountsCount): # 6
                faceIndex = i*instancePolygonCountsCount + j # 0 to 2399
                vertexList = outMeshFn.getPolygonVertices(faceIndex) ## 
[0,1,3,4],[2, 3, 5, 4],[4, 5, 7, 6]
                
                newFaceList += [faceIndex]*len(vertexList)
                newVertexList += vertexList

                for vtxId in vertexList: # 4
                    normalsVectors[vtxId] = OpenMaya.MFloatVector(0,1,0)
                                                       
        #print newFaceList #[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 
3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 
9....]
        #print len(newFaceList) # 9600 connections

        #print newVertexList # [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 
1, 0, 1, 7, 5, 3, 6, 0, 2, 4, 8, 9....]
        #print len(newVertexList) # 9600 connections
        
        #print normalsVectors# [maya.api.OpenMaya.MFloatVector(0, 1, 0), 
maya.api.OpenMaya.MFloatVector(0, 1, 0)....]
        #print len(normalsVectors) #3200....wrong? shouldn't it be 2400? or 
for vtx 9600?
        
        outMeshFn.setFaceVertexNormals(normalsVectors, newFaceList, 
newVertexList) # ERROR: sequence contains items which are not convertable 
to int.



Any Idea what they mean with "sequence contains items which are not 
convertable to int."?
cheers!

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/74f664c5-3643-4b82-9bf4-0d75c913f85c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to