Create a MoGraph Tracer using Melange

On 08/08/2017 at 01:32, xxxxxxxx wrote:

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


Is it possible to create a MoGraph_Tracer using Melange ?

Thank you for your help !


On 08/08/2017 at 04:22, xxxxxxxx wrote:

// create a document
BaseDocument* c4dDoc = BaseDocument::Alloc();
// create a tracer, 1018655 is the ID of the tracer, to know it simply drag and drop a tracer object into the console
BaseObject* myTracer = BaseObject::Alloc(1018655);
// insert into the project
c4dDoc->InsertObject(myTracer, nullptr);

I'm not a melange user, then I don't really know if melange support all the mograph stuff. But if it does the code above should work 😉

On 08/08/2017 at 04:32, xxxxxxxx wrote:

Thank you very much for your reply ! It solved my problem.

I just have a question : when I drag and drop a Tracer object in the console, I do not have the ID of the Tracer object, but just the name of it : "Tracer". What am I doing wrong ?

On 09/08/2017 at 02:43, xxxxxxxx wrote:

Hi Lina,

you are not doing anything wrong, the name you get in the console is actually a reference to the actual object. It can be used directly as if you were in a script. For example simply press return, the referenced entity will be printed to the console (among other information also the ID). Or you can simply append .GetType() and press return to print just the ID.

On 09/08/2017 at 02:47, xxxxxxxx wrote:

Hi Andreas,

Thank you ! Everything is easier now 🙂