c4d.SplineObject
¶
Cinema 4D gives you a generous number of predefined curves. Add to this the possibility to convert vector based artwork files from other programs and to add graphic characters and you have a large number of spline primitives at your fingertips. All of these spline primitives are parameterized. This means that the spline is merely the graphical representation of a mathematical formula built controlled by parameters you can edit the Attribute Manager.
See also
c4d.
SplineObject
¶
c4d.PointObject
SplineObject.
__init__
(
pcnt
,
type
)
¶
Parameters: |
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||
Returns: |
The new object. |
SplineObject.
GetInterpolationType
(
)
¶
Get the type of spline.
Return type: | int | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
The type of spline. Check out
Spline Types
.
|
SplineObject.
IsClosed
(
)
¶
Checks if spline is closed.
Return type: | bool |
---|---|
Returns: | True if the spline is closed. |
SplineObject.
GetSplinePoint
(
t
[
,
segment=0
]
)
¶
Get the spline point at a position along the given segment.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the
segment
index is out of range :
0<=segment<
|
Return type: | |
Returns: |
The spline point. |
SplineObject.
GetSplineTangent
(
t
[
,
segment=0
]
)
¶
Get the spline tangent at a position along the given segment.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the
segment
index is out of range :
0<=segment<
|
Return type: | |
Returns: |
The spline point. |
SplineObject.
GetSegment
(
id
)
¶
Returns information about the segment:
segment = spline.GetSegment(0) print segment["cnt"], segment["closed"] # int, bool
Parameters: | id ( int ) – The segment. |
---|---|
Raises: |
IndexError
– If the segment index
id
is out of range :
0<=id<
GetSegmentCount()
.
|
Return type: | dict{ cnt : int, closed : bool} |
Returns: | The segment. |
SplineObject.
SetSegment
(
segment
,
cnt
,
closed
)
¶
Set properties of the segment.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the
segment
index is out of range :
0<=segment<
|
SplineObject.
GetSegmentCount
(
)
¶
Returns the count of segments.
Return type: | int |
---|---|
Returns: | The count. |
SplineObject.
ResizeObject
(
pcnt
[
,
scnt=-1
]
)
¶
Change the number of segments and points for this spline. If
scnt
is -1 or not set, the method
PointObject.ResizeObject()
of
PointObject
is used.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
Success of changing the number of points and segments. |
SplineObject.
SetDefaultCoeff
(
)
¶
Initialise the spline with default coefficients.
Return type: | bool |
---|---|
Returns: | True if successful, otherwise False . |
SplineObject.
GetTangentCount
(
)
¶
Returns the count of tangents.
Return type: | int |
---|---|
Returns: | The count. |
SplineObject.
GetTangent
(
id
)
¶
Return a tangent:
tangent = spline.GetTangent() print tangent["vl"], tangent["vr"]
Parameters: | id ( int ) – The tangent index. |
---|---|
Raises: |
IndexError
– If the tangent index
id
is out of range :
0<=segment<
GetTangentCount()
.
|
Return type: |
dict{
vl
:
Vector
,
vr
:
Vector
}
|
Returns: | Left and right part that defines the tangent. |
SplineObject.
SetTangent
(
id
,
vl
,
vr
)
¶
Set a tangent:
spline.SetTangent(index=12, vl=tangent["vl"], vr=tangent["vr"])
Parameters: |
|
---|---|
Raises: |
IndexError – If the tangent index id is out of range. |
Type: SPLINETYPE_LINEAR
![]()
Type: SPLINETYPE_CUBIC
![]()
Type: SPLINETYPE_AKIMA
![]()
Type: SPLINETYPE_BSPLINE
![]()
Type: SPLINETYPE_BEZIER
![]()