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

    Tag Copying an Object Along With iT

    Cinema 4D SDK
    3
    4
    497
    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.
    • D
      d_schmidt
      last edited by

      Hello!

      I'm currently working on a Tag plugin that is linked to an object in the scene with a BaseLink, it is not the same object that it is currently on.

      Is there a way that if the Tag was copied to a new document that the Linked object would also be copied over and inserted into the new file? If it wasn't selected in the initial copy command.

      Dan

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by

        Hi,

        you could overwrite NodeData::CopyTo (and ::Read and ::Write). In CopyTo you would have to serialize your BaseLink information, bei either serializing the linked nodes directly or by serializing some kind of custom context. The unpacking would technically happen in NodeData::Read but due to the special scenario, you will probably have to delay your unpacking to a later point, when you are sure that the updating of the new scene graph has finalized.

        But apart from these hoops to jump through, you would have to make sure to correctly handle cyclic structures, partial copies and chain reactions of your copy logic (do I really want to allow a thousand object longMySpecialTag copy logic chain reaction to unravel, because the user copied one tag?). Because of these problems plus the fact that deviating from the default behavior might confuse the user, I would contemplate if this is really what you want.

        Cheers,
        zipit

        MAXON SDK Specialist
        developers.maxon.net

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

          hi,

          @zipit said everthing.
          Don't forget that copyTo can also be called by Cinema4D.

          And once again, please use the tags on your threads and 'ask question' 🙂

          Cheers,
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

          1 Reply Last reply Reply Quote 1
          • D
            d_schmidt
            last edited by

            @zipit Thank you for the info!

            @m_magalhaes Sorry about that, Manuel. I'll make sure I do that in the future.

            Dan

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