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

    Create a polyobject using C.O.F.F.E.E.

    SDK Help
    0
    2
    302
    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/05/2003 at 17:46, xxxxxxxx wrote:

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

      ---------
      Hello everybody.
      Could someone gifted please help me expand this codesnippet to show me how to add new points and polygons to an object?
      I have put a simple C.O.F.F.E.E tag on a null object.
      I got this code from peranders.com so a great thanx to him to begin with.
      main(doc,op)
      {
      if (op->GetDown()) return FALSE;
      var childop=new(PolygonObject);
      **
      childop- >InsertUnder(op); ****
      }**
      **** 
      I have read the "Simple Poygon Problem" thread by Newbee but I didn't understand enough of it. I cannot find the alloc function talked about in that thread in the C.O.F.F.E.E. SDK.
       
      Regards / Feccand

      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/05/2003 at 18:47, xxxxxxxx wrote:

        Hi Feccand

        I'm also a coffee-newbie but may this code can help you:
        **********

        var newObject = new(PolygonObject);

        var variableChanged = new(VariableChanged);
        var backupTags = new(BackupTags);

        var totalpoints = 8; // change this value to you desired pointcount

        backupTags->Init(newObject);
        variableChanged->Init(0, totalpoints);

        if (!newObject->Message(MSG_POINTS_CHANGED, variableChanged))
        {
             backupTags->Restore();
             return FALSE;
        }

        var totalpolys = 6; // change this value to you desired polygoncount

        backupTags->Init(newObject);
        variableChanged->Init(0, totalpolys);

        if (!newObject->Message(MSG_POLYGONS_CHANGED, variableChanged))
        {
             backupTags->Restore();
             return FALSE;
        }

        newObject->Message(MSG_UPDATE);

        doc->InsertObject(newObject, NULL, NULL);

        **********

        cya

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