Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Create a MoGraph Tracer using Melange

 Post Reply Post Reply
Author
Message
Lina View Drop Down
Member
Member


Joined: 2017 Jun 21
Online Status: Offline
Posts: 6
Post Options Post Options   Quote Lina Quote  Post ReplyReply Direct Link To This Post Topic: Create a MoGraph Tracer using Melange
    Posted: 2017 Aug 08 at 1:32am

User Information:

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

---------

Hello,

Is it possible to create a MoGraph_Tracer using Melange ? 

Thank you for your help !

Lina
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: France
Online Status: Offline
Posts: 306
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 08 at 4:22am
// 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 ;)
Technical lover.
Aviable for job in october.
Back to Top
Lina View Drop Down
Member
Member


Joined: 2017 Jun 21
Online Status: Offline
Posts: 6
Post Options Post Options   Quote Lina Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 08 at 4:32am
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 ?


Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1430
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 09 at 2:43am
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.

Cheers,
Andreas
SDK Support Engineer
Back to Top
Lina View Drop Down
Member
Member


Joined: 2017 Jun 21
Online Status: Offline
Posts: 6
Post Options Post Options   Quote Lina Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 09 at 2:47am
Hi Andreas,

Thank you ! Everything is easier now :) 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.102 seconds.