On 08/10/2014 at 04:19, xxxxxxxx wrote:
Hallo,
in this script ( c4d file https://www.hidrive.strato.com/share/mvm9t4h3vi#$/) i want to deselect a number of selected polygons but the editor is not refreshed.
import c4d
#Welcome to the world of Python
changed=0 # glabal variable
def main() :
# global changed # must be defined in function as global
# null=op.GetObject() # object of python tag
print " "
obj=doc.GetActiveObject()
if not (obj==None) :
print "selected object =",obj.GetName(), obj.GetTypeName()
if (obj.CheckType(c4d.Opolygon)) :
n=obj.GetPolygonCount()
sel=obj.GetPolygonS()
nsel=sel.GetCount()
nth=op[c4d.ID_USERDATA,1]
print "number of selected polygons:",n,nsel,nth
if (nsel>3) :
for i in range(0,nsel) :
if (i % nth==0) :
sel.Deselect(i)
print i,"deselected"
# here i want to refresh the editor
# c4dtools.utils.update_editor() # nothing happens
# obj.Message(c4d.MSG_UPDATE) # nothing happens
# c4d.EventAdd(); # endless loop calling this function
return
I have googleing one day without any result. Please excuse me its my first posting in forums.
Thanks Udo Welz