I have a tag plugin where I move tags from one object to another.
I tried several Undo types, but I cannot get it working.
What to do?
childTags = child.GetTags()
for childTag in childTags:
undo-steps for inserting objects have to be added after the the object has been inserted; the appropriate flag is then c4d.UNDOTYPE_NEW. Could you describe in more detail what is not working?
an undo-step has to start with StartUndo() and must end with EndUndo(). In between, you can add operations to that undo-step with AddUndo(). As @zipit has shown, the undo-operation for adding something to the document is c4d.UNDOTYPE_NEW.
ttag = c4d.TextureTag()
See also Undo System Manual.
Also, if you want to move a tag, you first have to remove it from the original object. So you don't insert, you change the position of the tag in the scene graph.