On 13/11/2017 at 23:15, xxxxxxxx wrote:
Hi!
I have some thousands of cubes with a fillet subdivision of 3 so they contain 113 poligons each.
I thought it would be a good idea to remove the 107 poligons for the fillet and keep the 6 sides only for previewing purposes, because these thousands of cubes can make the viewport animation preview pretty damn slow.
Thanks to gr4ph0s' help I have a function which goes trough all the 113 polygons and applies a material to the poligons on the cube sides (I found out that the 3rd one is the front, 31st is right, etc - I made a dict of them) but how could I delete the remaining ones, if the SceneQuality is set to Draft?
I tried this:
def create_poly_selection(obj) :
poly_count = obj.GetPolygonCount()
tags = list()
for i in xrange(poly_count) :
CubeSideNumbers = {"3": "FRONT", "31": "RIGHT", "59": "BACK", "87": "LEFT", "112": "TOP", "113": "BOTTOM"}
if str(i) in CubeSideNumbers:
tag = c4d.SelectionTag(c4d.Tpolygonselection)
tag.SetName(str(i))
obj.InsertTag(tag)
tags.append([i, tag])
** else:**
** if SceneQuality == "Draft":**
** obj.remove()**
return tags
I got an error for the bold part: AttributeError: 'c4d.PolygonObject' object has no attribute 'remove'
(I think it's because the "obj" is the cube itself, not the poligon)