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

    How to draw/modify a spline in COFFEE?

    SDK Help
    0
    5
    394
    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 12/05/2007 at 04:32, xxxxxxxx wrote:

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

      ---------
          Hello
      I'm trying to modify an existing linear spline by its coffee tag. This is how far I got:

        
      main(doc,Kurve) {  
      //Number of Spline points  
      var Punkte = 10;  
      // pointer to Container of Kurve  
      var KC = Kurve->GetContainer();  
        
      // fill array with canned data  
      var KPunkt = new (array,3,Punkte);  
      var k,j;  
        
      for (j=0; j<Punkte; j++){  
          for (k=0; k<3; k++){  
              KPunkt [k][j] = k + j + k*j;  
          }  
      }  
      // put points into Container  
      KC->SetData(116,Punkte);  
      }
      

      Now how can I get the KPunkt array to adding points to the actual spline, redefining and drawing it?

      Thanks for any help,
      Wind

      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 12/05/2007 at 07:03, xxxxxxxx wrote:

        A Spline is an object - a SplineObject derived from PointObject. To modify the points, you should get the vector point array from it and modify the array elements.

        It gets even more fun if you need to change the number of points. This requires VariableChanged (see the COFFEE docs - with examples).

        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 14/05/2007 at 06:16, xxxxxxxx wrote:

          Changing the structure of the geometry (pointcount,polygoncount) is not allowed in a COFFEE tag. To do stuff like this you have to use the C++ API.

          To change the points positions you have to use the GetPoints and SetPoints member functions of the PointObject class. There is an example in the COFFEE docu.

          cheers,
          Matthias

          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 14/05/2007 at 10:27, xxxxxxxx wrote:

            You're no fun... 😉

            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 14/05/2007 at 16:37, xxxxxxxx wrote:

              hi,

              Windreaper did you already find the 'subspline' expression in the content browser?
              This might give you a better idea how to go about it: by referencing.

              hth, frank

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