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

    Unable to create primitives

    SDK Help
    0
    9
    698
    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 20/11/2003 at 07:56, xxxxxxxx wrote:

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

      ---------
      I am having some serious COFFEE blues in version 8.2. I am unable to create PrimitiveObjects. The problem in its simplest form:

      Insert the following lines into the Execute method of the MenuPlugin stub supplied with the SDK:

      var x = new(PrimitiveObject);
      x->SetPrimitiveType(PRIMITIVE_CUBE); // fails here, x is NIL

      x is NIL everytime. There is no other code in the example besides the minimum MenuPlugin overrides. COFFEE is not failing completely as I am able to create NullObjects or BooleObjects, for example. Can anyone create a PrimitiveObject? I'm freaked out!!

      PS. Even in a COFFEE Expression Tag, the same 2 lines of code will fail... but I am able to create primitives thru the GUI : (

      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 21/11/2003 at 07:40, xxxxxxxx wrote:

        Starting with Version 8 you need to directly name the objects (instead of PrimitiveObject which no longer exists) - here's the complete list:
        FFDObject
        BezierObject
        CameraObject
        FloorObject
        SkyObject
        EnvironmentObject
        ForegroundObject
        BackgroundObject
        ConPlaneObject
        LoftObject
        ExtrudeObject
        HyperNURBSObject
        LatheObject
        SweepObject
        BoneObject
        MetaballObject
        InstanceObject
        ParticleObject
        DeflectorObject
        GravitationObject
        RotationObject
        WindObject
        FrictionObject
        TurbulenceObject
        AttractorObject
        DestructorObject
        ExplosionObject
        WindDeformObject
        FormulaObject
        ShatterObject
        MeltObject
        BooleObject
        WrapObject
        BendObject
        BulgeObject
        ShearObject
        TaperObject
        TwistObject
        StageObject
        MicrophoneObject
        LoudspeakerObject
        HeadphoneObject
        NullObject
        CubeObject
        SphereObject
        PlatonicObject
        ConeObject
        TorusObject
        DiscObject
        TubeObject
        FigureObject
        PyramidObject
        PlaneObject
        FractalObject
        CylinderObject
        CapsuleObject
        OiltankObject
        ReliefObject
        SinglePolyObject
        SplineFormulaObject
        SplineTextObject
        SplineNSideObject
        Spline4SideObject
        SplineCircleObject
        SplineArcObject
        SplineCissoidObject
        SplineCycloidObject
        SplineProfileObject
        SplineHelixObject
        SplineRectangleObject
        SplineFlowerObject
        SplineStarObject
        SplineCogwheelObject
        SplineContourObject
        SymmetryObject
        ArrayObject

        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 21/11/2003 at 08:42, xxxxxxxx wrote:

          Using the SDK PrimitiveObject example, I replaced PRIMITIVE_CUBE with CubeObject and it still does not work.  What needs to be changed with this example to make it work?
          // 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);

          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 21/11/2003 at 09:14, xxxxxxxx wrote:

            Nono...
            var cube = new(CubeObject);
            There is no SetPrimitiveType anymore!

            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 21/11/2003 at 09:29, xxxxxxxx wrote:

              This gives a syntax error at line 2 row 16.
               
              // 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);

              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 21/11/2003 at 09:34, xxxxxxxx wrote:

                You're sure you're using version 8? Your code definitely works...

                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 21/11/2003 at 09:43, xxxxxxxx wrote:

                  Yes, I am using V8.207.  I have inserted a null object and and a coffee expression tag.  Placing this code in and compiling and executing produces no errors but does not create a cube.  If I save this code as a COF file I get a (4) Too few parameters error.
                  main(doc,op)
                  {
                  // 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);
                  }

                  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 21/11/2003 at 14:06, xxxxxxxx wrote:

                    You've forgotten to insert the object into the document
                    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 21/11/2003 at 14:33, xxxxxxxx wrote:

                      That worked!
                      Thank you.

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