Hello @gheyret,
my apologies, yes, these parameters are not part of the BaseContainer
data container, your initial question was quite clear about that, I just quickly answered the question before I left yesterday and overlooked that aspect.
But you could create a tuple to copy these parameters over because other than in the C++ layer, we do not have to worry much about data types with __get/setitem__
, i.e., the bracket syntax.
Cheers,
Ferdinand
Result:

Code:
from typing import Optional
import c4d
doc: c4d.documents.BaseDocument # The active document
PID_COLLECTION: tuple[int] = (
c4d.ID_BASELIST_NAME,
c4d.ID_BASEOBJECT_VISIBILITY_EDITOR,
c4d.ID_BASEOBJECT_VISIBILITY_RENDER,
c4d.ID_BASEOBJECT_GENERATOR_FLAG,
c4d.ID_BASEOBJECT_USECOLOR,
c4d.ID_BASEOBJECT_COLOR,
)
def main() -> None:
"""
"""
new = doc.GetFirstObject()
old = new.GetNext()
old.SetData(new.GetData())
for pid in PID_COLLECTION:
new[pid] = old[pid]
c4d.EventAdd()
if __name__ == '__main__':
main()