On 25/04/2017 at 03:02, xxxxxxxx wrote:
Hi
I am sorry for asking something this simple, haven't done much scripting but I have a really simple script, that creates a NormalTag on the selected objects. It's working fine on primitives but not on real geometry.
It crashes C4D if I execute the script on a 3D mesh with the error: Object "ObjectName" - Tag 5711 not in sync. Any hints on how to fix it and what I am doing wrong?
Thank you in advance!
def main() :
doc.StartUndo()
objs = doc.GetActiveObjects(1)
if not objs:
gui.MessageDialog('No objects selected.')
return
for i in objs:
tag = i.MakeTag(c4d.Tnormal)
doc.AddUndo(c4d.UNDOTYPE_NEW, tag)
c4d.EventAdd()
doc.EndUndo()
if __name__=='__main__':
main()