c4d.SplineData

Spline data type (CUSTOMDATATYPE_SPLINE) for the SplineCustomGui GUI

This type is called by value.

Inheritance

Members

SplineData.__init__([v])
Parameters: v (SplineData) – Source spline data for copy constructor.
Return type: SplineData
Returns: The spline data instance.
SplineData.SelectAll()

Selects all points.

SplineData.Flip()

Flips the spline.

SplineData.Mirror()

Mirrors the spline.

SplineData.SetRound(r)

Set the tension.

Parameters: r (float) – The tension
SplineData.GetRound()

Gets the tension.

Return type: float
Returns: Tension.

Warning

This method is only available in R12 and always returns 0.0 in R13.

SplineData.Maximum()

Makes all Y coordinates less than or equal to 1.

SplineData.Minimum()

Makes all Y coordinates greater than or equal to 0.

SplineData.SetZero(bY, bAll)

New in version R13.029.

Sets the tangents of selected knots to zero.

Parameters:
  • bY (bool) – True to set the tangets’ Y coordinate to zero, False to set the X coordinate.
  • bAll (bool) – True to set all tangents, False to set the tangents of selected knots only.
Return type:

bool

Returns:

True if successful, otherwise False.

SplineData.InitDefaultFlag(flag)

New in version R13.029.

Sets the knot flag for selected knots.

Parameters: flag (int) –

A combination of these flags:

FLAG_KNOT_T_BREAK Breakes knot tangents.
FLAG_KNOT_LOCK_X Locks knot’s X movement.
FLAG_KNOT_LOCK_Y Locks knot’s Y movement.
FLAG_KNOT_T_LOCK_A Locks knot’s tangent angle.
FLAG_KNOT_T_LOCK_L Locks knot’s tangent length.
FLAG_KNOT_T_KEEPVISUALANGLE Keeps visual angle between knot’s tangents.
ADD_KNOT_ADAPT_TANGENTS Tangents of new knots are set in such a way that the resulting spline will match the curvature of the original spline.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.DeleteAllPoints()

Deletes all points.

SplineData.MakePointBuffer([lPoints=-1])

New in version R13.029.

Makes an uninitialized spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeLinearSplineLinear([lPoints=-1])

New in version R13.029.

Makes a linear spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeLinearSplineBezier([lPoints=-1])

New in version R13.029.

Makes a linear bezier spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeSquareSpline([lPoints=-1])

New in version R13.029.

Makes a square spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeCubicSpline([lPoints=-1])

New in version R13.029.

Makes a cubic spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeRootSpline([lPoints=-1])

New in version R13.029.

Makes a root spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeInversSpline([lPoints=-1])

New in version R13.029.

Makes an inverse spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeSinSpline([lPoints=-1])

New in version R13.029.

Makes a sinus spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeAbsCosSpline([lPoints=-1])

New in version R13.029.

Makes an absolute cosinus spline with lPoints number of points.

Parameters: lPoints (int) – Number of points, or -1 to get the default value.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.MakeUserSpline(str[, lPoints=-1])

New in version R13.029.

Makes a user spline from str with lPoints number of points.

Parameters:
  • str (str) – User spline string. Any valid formula can be used.
  • lPoints (int) – Number of points, or -1 to get the default value.
Return type:

bool

Returns:

True if successful, otherwise False.

SplineData.DeleteKnot(a)

Deletes a knot.

Parameters: a (int) – The knot index to delete.
Return type: bool
Returns: True if successful, otherwise False.
SplineData.InsertKnot(x, y, flags=0)

Inserts a knot.

Parameters:
  • x (int) – X coordinate
  • y (int) – Y coordinate
  • flags (int) –
    SPLINE_KNOT_FLAG_NO_HORIZ_MOVE Don’t allow the knot to move horizontally.
    SPLINE_KNOT_FLAG_NO_VERT_MOVE Don’t allow the knot to move vertically.
Return type:

int

Returns:

Knot index.

SplineData.GetKnots()

Returns all knots.

Return type: list of dict{vPos: Vector, lFlagsSettings: int, bSelect: bool, vTangentLeft: Vector, vTangentRight: Vector, interpol: bool}
Returns: A list of dictionaries with information about the knot.
SplineData.SetKnot(index, vPos, lFlagsSettings, bSelect, vTangentLeft, vTangentRight, interpol)

New in version R13.029.

Sets knot properties.

Parameters:
  • index (int) – The knot index.
  • vPos (Vector) – Knot position.
  • lFlagsSettings (int) –

    Contains knot flags:

    SPLINE_KNOT_FLAG_NO_HORIZ_MOVE Don’t allow the knot to move horizontally.
    SPLINE_KNOT_FLAG_NO_VERT_MOVE Don’t allow the knot to move vertically.

    Also contains the point index ID. The ID can be accessed using these functions:

    def SplineKnotGetID(flags):
        return ((flags >> 16) & 0x0000ffff)
    
    def SplineKnotSetID(flags, flag_id):
        (flags = (flags & 65535) | ((flag_id & 0x0000ffff) << 16))

    Important

    This means that the flags must only be accessed using `|=` and `&=` (a good advice for any set of flags, for maximum forward compatibility).

  • bSelect (bool) – Internal select state. Don’t change this.
  • vTangentLeft
  • vTangentRight
  • interpol
Raises RangeError:
 

If knot index is out of range.

SplineData.GetPoint(r)

Gets a point from its X coordinate.

Parameters: r (float) – The x position
Return type: Vector
Returns: The position
SplineData.GetSelectedCount()

Returns the count of knots which are selected.

Return type: int
Returns: The count
SplineData.GetKnotCount()

Gets the knot count.

Return type: int
Returns: Knot count.
SplineData.GetRange()

Gets the range of the spline:

def PrintRange(sd):
    sdrange = sd.GetRange()
    if not range: return

    print sdrange["xmin"], sdrange["xmax"], sdrange["xstep"], sdrange["ymin"], sdrange["ymax"], sdrange["ystep"]
Return type: dict{xmin: float, xmax: float, xstep: float, ymin: float, ymax: float, ystep: float}
Returns: Returns the range or None.
SplineData.SortKnots()

Sort the knots.

Return type: int
Returns: The new index of the active knot.
SplineData.SetRange(xmin, xmax, xsteps, ymin, ymax, ysteps)

Set the range of the spline.

Parameters:
  • xmin (float) – The X min range.
  • xmax (float) – The X max range.
  • xsteps (float) – The X steps.
  • ymin (float) – The Y min range.
  • ymax (float) – The Y max range.
  • ysteps (float) – The Y steps.
SplineData.AdaptRange(xmin, xmax, xsteps, ymin, ymax, ysteps)

New in version R13.029.

Adapts the internal 0-1 range of the old spline GUI to the range set by xmin, xmax, ymin and ymax.

Parameters:
  • xmin (float) – The new X minimum.
  • xmax (float) – The new X maximum.
  • xsteps (float) – The new X step size.
  • ymin (float) – The new Y minimum.
  • ymax (float) – The new Y maximum.
  • ysteps (float) – The new Y step size.

Table Of Contents