SOLVED Copy info from one Object to other Object

Hi,
i want to Copy all info of one Object to other Object.Use source.CopyTo(aim), But object aim is dead after CopyTo().
My purpose is to copy all the information of an object except the basic information to another object, so after CopyTo(), I want to use the backup information to restore the basic information of aim, but the object is dead and an exception will be thrown

this is code:

import c4d
from c4d import gui

def main():
    source,aim = doc.GetActiveObjects(2)
    doc.StartUndo()
    #backup basic properties
    info_list = []
    description = aim.GetDescription(c4d.DESCFLAGS_DESC_NONE)
    did_list = [c4d.DescID(c4d.DescLevel(110050, 1, 110050)),
                c4d.DescID(c4d.DescLevel(1041666, 1, 110050))]
    for bc, paramid, groupid in description:
        if groupid in did_list:
            if aim[paramid]:
                info_list.append((paramid, aim[paramid]))
    doc.AddUndo(c4d.UNDOTYPE_CHANGE,aim)
    source.CopyTo(aim, c4d.COPYFLAGS_NO_BRANCHES|c4d.COPYFLAGS_NO_MATERIALPREVIEW|c4d.COPYFLAGS_NO_BITS)
    #restore  basic properties
    for info in info_list:
        aim[info[0]] = info[1]
    
    doc.EndUndo()
    c4d.EventAdd()
# Execute main()
if __name__=='__main__':
    main()

Thanks for any help!

Hi,

This is a python bug; it works as expected when using c++. Try to use the following flag c4d.COPYFLAGS_PRIVATE_IDENTMARKER for now to fix the issue. I will open a bug report and we will try to fix the issue as soon as possible.

Cheers,
Manuel

Hi,

This is a python bug; it works as expected when using c++. Try to use the following flag c4d.COPYFLAGS_PRIVATE_IDENTMARKER for now to fix the issue. I will open a bug report and we will try to fix the issue as soon as possible.

Cheers,
Manuel

@manuel Thanks for your help!