c4d.CTrack
¶
This is the animation track base class. Contains
CCurve
that contain
CKeys
. A
BaseList2D
can host a
CTrack
object. This can be the position, rotation or custom value track. These tracks contain a
CCurve
which contains
CKeys
.
c4d.
CTrack
¶
CTrack.GetTimeTrack()
NEW
CTrack.SetTimeTrack()
NEW
CTrack.Draw()
NEW
CTrack.GetTrackInformation()
NEW
CTrack.SetTrackInformation()
NEW
c4d.BaseList2D
CTrack.
__init__
(
bl
,
id
)
¶
Allocates a track object.
Parameters: |
|
---|
For instance a position track will be allocated like this:
tr=c4d.CTrack(op, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_X, c4d.DTYPE_REAL, 0)))
A track of type int will be allocated like this:
tr=c4d.CTrack(op, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_VISIBILITY_EDITOR, c4d.DTYPE_LONG, 0, )))
For a plugin and special tracks you pass the ID:
tr=c4d.CTrack(op,c4d.DescLevel(ID, ID, 0))
IDs for Cinema 4D’s special tracks are:
CTpla PLA track. CTsound Sound track. CTmorph Morph track. CTtime Time track.
CTrack.
GetDescriptionID
(
)
¶
Retrieve the description ID of this track.
Return type: | c4d.DescID |
---|---|
Returns: | The description ID. |
CTrack.
SetDescriptionID
(
object
,
id
)
¶
Set the description ID of this track.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
CTrack.
GetCurve
(
)
¶
Get a curve of this track.
Return type: | c4d.CCurve |
---|---|
Returns: | The curve of this track. |
CTrack.
GetTrackCategory
(
)
¶
Get a curve of this track.
Return type: | int | ||||||
---|---|---|---|---|---|---|---|
Returns: |
Track category:
|
CTrack.
GetObject
(
)
¶
Get the host object of this track.
Return type: | c4d.BaseList2D |
---|---|
Returns: | The host object or None . |
CTrack.
GetBefore
(
)
¶
Get the pre track loop type of this track.
Return type: | int | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
Loop type:
|
CTrack.
GetAfter
(
)
¶
Get the pre track loop type of this track.
Return type: | int | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
Loop type:
|
CTrack.
SetBefore
(
type
)
¶
Set the pre track loop type of this track.
Parameters: |
type
(
int
) –
Loop type:
|
---|
CTrack.
SetAfter
(
type
)
¶
Set the post track loop type of this track.
Parameters: |
type
(
int
) –
Loop type:
|
---|
CTrack.
FlushData
(
)
¶
Clears the data of the track itself, for example removes time curves, pre/post loop type, etc.
CTrack.
GetValue
(
doc
,
time
[
,
fps
]
)
¶
Retrieve the value of this track at time .
Parameters: |
|
---|---|
Return type: |
float |
Returns: |
The value. |
CTrack.
Remap
(
)
¶
Remaps time .
Parameters: | time ( c4d.BaseTime ) – The time. |
---|---|
Return type: | dict{ ret_time : float, ret_cycle : int} |
Returns: | The output time and cycle or None if time could not be remapped. |
CTrack.
FillKey
(
doc
,
bl
,
key
)
¶
Fills key with default values.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
CTrack.
GetHeight
(
)
¶
Get the height of the track.
Return type: | int |
---|---|
Returns: | The height in pixels. |
CTrack.
GetUnit
(
)
¶
Get the unit and step of the track.
Return type: | tuple(int, float) | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
The unit and the step. The units:
|
CTrack.
GetTLHeight
(
id
)
¶
Get the height of the mini f-curves in the timeline.
Parameters: | id ( int ) – 0-3 for one of the four timelines. |
---|---|
Return type: | int |
Returns: | The height of the mini f-curve in pixels. |
CTrack.
SetTLHeight
(
id
,
size
)
¶
Get the height of the track.
Parameters: |
|
---|
CTrack.
IsSynchronized
(
)
¶
New in version R18.020.
Checks if keys are synchronized with other Component tracks (Vector Track only).
Return type: | bool |
---|---|
Returns: | True if track is synchronized, otherwise False . |
CTrack.
SetSynchronized
(
synch
)
¶
New in version R18.020.
Sets synchronization between component Track (Vector Track only).
Parameters: | synch ( bool ) – True if Track needs to be synchronized, otherwise False . |
---|
CTrack.
GetTimeTrack
(
doc
)
¶
New in version R19.
Returns the time track.
Parameters: | doc ( c4d.documents.BaseDocument ) – The document for the operation. |
---|---|
Return type: | c4d.CTrack |
Returns: | The time track. |
CTrack.
SetTimeTrack
(
track
)
¶
New in version R19.
Sets the time track.
Parameters: | track ( c4d.CTrack ) – The time track to set. |
---|
CTrack.
Draw
(
map
,
clip_left
,
clip_right
)
¶
New in version R19.
Draws the track into a clip map bitmap, if drawing is supported.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the track was drawn, otherwise False . |
CTrack.
GetTrackInformation
(
doc
,
key
)
¶
New in version R19.
Returns the track information at the current time in doc , or at key if specified.
Note
The track information string is displayed in tooltips inside the Timeline for instance.
Parameters: |
|
---|---|
Return type: |
str |
Returns: |
The information string. |
CTrack.
SetTrackInformation
(
doc
,
key
,
info
)
¶
New in version R19.
Sets the track information at the current time in doc , or at key if specified.
Note
The track information string is displayed in tooltips inside the Timeline for instance.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the track information was set, otherwise False . |