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

    Include linked materials when pasting object

    SDK Help
    0
    4
    442
    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.
    • H
      Helper
      last edited by

      On 28/08/2017 at 06:57, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17+ 
      Platform:      
      Language(s) :     C++  ;

      ---------
      Hi! My object has a few link parameters which contains materials. These materials are then added to
      virtually generated objects. I'm trying to find away to have these materials automatically copied when
      the object is pasted into another document.

      I've been looking at MSG_DOCUMENTINFO_OBJECT_INSERT, I could use that to find the materials in
      the original document and copy them to the new document. But I have a feeling that it could very
      clumsy/complicated when multiple objects referencing the same materials are copied, because I would
      have to check which materials have already been copied over.

      Is there a "native" way to implement this or is there one single special handling in Cinema 4D that looks
      just at Texture Tags?

      Thanks,
      -Niklas

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 29/08/2017 at 00:04, xxxxxxxx wrote:

        There's been this thread coming up recently. Maybe it's some sort of help for you?

        https://developers.maxon.net/forum/topic/551/13704_copy-material-with-links-to-another-doc

        Cheers. 🙂

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 29/08/2017 at 07:28, xxxxxxxx wrote:

          As the thread linked in the post above probably already suggests, there is no native way to achieve this. Sorry, Niklas!

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 29/08/2017 at 19:35, xxxxxxxx wrote:

            Another solution, a bit dirty I admit, is to make a scenehook that look at Ttexture and if its your material, make invisible Ttexture tag with all your sub material and a selection that is not aviable in the object like that you are sure theses extra Ttexture tag will never be used. And that's it ! 🙂

            Since c4d copy all materials aviable in Ttexture, it will copy for you subs materials

            EDIT: I'm not sure if Scenehook is really needed since with SetDParameter you can catch assignement change, so you can handle the creations/delete of thoses tags here

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