I have a scene which crashes more or less randomly and Arnold prints an error that there are degenerate polygons in the scene. The geometry consist of 3600 simple cubes which are imported from an alembic file generated in Cinema4D, so manually examining every object is not really an option. So my question is how to fix the degenerate polygons? I found this script: http://xsisupport.com/2013/03/13/finding-degenerate-polygons-by-area/ , but it fails with an error:
This is what I ran: si = Application epsilon = 0.00001 # Get PolygonArea DataArray (which is a tuple) attr = si.Selection(0).ActivePrimitive.GetICEAttributeFromName( "PolygonArea" ) areaData = attr.DataArray # # Find the indices of the bad polys # bad = [ x for x,y in enumerate( areaData ) if y < epsilon] # Select the degenerates with a string like 'cube.poly[112,114,155]' si.SelectGeometryComponents( 'Null2.Cube_[%s]' % ','.join(str(i) for i in bad) ) - and the error: Application.SelectMembers("abc_Tiles", "", "") # ERROR : 2000 - Argument 0 (SelectionList) is invalid # ERROR : 2001-SELE-SelectGeometryComponents - Argument 0 is invalid Application.SelectGeometryComponents("Null2.Cube_[]") # ERROR : Traceback (most recent call last): # File "<Script Block >", line 14, in <module> # si.SelectGeometryComponents( 'Null2.Cube_[%s]' % ','.join(str(i) for i in bad) ) # File "<COMObject Application>", line 2, in SelectGeometryComponents # COM Error: The parameter is incorrect. (0x-7ff8ffa9) - [line 14] Line 14 is this one: si.SelectGeometryComponents( 'Null2.Cube_[%s]' % ','.join(str(i) for i in bad) ) So what might be wrong with this one, and when I know which polygons are bad, how can I fix them? I am thinking since they dont have an ICE tree they might have no ICE PolygonArea property... Best Morten