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

    GetSplineLength() is failing?

    General Talk
    2
    5
    890
    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.
    • indexofrefractionI
      indexofrefraction
      last edited by

      hi,

      I have this code below and get different results when using
      SplineLengthData / GetLength or SplineHelp / GetSplineLength.

      is there a know reason for this ?

      best, index

      sld = c4d.utils.SplineLengthData()
      sld.Init(path)
      length = sld.GetLength()
      sld.Free()
      # --> length = 114.149518217
      
      sh = c4d.utils.SplineHelp()
      sh.InitSplineWith(path, c4d.SPLINEHELPFLAGS_USERDEFORMERS)
      length = sh.GetSplineLength()
      sh.FreeSpline()
      # --> length = 0.0
      
      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        Could you provide a way to reproduce it?
        I've been trying this with a simple spline i draw with the spline pen. The length are not the same but none return 0.0. (One is the spline length, the other the lineObject representing it)

        Are you using multiple segments?

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • indexofrefractionI
          indexofrefraction
          last edited by indexofrefraction

          hm, i tried to make an example, but now it worked as expected.
          I will post an example, if i run into that again

          ps. no multiple segments

          1 Reply Last reply Reply Quote 0
          • indexofrefractionI
            indexofrefraction
            last edited by

            ... by the way ...
            Do I have to re-init c4d.utils.SplineLengthData or c4d.utils.SplineHelp
            if I insert or change points in a Spline ?
            and ...
            I miss a bit clarity in the documentation. Stupid questions maybe,
            but what is a LineObject, and what are Segments exactly?
            is that documented somewhere?
            The SDK says nothing about such things.
            The Manual neither.

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              Hi,

              Spline Segment are explained in the Cinema 4D documentation

              About the initialisation, if you just move the point that should work but i would recommend to init again SplineLengthData.
              if you add a point, you need to initialize the SplineLengthData again.

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

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