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

    First simple plugin with problem

    SDK Help
    0
    7
    689
    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 27/05/2004 at 00:50, xxxxxxxx wrote:

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

      ---------
      Hello to all !!
      Tnx for the yours advices, i have written this simple plugin to make a Cube primitive!! 🙂
      I notice that when i set the fillet on this Cube, it dosen't activate on cube !!
      Where i wrong?
       
      // Plugin ID
      const var PLUGIN_ID = 4444444;
      // Plugin class for creating objects
      class CreateCube extends MenuPlugin
      {
      public:
      CreateCube(); // Constructor
      GetID(); // Get Plugin ID
      GetName(); // Get Plugin Name
      GetHelp(); // Get Plugin Caption
      Execute(doc); // Execute MenuPlugin
      }
      CreateCube::CreateCube() { super(); }
      CreateCube::GetID() { return PLUGIN_ID; }
      CreateCube::GetName() { return "Create Cube Plugin"; }
      CreateCube::GetHelp() { return "Cube Primitive creation"; }
      CreateCube::Execute(doc)
      {
      // Create cube
      var cube = new(CubeObject);
      var ct = cube- >GetContainer();
      ct- >SetData(PRIM_CUBE_LEN, vector(200, 100, 300));
      ct- >SetData(PRIM_CUBE_FILLET, 4);
      ct- >SetData(PRIM_CUBE_SUBF, 4);
      cube- >SetContainer(ct);
      // Insert a Cube object
      doc- >InsertObject(cube, NULL, NULL);
      __
      // Messages
      GeEventAdd(NEW_ACTIVE_OBJECT);
      doc- >Message(MSG_UPDATE);
      doc- >Message(DOCUMENT_CHANGED);
      return TRUE;
      }
      main()
      {
      __
      // Register MenuPlugin
      Register(CreateCube);
      }
       
      Tnx in advance!!

      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 30/05/2004 at 17:25, xxxxxxxx wrote:

        Please use the CODE tags to preserve the formatting of the code better.
        In 8.5 it's best to use the values from the actual resource files, Ocube.h in this case: (You might have to copy these definitions, since not all parts of C.O.F.F.E.E. have been updated for 8.5.)

            
            
            enum  
            {  
             PRIM_CUBE_LEN           = 1100, // VECTOR   - Side Length [>=0.0]  
             PRIM_CUBE_SEP           = 1101, // BOOL    - Seperate Surfaces [only evaluated if no fillet is specified]  
             PRIM_CUBE_SUBX          = 1102, // LONG     - X-Subdivision [>0]  
             PRIM_CUBE_SUBY          = 1103, // LONG     - Y-Subdivision [>0]  
             PRIM_CUBE_SUBZ          = 1104, // LONG     - Z-Subdivision [>0]  
             PRIM_CUBE_FRAD          = 1105, // REAL     - Fillet Radius [>=0.0; <=len.x/2; <=len.y/2; <=len.z/2]  
             PRIM_CUBE_SUBF          = 1106, // LONG     - Fillet Subdivision [>0]  
             PRIM_CUBE_DOFILLET        = 1107 // BOOL     - Enable Fillet  
            };
        

        As you see, you have to set PRIM_CUBE_DOFILLET to TRUE to enable the fillet. And to be picky, the fillet radius should be a real number (4.0), not an integer (4).

        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 31/05/2004 at 00:32, xxxxxxxx wrote:

          Tnx for the answer Mikael ! 🙂

          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 31/05/2004 at 01:06, xxxxxxxx wrote:

            Now work, but i have seen that :
            ct->SetData(PRIM_CUBE_FRAD, 4.0);
            don't  work !!
            This work:
            ct->SetData(PRIM_CUBE_FILLET, 4.0);
            Where i found the correct settings?
            Tnx in advance for the answer!

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

              Hi Mr. Braun,

              I think, what Mikael tried to say is, that you should use the ID values (e.g. 1105 instead of PRIM_CUBE_FRAD) directly, because the C.O.F.F.E.E. documentation isn't up-to-date and most IDs in the Cinema resources are not stored in C.O.F.F.E.E. constants.

              Cheers,
              Marcus

              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 31/05/2004 at 16:33, xxxxxxxx wrote:

                The simplest way is to copy the whole enum-construct into the C.O.F.F.E.E. code. That solves the immediate problem, though you'll have to remove it in the event of the real constants being added to C.O.F.F.E.E. in future versions.

                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 01/06/2004 at 00:36, xxxxxxxx wrote:

                  Tnx for the support !! :))
                  Tnx to all !! :))

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