Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Copy All Parameters of One Object to Another in Real Time?

    Cinema 4D SDK
    r21 python
    3
    4
    502
    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.
    • B
      bentraje
      last edited by

      HI,

      Is there a way Copy All Parameters of One Object to Another in Real Time?
      Basically, an instance. I would use the instance object but it does not work for emitter.

      You can see the problem here:
      https://www.dropbox.com/s/s5wi1dhq1tysy0d/c4d290_python_copy_all_parameters_in_real_time.mp4?dl=0

      Regards,
      Ben

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

        Hi,

        You need to add an object as child of the emitter and activate the "show object" options. Than, you have to change the mode of the Instance to "Render Instance".

        If it doesn't work for your need, we will see what we can do in code with InstanceObject

        The "problem" is that some data can be stored in various way. That could be an issue at the end 🙂

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • ferdinandF
          ferdinand @bentraje
          last edited by

          Hi,

          @bentraje said:

          Is there a way Copy All Parameters of One Object to Another in Real Time?

          I assume with copying in realtime, you actually mean copying dynamically, i.e. establish an ongoing one way linkage from the parameters of one object to the other.

          The continuous execution would have to be done by yourself, but you can copy one object to another with c4d.C4DAtom.CopyTo and one data container to another with c4d.BaseContainer.CopyTo. The one to choose depends on what you would consider the parameters of an object. If you would only consider elements of the description parameters, i.e. "the gui values", then copying the data container will be enough. If your definition of parameters is broader, you will have to copy the whole node.

          But I doubt that you can copy the internal state of a particle system. I do not think that there is a particular technical reason that would prevent that, it just strikes me as an odd feature, so I might be wrong about that, never have tested that.

          Cheers,
          zipit

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 1
          • B
            bentraje
            last edited by

            Thanks for the response

            @m_magalhaes
            Oh thanks. It now works on native c4d emitter but not in xparticles emitter.
            No worries, the solution by @zipit works

            @zipit

            Thanks. It works as expected. Here's the code I used added in a python tag

                orig = doc.SearchObject("original")
                dup = doc.SearchObject("duplicate")
                
                orig_container = orig.GetDataInstance()
                orig_container.CopyTo(dup.GetDataInstance(), flags= c4d.COPYFLAGS_PRIVATE_CONTAINER_COPY_IDENTICAL, trans=None)
            
                c4d.EventAdd()
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post