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

    SplineHelp PrimSplines Segment Error

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 526 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 23/06/2011 at 06:46, xxxxxxxx wrote:

      Let me know what I could miss here.
      Using SplineHelp() on a Primitive splineobject
      (like Text) only segment 0 is possible.
      Calling segment > 0 gets out of range.

      Also, still calling segment 0, going to position 1.0 (100%) the position
      jumps to next segments first position

      Regular splines (Pointobjects with several segments) work as expected.

        
      def main() :   
          segment = 0 # <- If spline is a Prim only segment 0 works   
          posUD = op[c4d.ID_USERDATA,1] # Userdata entry   
          spline = op[c4d.ID_USERDATA,2] # Userdata linkfield   
          if spline is None or spline.GetRealSpline() is None:   
              #print 'No Spline'   
              return False   
          shspline = SplineHelp()   
          rs       = spline.GetRealSpline()   
          # try using rs in SplineHelp.InitSpline and "use_deformed_points" fail   
          # but segments >0 works   
          shspline.InitSpline(spline,c4d.Vector(0.0),None, False,True, False,True)   
          pos      = shspline.GetPos(posUD , segment , True)   
          shspline.FreeSpline()   
          obj = op.GetObject()   
          objm = obj.GetMg()   
          objm.off = pos   
          obj.SetMg(objm)   
      

      Cheers
      Lennart

      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 25/06/2011 at 03:12, xxxxxxxx wrote:

        I can confirm that. The segment exception shouldnt be raised.

        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 25/06/2011 at 06:47, xxxxxxxx wrote:

          Thanks Sebastian for checking and on a week end no less!

          Please let us know when / if it is fixed (If possible).

          May I ask, regarding SplineHelp() vs SplineLengthData()..
          Why do we "need" both? They are a bit "same same but different".

          Is one of them to prefere when using splines?

          Cheers
          Lennart

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