SplineData.GetPoint(r) problem

On 10/08/2013 at 04:54, xxxxxxxx wrote:

Hi guys. Another weird issue with me:)

I have a Spline GUI in interface. Once it's loaded it looks like this:

And console spits point position like this:

Point:0 position Vector(0, 1, 0)
Point:1 position Vector(1, 1, 0)

Everything seems to nice and dandy, however, ... Once I manualy add points on that spline:

console seems to be spiting something weird:

Point:0 position Vector(0, 1, 0)
Point:1 position Vector(1, 0, 0)
Point:2 position Vector(1, 0, 0)
Point:3 position Vector(1, 0, 0)
Point:4 position Vector(1, 0, 0)
Point:5 position Vector(1, 0, 0)

Why are all points starting from point 1 are at position 1,0,0? I don't get it.

Here's the code I am using.

  
pointCount = op[SPLINE_SIZE].GetKnotCount()   
print ("Knot count " , pointCount)   
for i in range (0, pointCount) :   
          PointPos = op[SPLINE_SIZE].GetPoint(i)   
          print ("Point:%s position %s " % (i, PointPos))   

On 10/08/2013 at 05:24, xxxxxxxx wrote:

You should not use an index, but a position.

SplineData.GetPoint(r)[](file:///D:/pgrooff/Documents/pim/c4d/Python%20Help%20R14/help/modules/c4d/CustomDataType/SplineData/index.html?highlight=getpoint#SplineData.GetPoint)

Gets a point from its X coordinate.

Parameters: r  (float) – The x position
Return type: [Vector](file:///D:/pgrooff/Documents/pim/c4d/Python%20Help%20R14/help/modules/c4d/Vector/index.html#c4d.Vector)
Returns: The position

_<_t_>_
So for example spline.GetPoint(60.0), get the values for x=60.
I have set the range to 100.

By the way did you set the range correctly?
E.g. self.sd.SetRange(xmin=0, xmax=100, xsteps=1, ymin=0, ymax=100, ysteps=1)

Note: I do not use a .res file to define the SplineControl.

You can check the range using:

sdrange = spline.GetRange()
print sdrange['xmin'], sdrange['xmax'], sdrange['xsteps'], sdrange["ymin"], sdrange["ymax"], sdrange["ysteps"]

On 10/08/2013 at 05:34, xxxxxxxx wrote:

Yes indeed. So I ended up using GeKnots()

  
knots = op[SPLINE_SIZE].GetKnots()   
print knots[I]["vPos"]   

Uhuu :)