...
Code Block | ||
---|---|---|
| ||
polygonObject = scene.getObject("Torus01") polygons = polygonObject.getFaces() vertices = polygonObject.getVertices() vertexPositionsvertexPosition = Vector.new(0,0,0) container = scene.get_PB_Emitter("Container01") for polygon in polygons: vertexIndices = polygon.getIndices() vertex0 = vertices[vertexIndices[0]] vertex1 = vertices[vertexIndices[1]] vertex2 = vertices[vertexIndices[2]] vertex0Pos = vertex0.getPosition() vertex1Pos = vertex1.getPosition() vertex2Pos = vertex2.getPosition() vertexPositionsvertexPosition = vertex0Pos + vertex1Pos + vertex2Pos vertexPositionsvertexPosition.set(vertexPositionsvertexPosition.x / 3, vertexPositionsvertexPosition.y / 3, vertexPositionsvertexPosition.z / 3) container.addParticle(vertexPositionsvertexPosition, Vector.new(0,0,0)) |