On 09/08/2013 at 12:49, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Something like copy original GUI, scale it by factor X, paste that to new GUI. No?
That is exactly what I did suggest in my first posting. The only difference is that you cannot scale the SplineData as an object, but you have to do it per point/tangent. Read the Sdk, there are some inconsistencies in the SplineData documentation, but the relevant information is there. The method for your task should be SetKnot for overwriting the SplineKnots and GetKnots to get the existing knot data. Here is a snippet on how to write knots into a SplineData instance:
rampSpl, rmpCount = c4d.SplineData(), 7
rampSpl.MakePointBuffer(rmpCount)
step = 1.0/ (rmpCount-1)
for i in xrange(rmpCount) :
if i == 0:
rampSpl.SetKnot(index = i, vPos = c4d.Vector(i * step, (i * step) ** 5, 0), interpol = 1)
elif i >= rmpCount-2:
rampSpl.SetKnot(index = i, vPos = c4d.Vector(i * step, (i * step) ** 5, 0), interpol = 1)
else:
rampSpl.SetKnot(index = i, vPos = c4d.Vector(i * step, (i * step) ** 5, 0), interpol = 2)