Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/fcurve.c
| Show First 20 Lines • Show All 912 Lines • ▼ Show 20 Lines | void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt) | ||||
| * then the unit tests would break in debug mode. */ | * then the unit tests would break in debug mode. */ | ||||
| ptrdiff_t offset = active_bezt - fcu->bezt; | ptrdiff_t offset = active_bezt - fcu->bezt; | ||||
| if (offset < 0 || offset >= fcu->totvert) { | if (offset < 0 || offset >= fcu->totvert) { | ||||
| fcu->active_keyframe_index = FCURVE_ACTIVE_KEYFRAME_NONE; | fcu->active_keyframe_index = FCURVE_ACTIVE_KEYFRAME_NONE; | ||||
| return; | return; | ||||
| } | } | ||||
| /* The active keyframe should always be selected. */ | /* The active keyframe should always be selected. */ | ||||
| BLI_assert(BEZT_ISSEL_ANY(active_bezt) || !"active keyframe must be selected"); | BLI_assert_msg(BEZT_ISSEL_ANY(active_bezt), "active keyframe must be selected"); | ||||
| fcu->active_keyframe_index = (int)offset; | fcu->active_keyframe_index = (int)offset; | ||||
| } | } | ||||
| /** | /** | ||||
| * Get the active keyframe index, with sanity checks for point bounds. | * Get the active keyframe index, with sanity checks for point bounds. | ||||
| */ | */ | ||||
| int BKE_fcurve_active_keyframe_index(const FCurve *fcu) | int BKE_fcurve_active_keyframe_index(const FCurve *fcu) | ||||
| ▲ Show 20 Lines • Show All 1,615 Lines • Show Last 20 Lines | |||||