c4d.SplineData
¶
Spline data type (
CUSTOMDATATYPE_SPLINE
) for the
SplineCustomGui
GUI
This type is called by value.
c4d.
SplineData
¶
SplineData.MakeLinearSplineLinear()
SplineData.MakeLinearSplineBezier()
SplineData.MakeSquareSpline()
SplineData.MakeCubicSpline()
SplineData.MakeRootSpline()
SplineData.MakeInversSpline()
SplineData.MakeSinSpline()
SplineData.MakeAbsCosSpline()
SplineData.MakeUserSpline()
SplineData.SelectAll()
SplineData.Flip()
SplineData.Mirror()
SplineData.Maximum()
SplineData.Minimum()
c4d.CustomDataType
SplineData.
__init__
(
[
v
]
)
¶
Creates a default 2 points spline.
Parameters: | v ( c4d.SplineData ) – Source spline data for copy constructor. |
---|---|
Return type: | c4d.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
)
¶
Sets the tangents of selected knots to zero.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
SplineData.
InitDefaultFlag
(
flag
)
¶
Sets the knot flag for selected knots.
Parameters: |
flag
(
int
) –
A combination of these flags:
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | bool | ||||||||||||||
Returns: | True if successful, otherwise False . |
SplineData.
DeleteAllPoints
(
)
¶
Deletes all points.
SplineData.
MakePointBuffer
(
[
lPoints=-1
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
]
)
¶
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
)
¶
Makes a user spline from str with lPoints number of points.
Parameters: |
|
---|---|
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: |
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
: int}
|
---|---|
Returns: | A list of dictionaries with information about the knot. |
SplineData.
SetKnot
(
index[, vPos][, lFlagsSettings][, bSelect=False][, vTangentLeft][, vTangentRight][, interpol=CustomSplineKnotInterpolationBezier]
)
¶
Sets knot properties.
Parameters: |
|
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Raises: |
RangeError
– If the knot
index
is out of range :
0<=index<
|
SplineData.
GetPoint
(
r
)
¶
Gets a point from its X coordinate.
Parameters: | r ( float ) – The x position |
---|---|
Return type: | c4d.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: | The range dictionary 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: |
|
---|
SplineData.
AdaptRange
(
xmin
,
xmax
,
xsteps
,
ymin
,
ymax
,
ysteps
)
¶
Adapts the internal 0-1 range of the old spline GUI to the range set by xmin , xmax , ymin and ymax .
Parameters: |
|
---|
SplineData.
CopyTo
(
pDest
)
¶
New in version R14.014.
Copies this spline data values into the destination spline data.
Parameters: | pDest ( c4d.SplineData ) – The destination spline data. |
---|---|
Return type: | bool |
Returns: | True if successful, otherwise False . |