Tag Copying an Object Along With iT



  • 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



  • 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



  • 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



  • 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



  • @zipit Thank you for the info!

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

    Dan


Log in to reply