Hi,
the API of the SplineObject seems to suggest, one could have a spline with the open and closed segments (as one can set the closed flag on a per segment basis in SplineObject.SetSegment()). But I simply can't get it to work.
Basically I'm doing something like the following, always ending up with all open segments:
import c4d
def main():
spline = c4d.SplineObject(6, c4d.SPLINETYPE_LINEAR)
spline.ResizeObject(7, 2)
spline.SetPoint(0, c4d.Vector(0.0, 0.0, 100.0))
spline.SetPoint(1, c4d.Vector(100.0, 0.0, 100.0))
spline.SetPoint(2, c4d.Vector(100.0, 100.0, 100.0))
spline.SetSegment(0, 3, True)
spline.SetPoint(3, c4d.Vector(0.0, 0.0, 200.0))
spline.SetPoint(4, c4d.Vector(100.0, 0.0, 200.0))
spline.SetPoint(5, c4d.Vector(100.0, 100.0, 200.0))
spline.SetSegment(1, 3, False)
spline.Message(c4d.MSG_UPDATE)
doc.InsertObject(spline)
c4d.EventAdd()
if __name__=='__main__':
main()
Playing around with the Spline Pen, I'm somewhat afraid, this feature of the API is not working at all, as the Pen starts working with two spline objects as soon as a segment of the other "openess" gets involved.
Not urgent at all, I can work with the obvious workaround of multiple splines.
While writing this, I took a look at the C++ API and now, I'm pretty sure, I can answer the question myself already. In C++ such option does not seem to exist. Strangely so, this additional "closed" parameter in Python is not even optional.
So, it's maybe more a request for a documentation fix than a real question.
Cheers,
Andreas