Hi Johan, thanks for reaching out us.
With regard to your request, I warmly suggest to have a look at:
A first attempt to make it work should look like this:
import c4d
def DoRecursion(op, index):
tp = op.GetDeformCache()
if tp is not None:
DoRecursion(tp, index)
else:
tp = op.GetCache()
if tp is not None:
DoRecursion(tp, index)
else:
if not op.GetBit(c4d.BIT_CONTROLOBJECT):
if op.IsInstanceOf(c4d.Opoint):
for i in index:
print "\t\t", op.GetAllPoints()[i]
tp = op.GetDown()
while tp is not None:
DoRecursion(tp, index)
tp = tp.GetNext()
# Main function
def main():
# get the real spline representation
realSpline = op.GetRealSpline()
if realSpline is None:
return
# allocate a SplineHelp instance and init it with the real spline
splineH = c4d.utils.SplineHelp()
splineH.InitSplineWith(realSpline)
# get the spline points and store its length
splinePnts = realSpline.GetAllPoints()
splinePntsCnt = len(splinePnts)
# allocate a list to store the correspondance between the spline points and the one belonging to its line representation
pntIndxInLine = []
for i in xrange(splinePntsCnt):
pntIndxInLine.append(splineH.GetPointIndex(i, 0)/splinePntsCnt)
# recurse over the geometry to look for its cache
DoRecursion(op, pntIndxInLine)
# free the SplineHelp instance
splineH.FreeSpline()
# Execute main()
if __name__=='__main__':
main()
Best, Riccardo