THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/07/2011 at 08:40, xxxxxxxx wrote:
Here's an example using the spline class:
import c4d
from c4d import gui
def main() :
myspline = c4d.SplineObject(2,c4d.SPLINETYPE_BEZIER) #Create a 2pt. Bezier spline in memory only
p1 = myspline.GetSplinePoint(0) #Assign the first point to a variable
p2 = myspline.GetSplinePoint(1) #Assign the second point to a variable
myspline.SetPoint(0, c4d.Vector(-100,0,0)) #Place the first point here
myspline.SetPoint(1, c4d.Vector(100,0,0)) #Place the second point here
myspline.Message(c4d.MSG_UPDATE) #Should do this any time an object's points are changed
doc.InsertObject(myspline) #Insert it into the Object Manager from memory
c4d.EventAdd() #Update C4D about the changes
if __name__=='__main__':
main()
From here.
You can use the SplineData, SplineHelper, SplineLengthData classes on it to manipulate the points, segments, tangents.
-ScottA