Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Making a basic sphere

    SDK Help
    0
    3
    454
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 12/04/2008 at 20:06, xxxxxxxx wrote:

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

      ---------
      Could someone help me insert a simple sphere into the scene? Here's what I've got, but obviously it's not correct...

      > \> Bool MyMenuPlugin::Execute(BaseDocument \*doc) \> { \>      GePrint("Menu Executed!!"); \>       \>      BaseObject\* obj; \>      obj->Alloc(LONG Onull); \>       \>      Vector hpb = Vector(0,2,4); \>      obj->SetRot(hpb); \>       \>      //GePrint(hpb.x); \>       \>      return TRUE; \> } \>

      Thanks!!

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 12/04/2008 at 20:27, xxxxxxxx wrote:

        You have to call the base classes Alloc() method to allocate an object, tag etc. Then you have to insert it into the document with the documents' Insert() method.

        > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      StopAllThreads(); \> \>      BaseObject \*obj = NULL; \>      obj = BaseObject::Alloc(Osphere); \>      if(!obj) goto Error; \>       \>      if(!obj->MakeTag(Tphong)) goto Error; \> \>      doc->StartUndo(); \> \>      doc->InsertObject(obj, NULL, NULL); \> \>      doc->AddUndo(UNDO_NEW, obj); \> \>      doc->EndUndo(); \> \>      doc->Message(MSG_UPDATE); \> \>      EventAdd(); \> \>      return TRUE; \> \> Error: \>      BaseObject::Free(obj); \>      return FALSE; \> } \>

        cheers,
        Matthias

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 12/04/2008 at 23:05, xxxxxxxx wrote:

          That is awesome, exactly what I needed to get things going. Thanks again!

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