c4d.CTrack¶
-
class
c4d.CTrack¶
Parent Class:
Overview¶
Component Synchronization |
|
Checks if keys are synchronized with other Component tracks (Vector Track only). |
|
Sets synchronization between component Track (Vector Track only). |
|
Curve Handling |
|
Get a curve of this track. |
|
Get a curve of this track. |
|
Data Lifecycle |
|
Fills key with default values. |
|
Clears the data of the track itself, for example removes time curves, pre/post loop type, etc. |
|
Description Metadata |
|
Retrieve the description ID of this track. |
|
Set the description ID of this track. |
|
Display Dimensions |
|
Get the height of the track. |
|
Get the height of the mini f-curves in the timeline. |
|
Get the unit and step of the track. |
|
Get the height of the track. |
|
Display Rendering |
|
Draws the track into a clip map bitmap, if drawing is supported. |
|
Evaluation Settings |
|
Gets evaluation mode. |
|
Sets evaluation mode. |
|
Loop Behavior |
|
Get the pre track loop type of this track. |
|
Get the pre track loop type of this track. |
|
Set the post track loop type of this track. |
|
Set the pre track loop type of this track. |
|
Magic Methods |
|
Allocates a track object. |
|
Track Information |
|
Returns the track information at the current time in doc, or at key if specified. |
|
Sets the track information at the current time in doc, or at key if specified. |
|
Track Relationships |
|
Get the host object of this track. |
|
Returns the time track. |
|
Sets the time track. |
|
Value Evaluation |
|
Retrieve the value of this track at time. |
|
Remaps time. |
|
Members¶
Component Synchronization¶
-
CTrack.IsSynchronized(self)¶ Checks if keys are synchronized with other Component tracks (Vector Track only).
New in version R18.020.
- Return type
bool
- Returns
True if track is synchronized, otherwise False.
-
CTrack.SetSynchronized(self, synch)¶ Sets synchronization between component Track (Vector Track only).
New in version R18.020.
- Parameters
synch (bool) – True if Track needs to be synchronized, otherwise False.
Curve Handling¶
-
CTrack.GetCurve(self, type=1, bCreate=True)¶ Get a curve of this track.
- Parameters
type (c4d.BaseList2D) –
The curve type:
CCURVE_CURVE
Standard curve.
CCURVE_HLE_BASE
Internal reduced modification reference curve.
CCURVE_HLE_CURVE
Reduced Modification Curve - Curve.
CCURVE_SS_CURVE
Snapshot 1.
CCURVE_SS_CURVE2
Snapshot 2.
CCURVE_SS_CURVE3
Snapshot 3.
CCURVE_SS_CURVE4
Snapshot 4.
CCURVE_SS_CURVE5
Snapshot 5.
CCURVE_HLE_SCALE
Reduced modification curve - scale.
CCURVE_HLE_MOVE
Reduced modification curve - move.
bCreate (bool) – If True a curve is created if none exists.
- Return type
- Returns
The curve of this track.
-
CTrack.GetTrackCategory(self)¶ Get a curve of this track.
- Return type
int
- Returns
Track category:
CTRACK_CATEGORY_VALUE
Value track.
CTRACK_CATEGORY_DATA
Data track.
CTRACK_CATEGORY_PLUGIN
Plugin track.
Data Lifecycle¶
-
CTrack.FillKey(self, doc, bl, key)¶ Fills key with default values.
- Parameters
doc (c4d.documents.BaseDocument) – The document.
bl (c4d.BaseList2D) – The object of the key to fill.
key (c4d.CKey) – The key to fill.
- Return type
bool
- Returns
True if successful, otherwise False.
-
CTrack.FlushData(self)¶ Clears the data of the track itself, for example removes time curves, pre/post loop type, etc.
Description Metadata¶
-
CTrack.GetDescriptionID(self)¶ Retrieve the description ID of this track.
- Return type
- Returns
The description ID.
-
CTrack.SetDescriptionID(self, object, id)¶ Set the description ID of this track.
- Parameters
object (c4d.BaseList2D) – Object for the new description ID.
id (c4d.DescID) – New description ID.
- Return type
bool
- Returns
True if successful, otherwise False.
Display Dimensions¶
-
CTrack.GetHeight(self)¶ Get the height of the track.
- Return type
int
- Returns
The height in pixels.
-
CTrack.GetTLHeight(self, 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.GetUnit(self)¶ Get the unit and step of the track.
- Return type
Tuple[int, float]
- Returns
The unit and the step. The units:
UNIT_NONE
No units.
UNIT_KM
Kilometer.
UNIT_M
Meter.
UNIT_CM
Centimeter.
UNIT_MM
Millimeter.
UNIT_UM
Micrometer.
UNIT_NM
Nanometer.
UNIT_MILE
Mile.
UNIT_YARD
Yard.
UNIT_FEET
Feet.
UNIT_INCH
Inch.
-
CTrack.SetTLHeight(self, id, size)¶ Get the height of the track.
- Parameters
id (int) – 0-3 for one of the four timelines.
size (int) – The new size of the mini f-curve in pixels.
Display Rendering¶
-
CTrack.Draw(self, map, clip_left, clip_right)¶ Draws the track into a clip map bitmap, if drawing is supported.
New in version R19.
- Parameters
map (c4d.bitmaps.GeClipMap) – The clip map to draw into.
clip_left (c4d.BaseTime) – The left time clipping.
clip_right (c4d.BaseTime) – The right time clipping.
- Return type
bool
- Returns
True if the track was drawn, otherwise False.
Evaluation Settings¶
-
CTrack.GetEvaluationMode(self)¶ Gets evaluation mode.
New in version 24.
- Returns
Interpolation mode.
Symbol ID
Description
R23
Hermite evaluation with some tangent issues.
CURRENT
Spline evaluation.
- Return type
int
-
CTrack.SetEvaluationMode(self, mode)¶ Sets evaluation mode.
New in version 24.
- Parameters
mode (int) –
Interpolation mode.
Symbol ID
Description
R23
Hermite evaluation with some tangent issues.
CURRENT
Spline evaluation.
Loop Behavior¶
-
CTrack.GetAfter(self)¶ Get the pre track loop type of this track.
- Return type
int
- Returns
Loop type:
CLOOP_OFF
No loop.
CLOOP_CONSTANT
Constant.
CLOOP_CONTINUE
Continue.
CLOOP_REPEAT
Repeat.
CLOOP_OFFSETREPEAT
Offset repeat.
CLOOP_OSCILLATE
Oscillate.
CLOOP_LOOP
New in version R24: Loop.
-
CTrack.GetBefore(self)¶ Get the pre track loop type of this track.
- Return type
int
- Returns
Loop type:
CLOOP_OFF
No loop.
CLOOP_CONSTANT
Constant.
CLOOP_CONTINUE
Continue.
CLOOP_REPEAT
Repeat.
CLOOP_OFFSETREPEAT
Offset repeat.
CLOOP_OSCILLATE
Oscillate.
CLOOP_LOOP
New in version R24: Loop.
-
CTrack.SetAfter(self, type)¶ Set the post track loop type of this track.
- Parameters
type (int) –
Loop type:
CLOOP_OFF
No loop.
CLOOP_CONSTANT
Constant.
CLOOP_CONTINUE
Continue.
CLOOP_REPEAT
Repeat.
CLOOP_OFFSETREPEAT
Offset repeat.
CLOOP_OSCILLATE
Oscillate.
CLOOP_LOOP
New in version R24: Loop.
-
CTrack.SetBefore(self, type)¶ Set the pre track loop type of this track.
- Parameters
type (int) –
Loop type:
CLOOP_OFF
No loop.
CLOOP_CONSTANT
Constant.
CLOOP_CONTINUE
Continue.
CLOOP_REPEAT
Repeat.
CLOOP_OFFSETREPEAT
Offset repeat.
CLOOP_OSCILLATE
Oscillate.
CLOOP_LOOP
New in version R24: Loop.
Magic Methods¶
-
CTrack.__init__(self, bl, id)¶ Allocates a track object.
- Parameters
bl (c4d.BaseList2D) – Object to allocate the track for.
id (c4d.DescID) – Description ID to allocate the track for.
For instance a position track will be allocated like this.
descId = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_POSITION, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_X, c4d.DTYPE_REAL, 0)) track = c4d.CTrack(op, descId)
A track of type int will be allocated like this.
descId = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_VISIBILITY_EDITOR, c4d.DTYPE_LONG, 0)) track = c4d.CTrack(op, descId)
For a plugin and special tracks you pass the ID.
tr = c4d.CTrack(op, c4d.DescID(ID, ID, 0))
IDs for Cinema 4D’s special tracks are:
CTpla
PLA.
CT2d
2D Tracks.
CTdoodle
Doodle.
CTmask
mask.
CTsound
Sound.
CTmorph
Morph.
CTtime
Time.
Track Information¶
-
CTrack.GetTrackInformation(self, doc, key)¶ Returns the track information at the current time in doc, or at key if specified.
New in version R19.
Note
The track information string is displayed in tooltips inside the Timeline for instance.
- Parameters
doc (c4d.documents.BaseDocument) – The document for the operation.
key (Optional[c4d.CKey]) – Pass a key to retrieve the track information at, otherwise None to retrieve it at the current time.
- Return type
str
- Returns
The information string.
-
CTrack.SetTrackInformation(self, doc, key, info)¶ Sets the track information at the current time in doc, or at key if specified.
New in version R19.
Note
The track information string is displayed in tooltips inside the Timeline for instance.
- Parameters
doc (c4d.documents.BaseDocument) – The document for the operation.
key (Optional[c4d.CKey]) – Pass a key to set the track information at, otherwise None to set it at the current time.
info (str) – The information string to set.
- Return type
bool
- Returns
True if the track information was set, otherwise False.
Track Relationships¶
-
CTrack.GetObject(self)¶ Get the host object of this track.
- Return type
Optional[c4d.BaseList2D]
- Returns
The host object or None.
-
CTrack.GetTimeTrack(self, doc)¶ Returns the time track.
New in version R19.
- Parameters
doc (c4d.documents.BaseDocument) – The document for the operation.
- Return type
- Returns
The time track.
-
CTrack.SetTimeTrack(self, track)¶ Sets the time track.
New in version R19.
- Parameters
track (c4d.CTrack) – The time track to set.
Value Evaluation¶
-
CTrack.GetValue(self, doc, time, fps)¶ Retrieve the value of this track at time.
- Parameters
doc (c4d.documents.BaseDocument) – The document.
time (c4d.BaseTime) – The time.
fps (int) –
Deprecated since version R17.048: The number of frames per second.
- Return type
float
- Returns
The value.
-
CTrack.Remap(self, time)¶ Remaps time.
- Parameters
time (float) – The input time.
- Return type
Optional[Dict[‘ret_time’: float, ‘ret_cycle’ int]]
- Returns
The output time and cycle, or None if time could not be remapped.