PDA

View Full Version : How do I create a Line (spline) with Maxscript?


Guibou
01-26-2009, 07:21 PM
Hi guys, i'm looking for the way to create a line in maxscript. So far, i'm able to create the line with line() but it doesn't have any vertices. Can somebody help me.

Thanks for your time.

Bobo
01-26-2009, 07:36 PM
Hi guys, i'm looking for the way to create a line in maxscript. So far, i'm able to create the line with line() but it doesn't have any vertices. Can somebody help me.

Thanks for your time.

*Open the MAXScript Reference.
*Go to the topic "How do I create a line between two points?"
*See also "How To ... Draw a Freehand Spline"

DaveWortley
01-26-2009, 07:40 PM
When you create a Shape, you need to add a spline


a = line()
addnewspline a

then add a knot (vertex)

SplineShape : ShapeaddKnot <shape> <spline_index_integer> \

( #smooth | #corner | #bezier | #bezierCorner ) \

( #curve | #line ) <position_point3> \

[invec_point3 outvec_point3] \

[where_integer]

Adds a new knot (control point) to the indexed spline and returns an integer reflecting the index of the newly added knot. The 3rd argument specifies the type of the knot, the 4th specifies the type of the segment leaving the knot. The 5th specifies the coordinates for the new point (given in the current working coordinate system). If the knot type is bezier or bezierCorner, you must give the in-vector and out-vector handle coordinates as the 6th and 7th arguments. In the same way as splines are indexed in a shape, knots are indexed in a spline. The optional last argument lets you specify where in the knot order the new knot is to be inserted, defaulting to the end of the spline if you leave this argument off.



Look in the help under "Splineshape : Shape "

Guibou
01-27-2009, 03:03 PM
Thanks for teaching me how to fish Bobo ;)

CGTalk Moderation
01-27-2009, 03:03 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.