Has COFFEE changed from SDK 6 to SDK 8



  • 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_>_



  • 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);



  • 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.



  • 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.


Log in to reply