On 06/10/2016 at 05:58, xxxxxxxx wrote:
Hi Augment,
just a small additional hint.
With cmd+I and Subdivision Surfaces within your scene, it seems that you´ll receive both, the generators polycount and the polycount of the object driving the generator.
Furthermore the editors subdivisionlevel and not the render level is taken into account.
Polygonizing the document might be a good way to receive the accurate number of polygons.
import c4d
def polyOp(obj) :
result = []
while obj:
if obj.GetDown() :
result += polyOp(obj.GetDown())
if obj.CheckType(c4d.Opolygon) :
count = obj.GetPolygonCount()
try:
result[0] = [result[0][0] + count]
except:
result.append([count])
obj = obj.GetNext()
return result
def main() :
doc = c4d.documents.GetActiveDocument()
doc2 = doc.Polygonize()
print polyOp(doc2.GetFirstObject())[0][0]
c4d.documents.KillDocument(doc2)
if __name__=='__main__':
main()
best wishes
Martin