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

    Has COFFEE changed from SDK 6 to SDK 8

    SDK Help
    0
    4
    335
    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 10/03/2004 at 04:32, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.500 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,
      I am starting out writing my first plugin for C4D and am frustrated over the differences between C4D Rel 8.5 and 6. I wote a small test plugin which works perfectly with C4D 6 but fails for C4D 8.5. I expected it work as I cut and pasted it from the reference manual!
      The " cube->SetPrimitiveType(PRIMITIVE_CUBE);" statement fails under 8.5 generating the error message "(5) Incomptible values ... NIL / Object". I am guessing the "new" function on the previous line failed.
      Can someone help me to get this to work under 8.5 please?
      The full code is:
      _

          
          
          _
          
          
          
          
           class MyMenuPlugin : MenuPlugin  
          {  
          public:    
           MyMenuPlugin();      
           GetID();    
           GetName();    
           GetHelp();    
           Execute(doc);  
           }  
          MyMenuPlugin::MyMenuPlugin() { super(); }  
          MyMenuPlugin::GetID()              { return 1234123; } // Temp  
          MyMenuPlugin::GetName()         { return "C.O.F.F.E.E. Test"; }  
          MyMenuPlugin::GetHelp()           { return "C.O.F.F.E.E. Dummy Plugin"; }
          
          
          
          
          MyMenuPlugin::Execute(doc)  
          {    
           var doc = GetActiveDocument();  //get the active document
          
          
          
          
           // create a cube using code from on-line reference manual  
           // PrimitiveObject example  
             
           // Creates a cube that's 200x100x300  
           var cube = new(PrimitiveObject);  
           cube->SetPrimitiveType(PRIMITIVE_CUBE);
          
          
          
          
           var bc = cube->GetContainer();  
           bc->SetData(PRIM_CUBE_LEN, vector(200, 100, 300));  
           cube->SetContainer(bc);  
             
              doc->InsertObject(cube,NULL,NULL);   // now put cube into the document  
          }
          
          
          
          
          main() {  Register(MyMenuPlugin);}
          
          
          
          
          _
      

      _
      many thanks
      Richard <SCRIPT language=javascript>postamble();_<_Script_>_

      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 10/03/2004 at 07:35, xxxxxxxx wrote:

        Oh, that got me too. Its very annoying with the SDK documentation. The way to add a primitive cube is like this:

        // Creates a cube that's 200x100x300
        var cube = new(CubeObject);
        var bc = cube->getcontainer();
        bc->SetData(PRIM_CUBE_LEN, vector(200, 100, 300));
        cube->SetContainer(bc);
        doc->InsertObject(cube,NULL,NULL);

        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 10/03/2004 at 09:24, xxxxxxxx wrote:

          That's great! This "new(CubeObject)" way of creating the cube works perfectly. Now, I will need to reread the SDK with new eyes!
          I had to add
              GeEventAdd(DOCUMENT_CHANGED);
              GeEventAdd(REDRAW_ALL);
          to my code to be able to see the cube.
          Very happy - 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 11/03/2004 at 15:26, xxxxxxxx wrote:

            I'm glad that you found the solution. As you've noticed the C.O.F.F.E.E. docs are currently for R6. The reason for this is mostly that besides the things you noticed there haven't been many changes to C.O.F.F.E.E. in R8.

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