c4d.CCurve
¶
This is the animation curve base class. Belongs to a
CTrack
that contain
CKeys
.
c4d.
CCurve
¶
CCurve.AddKey()
CCurve.AddKeyAdaptTangent()
CCurve.InsertKey()
CCurve.DelKey()
CCurve.MoveKey()
CCurve.FlushKeys()
c4d.BaseList2D
CCurve.
GetKey
(
index
)
¶
Get a writeable key by index.
Parameters: | index ( int ) – Key index. |
---|---|
Raises: |
IndexError
– If key
index
is out of range :
0<=index<
GetKeyCount()
.
|
Return type: | c4d.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: |
|
||||||
---|---|---|---|---|---|---|---|
Return type: |
dict{
key
:
|
||||||
Returns: |
Dict with the found key and index, or None . |
CCurve.
AddKey
(
time
[
,
bUndo=False
,
SynchronizeKeys=False
]
)
¶
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: |
|
---|---|
Return type: |
dict{‘nidx’: int, ‘key’:
|
Returns: |
The added key index and object ( None if it failed). |
CCurve.
AddKeyAdaptTangent
(
time
,
bUndo
[
,
SynchronizeKeys=False
]
)
¶
New in version R18.020.
Add a key to the curve but retain the curve’s current curvature.
Parameters: |
|
---|---|
Return type: |
dict{‘nidx’: int, ‘key’:
|
Returns: |
The added key index and object ( None if it failed). |
CCurve.
InsertKey
(
ckey
[
,
bUndo=False
,
SynchronizeKeys=False
]
)
¶
Insert a key into this curve.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
CCurve.
DelKey
(
index
[
,
bUndo=False
,
SynchronizeKeys=False
]
)
¶
Delete a key from this curve.
Parameters: |
|
---|---|
Raises: |
IndexError
– If key
index
is out of range :
0<=index<
|
Return type: |
bool |
Returns: |
True if successful, otherwise False . |
CCurve.
MoveKey
(
time
,
idx
[
,
seq=None
,
bUndo=False
,
SynchronizeKeys=False
]
)
¶
Move a key in the curve.
Parameters: |
|
---|---|
Raises: |
IndexError
– If key
idx
is out of range :
0<=idx<
|
Return type: |
int |
Returns: |
The new index. |
CCurve.
FlushKeys
(
[
bUndo=False
,
SynchronizeKeys=False
]
)
¶
Remove all keys from this curve.
Parameters: |
|
---|
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: | c4d.CTrack |
---|---|
Returns: | The track of this curve. |
CCurve.
GetValue
(
time
[
,
fps
]
)
¶
Get the value calculated at time , taking into account things like timecurves.
Parameters: |
|
---|---|
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: |
|
---|
CCurve.
GetStartTime
(
)
¶
New in version R19.
Returns the start time of the curve.
Return type: | c4d.BaseTime |
---|---|
Returns: | The start time of the curve. |
CCurve.
GetEndTime
(
)
¶
New in version R19.
Returns the end time of the curve.
Return type: | c4d.BaseTime |
---|---|
Returns: | The end time of the curve. |
CCurve.
FindNextUnmuted
(
index
)
¶
New in version R19.
Returns the next unmuted key.
Parameters: |
index
(
int
) – The key index to start the search from:
0
<=
idx
<
GetKeyCount()
|
---|---|
Return type: |
tuple(
c4d.CKey
, int)
|
Returns: | The next unmuted key and its index, or None if there is no next unmuted key. |
CCurve.
FindPrevUnmuted
(
index
)
¶
New in version R19.
Returns the previous unmuted key.
Parameters: |
index
(
int
) – The key index to start the search from:
0
<=
idx
<
GetKeyCount()
|
---|---|
Return type: |
tuple(
c4d.CKey
, int)
|
Returns: | The previous unmuted key and its index, or None if there is no previous unmuted key. |