THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/03/2012 at 05:54, xxxxxxxx wrote:
After trying every possible combination of the SplineHelp() functions I'm realy helpless.
My goal is to get the position of the vertexpoints when using the mode adaptive for the spline interpolation.
Getting the vertexcount is easy while using the SplineHelp()-class. But when it comes to the point to calculate their individual positions I stuck.
import c4d
from c4d import utils
from utils import SplineHelp
...
splineHelper = SplineHelp()
splineHelper.InitSpline(myPath,use_deformed_points=True) #myPath is a simple not closed spline
for i in xrange(splineHelper.GetVertexCount(0)) : #0 is the first segment of the spline
vertexM = splineHelper.GetVertexMatrix(i)
splineHelper.FreeSpline()
My used spline has 3 points and 10 vertices.
But iterating this 10 vertices throws an error when reaching the 4th iteration.
Reading the SDK I've found the information, that GetVertexMatrix(index) uses tje line object vertex and not the spline vertex.
But the line object vertex is represented of the spline points.
After that I've tried to convert the vertex-type with SplineHelp.SplineToLineIndex(index).
But this seems to convert in the wrong direction.
0 is converted to 0.
1 is converted to 2.
2 is converted to 9.
Can anyone help me please?
Or does anyone knows a different way to get the position of the spline vertices?
Best regards,
Sven