Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Copying All Compatible Properties from One Object to Another?

    Cinema 4D SDK
    python s22
    5
    6
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dskeithbuckD
      dskeithbuck
      last edited by

      Hi,

      Is there a preferred way of copying all compatible object properties from an object of one type, to an object of another type? Things, I'm thinking of:

      • Name
      • Matrix
      • Layers
      • Visibility
      • Tags
      • Animation
      • Compatible Properties / Animation - So probably, PSR, but maybe also Visibility or Time Tracks, etc.

      I think I know how to approach this manually, but don't want to duplicate efforts if there's an API method, or existing snippet that does this as I'm afraid of leaving out something critical, and/or future proofing against future API additions.
      Thanks!

      Donovan

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        as you may know, if the object's type were the same you could use CopyTo
        But in your case, there's no builtin function do to it.

        I've checked how it's done for external compositing programme and there's nothing helpfull.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        M 1 Reply Last reply Reply Quote 0
        • M
          mikegold10 @Manuel
          last edited by

          @m_magalhaes said in Copying All Compatible Properties from One Object to Another?:

          Hi,

          as you may know, if the object's type were the same you could use CopyTo
          But in your case, there's no builtin function do to it.

          I've checked how it's done for external compositing programme and there's nothing helpfull.

          Cheers,
          Manuel

          What about copying data from the BaseContainer of the source object to the destination object only if the ids in the source BaseContainer are relevant and/or are already present in the destination object's BaseContainer (i.e., copy only those key/value pairs that are applicable to the destination)?

          1 Reply Last reply Reply Quote 0
          • P
            PluginStudent
            last edited by

            @mikegold10 said in Copying All Compatible Properties from One Object to Another?:

            What about copying data from the BaseContainer

            There is no guarantee that all relevant data is stored in the BaseContainer.

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              hi,

              as @PluginStudent said, not everything is stored on the BaseContainer

              There's a lot of things to think when you are exporting to an external application if you want to replicate the scene the right way.
              For example, what about, if in Cinema 4D the camera is shifted ?

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • dskeithD
                dskeith
                last edited by

                Realizing I never responded to this Thank you @m_magalhaes, @mikegold10, and @PluginStudent.

                I ended up manually making a list of the parameters I wanted to copy and iterating through all of them. Not ideal, but at least glad to know there wasn't an automated method I was missing.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post