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
    • Recent
    • Tags
    • Users
    • Login

    How can I create segments for a SplineObject

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 335 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 11/02/2010 at 13:16, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   r11 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi there,

      i need some hint how i can create segments for a spline object. i already know how to create a spline (with a single segment), and in the help file i can only find commands to get the segment sount and such stuff, but i cannot fine something to create segments.

      any help is welcome.

      cheers and thanks,
      ello

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 12/02/2010 at 01:33, xxxxxxxx wrote:

        SplineObject::ResizeObject() allows you to change the segment count.
        SplineObject::GetSegmentW() return the writeable array of segments to set how many points per segment.

        Also have a look at VariableChanged structure and the MSG_SEGMENTS_CHANGED message for a more low-level approach.

        here an example which creates a spline with two segments.

          
        SplineObject *spline = NULL;  
        spline = SplineObject::Alloc(0, Tlinear);  
        if (!spline) return FALSE;  
          
        spline->ResizeObject(4, 2);  
          
        Segment *seg = spline->GetSegmentW();  
        seg[0].cnt = 2;  
        seg[1].cnt = 2;  
          
        Vector *points = spline->GetPointW();  
          
        points[0] = Vector(0,0,0);  
        points[1] = Vector(0,100,0);  
        points[2] = Vector(0,200,0);  
        points[3] = Vector(0,300,0);  
        

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 12/02/2010 at 02:39, xxxxxxxx wrote:

          thank you very much. this helps a lot

          best regards,
          ello

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