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

    Crash : SplineData.MakeUserSpline()

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 295 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

      On 17/01/2013 at 12:47, xxxxxxxx wrote:

      hi,

      c4d crashes for me on :

              lmtSpline = c4d.SplineData()
              lmtSpline.MakeUserSpline('1-x',2)
      

      any thoughts on this ?

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

        On 17/01/2013 at 14:11, xxxxxxxx wrote:

        i have done this with other methods now, but MakeUserSpline seems to be pretty broken.
        it crashed on all kind of variations of formula input strings i tried. both plugin and script calls 
        lead to a crash. there are also some quite misleading method descriptions in the python SDK 
        help on  this class.

        1.some of the SetKnot parameters should be flaged as optional, at least this runs without errors for me:

        blgSpline = c4d.SplineData()
        blgSpline.MakePointBuffer(3)
        blgSpline.SetKnot(index = 0, vPos = c4d.Vector(0.0, 1.0, 0.0), vTangentLeft = c4d.Vector(-0.1, 0.0,0), vTangentRight = c4d.Vector(0.1, 0.0,0))
        blgSpline.SetKnot(index = 1, vPos = c4d.Vector(0.5, 0.0, 0.0), vTangentLeft = c4d.Vector(-0.15, 0.0,0), vTangentRight = c4d.Vector(0.15, 0.0,0))
        blgSpline.SetKnot(index = 2, vPos = c4d.Vector(1.0, 1.0, 0.0), vTangentLeft = c4d.Vector(-0.1, 0.0,0), vTangentRight = c4d.Vector(0.1, 0.0,0))
        

        2.InsertKnot(x,y,flags) states that x,y have to be int,  while obviously x,y are supposed to be float.

        3. there should also be stated, that  c4d.SplineData.__init__() does not create an empty spline, 
        but a two point spline (the default point count).

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

          On 18/01/2013 at 02:38, xxxxxxxx wrote:

          Hi Ferdinand,

          Originally posted by xxxxxxxx

          i have done this with other methods now, but MakeUserSpline seems to be pretty broken.
          it crashed on all kind of variations of formula input strings i tried. both plugin and script calls 
          lead to a crash.

          Yes, I can confirm MakeUserSpline() is broken. I'll report this issue.

          Originally posted by xxxxxxxx

          there are also some quite misleading method descriptions in the python SDK 
          help on  this class.

          1.some of the SetKnot parameters should be flaged as optional, at least this runs without errors for me:

          blgSpline = c4d.SplineData()
          blgSpline.MakePointBuffer(3)
          blgSpline.SetKnot(index = 0, vPos = c4d.Vector(0.0, 1.0, 0.0), vTangentLeft = c4d.Vector(-0.1, 0.0,0), vTangentRight = c4d.Vector(0.1, 0.0,0))
          blgSpline.SetKnot(index = 1, vPos = c4d.Vector(0.5, 0.0, 0.0), vTangentLeft = c4d.Vector(-0.15, 0.0,0), vTangentRight = c4d.Vector(0.15, 0.0,0))
          blgSpline.SetKnot(index = 2, vPos = c4d.Vector(1.0, 1.0, 0.0), vTangentLeft = c4d.Vector(-0.1, 0.0,0), vTangentRight = c4d.Vector(0.1, 0.0,0))
          

          Yes, vPos, lFlagsSettings, bSelect, vTangentLeft, vTangentRight and interpol are all optional. I'll mark them as optional in the docs.

          Originally posted by xxxxxxxx

          2.InsertKnot(x,y,flags) states that x,y have to be int,  while obviously x,y are supposed to be float.

          I'll fix this too.

          Originally posted by xxxxxxxx

          3. there should also be stated, that  c4d.SplineData.__init__() does not create an empty spline, 
          but a two point spline (the default point count).

          Yes, SplineData constructor creates a default spline of 2 points at (0, 0, 0) and (1, 0, 0).

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