Crash : SplineData.MakeUserSpline()
-
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 ?
-
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). -
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).