This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.CCurve

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

class c4d.CCurve

SuperClass

BaseList2D

Methods

CCurve.GetKeyCount()

Returns the count of CKey

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

Get a writeable key by index.

Parameter: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 not found:
    return

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

    Search method:

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

dict

Returns:

Dict with the found key and index, or None.

CCurve.AddKey(time)

Find a writable key by time:

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

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

Insert a key into this curve.

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

Delete a key from this curve.

Parameter: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

This Page