How to replace mesh

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.

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.

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.

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.