Polygonize() & CallCommand

On 07/08/2013 at 19:47, xxxxxxxx wrote:

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

doc->Polygonize() makes a clone, according to the SDK. If I follow this with a CallCommand(12107) and CallCommand(12108) which is Copy and Paste, which is affected? The original doc or the "clone"?

In my SceneSaver plugin (for which I used the .stl exporter from the SDK as starter) I had originally worked with a Polygonized doc. It seems when I couldn't find another way to Copy/Paste a polygon object and used CallCommand's it didn't work - as CallCommand seems to affect the doc and not the clone. Since my exporter tests the objects intended for export it knows that they are polygons - so I took out Polygonize. Now my exporter works all the way through (creates the output file and the correct output in the console) but still crashes C4D.

Does a SceneSaver require polygonization for some reason?



On 08/08/2013 at 00:13, xxxxxxxx wrote:

The original doc, of course, since CallCommand() is equivalent to the user actually selecting that action in the C4D interface.  You should use SendModelingCommand() instead.

On 08/08/2013 at 19:34, xxxxxxxx wrote:

On 08/08/2013 at 19:41, xxxxxxxx wrote:

Thanks. Of course that makes sense.
In my situation I need to make a copy of an existing object, not change it. Couldn't find another way than CallCommand() even I feel a bit uncomfortable using it.

It seems making a duplicate and just inserting it into the doc should be possible. But how?

It turns out that the SceneSaver does apparently need a Polygonized doc.


On 08/08/2013 at 21:20, xxxxxxxx wrote:

To copy something, use the GetClone() method of the object.