c4d.CCurve

This is the animation curve base class. Belongs to a CTrack that contain CKeys.

Inheritance

Members

CCurve.GetKeyCount()

Returns the count of CKey

Return type: int
Returns: The count.
CCurve.GetKey(index)

Get a writeable key by index.

Parameters: index (int) – Key index, 0 <= index < GetKeyCount().
Raises IndexError:
  Raise if key index is out of range.
Return type: CKey
Returns: The key found, or None.
CCurve.FindKey(time[, match=FINDANIM_EXACT])

Find a writable key by time:

found = curve.FindKey(time)
if found==None: return

key = found["key"] #The found key
index = found["idx"] #The index of the found key
Parameters:
  • time (BaseTime) – A time.
  • match (int) –

    Search method:

    FINDANIM_EXACT Exact.
    FINDANIM_LEFT Search left.
    FINDANIM_RIGHT Search right.
Return type:

dict{key: CKey, int: int}

Returns:

Dict with the found key and index, or None.

CCurve.AddKey(time)

Find a writable key by time:

added = curve.AddKey(time)
if added==None: return

key = found["key"] #The found key
index = found["nidx"] #The index of the found key
Parameters: time (BaseTime) – The time to add the key at.
Return type: dict{key: CKey, int: int}
Returns: Dict with the found key and index, or None.
CCurve.InsertKey(ckey)

Insert a key into this curve.

Parameters: ckey (CKey) – The key to insert.
Return type: bool
Returns: True if successful, otherwise False.
CCurve.DelKey(index)

Delete a key from this curve.

Parameters: index (int) – The index of the key to delete, 0 <= index < GetKeyCount().
Raises IndexError:
  Raise if key index is out of range.
Return type: bool
Returns: True if successful, otherwise False.
CCurve.MoveKey(time idx[, dseq=None])

Move a key in the curve.

Parameters:
  • time (BaseTime) – The new time.
  • idx (int) – The index of the key to move, 0 <= index < GetKeyCount().
  • dseq (CCurve) – Optional destination curve.
Raises IndexError:
 

Raise if key index is out of range.

Return type:

int

Returns:

The new index.

CCurve.FlushKeys()

Remove all keys from this curve.

CCurve.SortKeysByTime()

Private. Should not be used.

CCurve.SetKeyDirty()

Set keys to dirty. Equivalent to SetDirty(DIRTY_CHILDREN).

CCurve.GetTrack()

Get the track of this curve.

Return type: CTrack
Returns: The track of this curve.
CCurve.GetValue(time, fps)

Get the value calculated at time, taking into account things like timecurves.

Parameters:
  • time (BaseTime) – The time to calculate the value at.
  • fps (int) – The number of frames per second.
Return type:

float

Returns:

The calculated value.

CCurve.SetKeyDefault(doc, kidx)

Set the defaults for key kidx for the curve. This includes lock, mute, clamp, break, auto properties, interpolation and tangents. This way you can set up a value and complete the missing properties with the defaults.

Parameters:
  • doc (BaseDocument) – The curve’s document.
  • kidx (int) – The key index.

Table Of Contents