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
    • Register
    • Login

    UniformTonatural on PrimitiveSplines?

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 199 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 09/09/2005 at 17:02, xxxxxxxx wrote:

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

      ---------
      A problem that makes me go round in circles.
      To get an even movement on a regular spline I use "UniformTonatural" option.
      It works fine like this:
      <CODE>var type1 = OBJ1->GetType();
      // Is Spline
      if ( type1 == 5101)    
      {
      println("OBJ1 Is Spline");
      OBJ1->InitLength(0 );
      var spos1 = OBJ1->GetSplinePoint(OBJ1->UniformTonatural(POS1) , 0);

      op->SetPosition(OBJ1->GetMg()->GetMulP(spos1));
      OBJ1->FreeLength();

      }
      else
      </CODE>

      I can not for the life of me get the same thing to happen when using a PrimitiveSpline,
      like Rectangle, Cogwheel etc.
      The same principle as with a regular spline doesn't seem to apply. I got it working with the default function, that is, it moves slow in the corners and fast on straighter parts.
      Like this(InitLength and FreeLength are commented here).

      <CODE>/// Is Primitive Spline
      if ((type1>5174 && type1<5190))
      {
      println("OBJ1 Is PrimitiveSpline");
      //OBJ1->GetSplineObject()->InitLength(0);

      var spos1 = OBJ1->GetSplineObject()->GetSplinePoint(POS1 ,0); // <<How to implement UniformTonatural here??
      op->SetPosition(OBJ1->GetMg()->GetMulP(spos1));
      //OBJ1->GetSplineObject()->FreeLength();
      }
      else</CODE>
      I've tried all possible settings and combination based on the previous example I can think of, but no go....
      Any input is most welcome.

      Cheers
      Lennart

      PS UniformTonatural doesn't get spelled correctly when posting it.
      It is spelled correct in my code with a big "N". DS

      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 10/09/2005 at 13:53, xxxxxxxx wrote:

        Not to make another cliffhanger with no answer/solution, I got this working with the help of mdme_Sadie and JDP over at CGTalk.
        //////
        var myspline=OBJ1->GetSplineObject();
        if (!myspline) return FALSE;

        if (!myspline->InitLength(0)) return FALSE;

        var pos=myspline->GetSplinePoint(0.5,0);
        /////
        as well as:
        //////
        var op = OBJ1->GetSplineObject();
        op->InitLength(0);
        ///////

        Cheers
        Lennart

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