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

    How to replace mesh

    SDK Help
    0
    4
    546
    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 10/05/2017 at 00:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hello again,
      let's say I have two independent polygonal objects in scene (source and destination). I need to replace geometry of destination object by the copy of geometry from source object while keeping all links, tags and attributes of destination object untouched.

      Is there a way how to do that? (I don't want to make a copy of source object and delete destination object since it acts differently in undo history with other unwanted consequences. It should be treated as modification of object from cinema point of view.)

      Thank you.

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

        On 10/05/2017 at 02:07, xxxxxxxx wrote:

        You could "simply" copy all points and polygon object from one to the other. However,
        you should also take into account selection tags, normal tags, vertex map tags, ngons...

        Alternatively, here's a ReplaceObject() function that has worked quite well for me. Not sure
        if it works fine in your case. Note that the code is under LGPL license.

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

          On 10/05/2017 at 06:42, xxxxxxxx wrote:

          Object replacement is not what I needed but copying all points and polygons worked. Thank you.

          PS: I forgot to mention but I tried C4DAtom::CopyTo function and it gave me strange results like object transformation was reset or object disappeared completely.

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

            On 15/05/2017 at 07:01, xxxxxxxx wrote:

            Glad the question got already answered. Miro, if you'd like to discuss the CopyTo() issue, I suggest to set up a new thread and post a few more details (maybe also a code snippet) in there.

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