|
Blender V4.3
|
#include <cfloat>#include <cmath>#include <cstddef>#include <cstdio>#include <cstring>#include "MEM_guardedalloc.h"#include "ANIM_action.hh"#include "ANIM_animdata.hh"#include "DNA_action_types.h"#include "DNA_anim_types.h"#include "DNA_object_types.h"#include "DNA_text_types.h"#include "BLI_blenlib.h"#include "BLI_easing.h"#include "BLI_ghash.h"#include "BLI_math_vector.h"#include "BLI_math_vector_types.hh"#include "BLI_sort_utils.h"#include "BLI_string_utils.hh"#include "BLI_task.hh"#include "BLT_translation.hh"#include "BKE_anim_data.hh"#include "BKE_animsys.h"#include "BKE_context.hh"#include "BKE_curve.hh"#include "BKE_fcurve.hh"#include "BKE_fcurve_driver.h"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_lib_query.hh"#include "BKE_nla.hh"#include "BKE_scene.hh"#include "BLO_read_write.hh"#include "RNA_access.hh"#include "RNA_path.hh"#include "CLG_log.h"Go to the source code of this file.
Classes | |
| struct | tRetainedKeyframe |
Macros | |
| #define | SMALL -1.0e-10 |
| #define | SELECT 1 |
Functions | |
| void | BKE_fcurve_keyframe_move_time_with_handles (BezTriple *keyframe, const float new_time) |
| void | BKE_fcurve_keyframe_move_value_with_handles (BezTriple *keyframe, const float new_value) |
F-Curve Data Create | |
| FCurve * | BKE_fcurve_create () |
F-Curve Data Free | |
| void | BKE_fcurve_free (FCurve *fcu) |
| void | BKE_fcurves_free (ListBase *list) |
F-Curve Data Copy | |
| FCurve * | BKE_fcurve_copy (const FCurve *fcu) |
| void | BKE_fcurves_copy (ListBase *dst, ListBase *src) |
| void | BKE_fcurve_rnapath_set (FCurve &fcu, blender::StringRef rna_path) |
| void | BKE_fmodifier_name_set (FModifier *fcm, const char *name) |
| void | BKE_fcurve_foreach_id (FCurve *fcu, LibraryForeachIDData *data) |
| FCurve * | id_data_find_fcurve (ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven) |
| FCurve * | BKE_fcurve_find (ListBase *list, const char rna_path[], const int array_index) |
FCurve Iteration | |
| FCurve * | BKE_fcurve_iter_step (FCurve *fcu_iter, const char rna_path[]) |
| FCurve * | BKE_animadata_fcurve_find_by_rna_path (AnimData *animdata, const char *rna_path, int rna_index, bAction **r_action, bool *r_driven) |
| FCurve * | BKE_fcurve_find_by_rna (PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special) |
| FCurve * | BKE_fcurve_find_by_rna_context_ui (bContext *, const PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special) |
Finding Keyframes/Extents | |
| static int | BKE_fcurve_bezt_binarysearch_index_ex (const BezTriple array[], const float frame, const int arraylen, const float threshold, bool *r_replace) |
| int | BKE_fcurve_bezt_binarysearch_index (const BezTriple array[], const float frame, const int arraylen, bool *r_replace) |
| static bool | get_bounding_bezt_indices (const FCurve *fcu, const bool selected_keys_only, const float frame_range[2], int *r_first, int *r_last) |
| static void | calculate_bezt_bounds_x (BezTriple *bezt_array, const int index_range[2], const bool include_handles, float *r_min, float *r_max) |
| static void | calculate_bezt_bounds_y (BezTriple *bezt_array, const int index_range[2], const bool selected_keys_only, const bool include_handles, float *r_min, float *r_max) |
| static bool | calculate_bezt_bounds (const FCurve *fcu, const bool selected_keys_only, const bool include_handles, const float frame_range[2], rctf *r_bounds) |
| static bool | calculate_fpt_bounds (const FCurve *fcu, const float frame_range[2], rctf *r_bounds) |
| bool | BKE_fcurve_calc_bounds (const FCurve *fcu, const bool selected_keys_only, const bool include_handles, const float frame_range[2], rctf *r_bounds) |
| bool | BKE_fcurve_calc_range (const FCurve *fcu, float *r_min, float *r_max, const bool selected_keys_only) |
| float * | BKE_fcurves_calc_keyed_frames_ex (FCurve **fcurve_array, int fcurve_array_len, const float interval, int *r_frames_len) |
| float * | BKE_fcurves_calc_keyed_frames (FCurve **fcurve_array, int fcurve_array_len, int *r_frames_len) |
Active Keyframe | |
| void | BKE_fcurve_active_keyframe_set (FCurve *fcu, const BezTriple *active_bezt) |
| int | BKE_fcurve_active_keyframe_index (const FCurve *fcu) |
Status Checks | |
| bool | BKE_fcurve_are_keyframes_usable (const FCurve *fcu) |
| bool | BKE_fcurve_is_protected (const FCurve *fcu) |
| bool | BKE_fcurve_has_selected_control_points (const FCurve *fcu) |
| void | BKE_fcurve_deselect_all_keys (FCurve &fcu) |
| bool | BKE_fcurve_is_keyframable (const FCurve *fcu) |
Samples Utilities | |
| float | fcurve_samplingcb_evalcurve (FCurve *fcu, void *, float evaltime) |
| void | fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb) |
| static void | init_unbaked_bezt_data (BezTriple *bezt) |
| void | fcurve_samples_to_keyframes (FCurve *fcu, const int start, const int end) |
| eFCU_Cycle_Type | BKE_fcurve_get_cycle_type (const FCurve *fcu) |
| bool | BKE_fcurve_is_cyclic (const FCurve *fcu) |
| static BezTriple * | cycle_offset_triple (bool cycle, BezTriple *out, const BezTriple *in, const BezTriple *from, const BezTriple *to) |
| void | BKE_fcurve_handles_recalc_ex (FCurve *fcu, eBezTriple_Flag handle_sel_flag) |
| void | BKE_fcurve_handles_recalc (FCurve *fcu) |
| void | testhandles_fcurve (FCurve *fcu, eBezTriple_Flag sel_flag, const bool use_handle) |
| void | sort_time_fcurve (FCurve *fcu) |
| bool | test_time_fcurve (FCurve *fcu) |
F-Curve Calculations | |
| void | BKE_fcurve_correct_bezpart (const float v1[2], float v2[2], float v3[2], const float v4[2]) |
| static int | solve_cubic (double c0, double c1, double c2, double c3, float *o) |
| static int | findzero (float x, float q0, float q1, float q2, float q3, float *o) |
| static void | berekeny (float f1, float f2, float f3, float f4, float *o, int b) |
| static void | fcurve_bezt_free (FCurve *fcu) |
| bool | BKE_fcurve_bezt_subdivide_handles (BezTriple *bezt, BezTriple *prev, BezTriple *next, float *r_pdelta) |
| void | BKE_fcurve_bezt_shrink (FCurve *fcu, const int new_totvert) |
| void | BKE_fcurve_delete_key (FCurve *fcu, int index) |
| void | BKE_fcurve_delete_keys (FCurve *fcu, blender::uint2 index_range) |
| BezTriple * | BKE_bezier_array_merge (const BezTriple *a, const int size_a, const BezTriple *b, const int size_b, int *r_merged_size) |
| bool | BKE_fcurve_delete_keys_selected (FCurve *fcu) |
| void | BKE_fcurve_delete_keys_all (FCurve *fcu) |
| void | BKE_fcurve_merge_duplicate_keys (FCurve *fcu, const int sel_flag, const bool use_handle) |
| void | BKE_fcurve_deduplicate_keys (FCurve *fcu) |
F-Curve Evaluation | |
| static float | fcurve_eval_keyframes_extrapolate (const FCurve *fcu, const BezTriple *bezts, float evaltime, int endpoint_offset, int direction_to_neighbor) |
| static float | fcurve_eval_keyframes_interpolate (const FCurve *fcu, const BezTriple *bezts, float evaltime) |
| static float | fcurve_eval_keyframes (const FCurve *fcu, const BezTriple *bezts, float evaltime) |
| static float | fcurve_eval_samples (const FCurve *fcu, const FPoint *fpts, float evaltime) |
F-Curve - Evaluation | |
| static float | evaluate_fcurve_ex (const FCurve *fcu, float evaltime, float cvalue) |
| float | evaluate_fcurve (const FCurve *fcu, float evaltime) |
| float | evaluate_fcurve_only_curve (const FCurve *fcu, float evaltime) |
| float | evaluate_fcurve_driver (PathResolvedRNA *anim_rna, FCurve *fcu, ChannelDriver *driver_orig, const AnimationEvalContext *anim_eval_context) |
| bool | BKE_fcurve_is_empty (const FCurve *fcu) |
| float | calculate_fcurve (PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context) |
F-Curve - .blend file API | |
| void | BKE_fmodifiers_blend_write (BlendWriter *writer, ListBase *fmodifiers) |
| void | BKE_fmodifiers_blend_read_data (BlendDataReader *reader, ListBase *fmodifiers, FCurve *curve) |
| void | BKE_fcurve_blend_write_data (BlendWriter *writer, FCurve *fcu) |
| void | BKE_fcurve_blend_write_listbase (BlendWriter *writer, ListBase *fcurves) |
| void | BKE_fcurve_blend_read_data (BlendDataReader *reader, FCurve *fcu) |
| void | BKE_fcurve_blend_read_data_listbase (BlendDataReader *reader, ListBase *fcurves) |
Variables | |
| static CLG_LogRef | LOG = {"bke.fcurve"} |
| #define SELECT 1 |
Definition at line 56 of file blenkernel/intern/fcurve.cc.
Referenced by BKE_fcurve_active_keyframe_index(), BKE_fcurve_delete_keys_selected(), BKE_fcurve_handles_recalc(), BKE_fcurve_has_selected_control_points(), and init_unbaked_bezt_data().
| #define SMALL -1.0e-10 |
Definition at line 55 of file blenkernel/intern/fcurve.cc.
Referenced by solve_cubic().
Definition at line 1531 of file blenkernel/intern/fcurve.cc.
References b.
Referenced by fcurve_eval_keyframes_interpolate().
| FCurve * BKE_animadata_fcurve_find_by_rna_path | ( | AnimData * | animdata, |
| const char * | rna_path, | ||
| const int | rna_index, | ||
| bAction ** | r_action, | ||
| bool * | r_driven ) |
Find an F-Curve from its rna path and index.
The search order is as follows. The first match will be returned:
will not match any F-Curve on an Object, butrna_path='location', rna_index=0` will if it exists).r_action, r_driven and r_special) are all optional and may be NULL.Definition at line 300 of file blenkernel/intern/fcurve.cc.
References AnimData::action, BKE_fcurve_find(), BLI_listbase_is_empty(), AnimData::drivers, blender::animrig::fcurve_find_in_action_slot(), and AnimData::slot_handle.
Referenced by BKE_fcurve_find_by_rna_context_ui(), BKE_lib_override_library_property_is_animated(), get_fcurves_of_property(), and id_data_find_fcurve().
| BezTriple * BKE_bezier_array_merge | ( | const BezTriple * | a, |
| int | size_a, | ||
| const BezTriple * | b, | ||
| int | size_b, | ||
| int * | r_merged_size ) |
Merge the two given BezTriple arrays a and b into a newly allocated BezTriple array of size r_merged_size. In case of keys on identical frames, a takes precedence. Does not free a or b. Assumes that both arrays are sorted for the x-position. Has a complexity of O(N) with respect to the length of size_a + size_b.
r_merged_size. Definition at line 1681 of file blenkernel/intern/fcurve.cc.
References b, BEZT_BINARYSEARCH_THRESH, compare_ff_relative(), MEM_callocN, and MEM_reallocN.
Referenced by blender::animrig::bake_fcurve().
Get the active keyframe index, with sanity checks for point bounds.
Definition at line 835 of file blenkernel/intern/fcurve.cc.
References FCurve::active_keyframe_index, FCurve::bezt, BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_ACTIVE_KEYFRAME_NONE, SELECT, and FCurve::totvert.
Referenced by draw_fcurve_active_handle_vertices(), draw_fcurve_active_vertex(), get_active_fcurve_keyframe_edit(), mouse_graph_keys(), and blender::bke::tests::TEST().
Set the index that stores the FCurve's active keyframe, assuming that active_bezt is already part of fcu->bezt. If NULL, set active keyframe index to "none."
Definition at line 814 of file blenkernel/intern/fcurve.cc.
References FCurve::active_keyframe_index, FCurve::bezt, BEZT_ISSEL_ANY, BLI_assert_msg, FCURVE_ACTIVE_KEYFRAME_NONE, int, and FCurve::totvert.
Referenced by BKE_fcurve_delete_keys_selected(), blender::animrig::insert_vert_fcurve(), mouse_graph_keys(), and blender::bke::tests::TEST().
| bool BKE_fcurve_are_keyframes_usable | ( | const FCurve * | fcu | ) |
Are keyframes on F-Curve of any use (to final result, and to show in editors)? Usability of keyframes refers to whether they should be displayed, and also whether they will have any influence on the final result.
Definition at line 875 of file blenkernel/intern/fcurve.cc.
References FCM_GENERATOR_ADDITIVE, ListBase::first, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_NOISE, FMODIFIER_TYPE_STEPPED, FCurve::fpt, LISTBASE_FOREACH_BACKWARD, and FCurve::modifiers.
Referenced by BKE_fcurve_is_keyframable(), draw_fcurve(), and graphop_visible_keyframes_poll().
| int BKE_fcurve_bezt_binarysearch_index | ( | const BezTriple | array[], |
| float | frame, | ||
| int | arraylen, | ||
| bool * | r_replace ) |
Binary search algorithm for finding where to 'insert' BezTriple with given frame number. Returns the index to insert at (data already at that index will be offset if replace is 0)
Definition at line 516 of file blenkernel/intern/fcurve.cc.
References BEZT_BINARYSEARCH_THRESH, and BKE_fcurve_bezt_binarysearch_index_ex().
Referenced by channels_bake_exec(), delete_key_button_exec(), blender::animrig::fcurve_delete_keyframe_at_time(), fcurve_frame_has_keyframe(), fcurve_scene_coord_range_get(), find_closest_frame(), find_next_key(), gather_frames_to_render_for_adt(), get_bounding_bezt_index_range(), get_bounding_bezt_indices(), blender::animrig::insert_bezt_fcurve(), blender::animrig::insert_keyframes(), blender::animrig::new_key_needed(), paste_get_y_offset(), pyrna_struct_keyframe_delete(), and blender::animrig::remove_fcurve_key_range().
|
static |
Definition at line 431 of file blenkernel/intern/fcurve.cc.
References CLOG_ERROR, CLOG_WARN, IS_EQT, and LOG.
Referenced by BKE_fcurve_bezt_binarysearch_index(), and fcurve_eval_keyframes_interpolate().
Resize the FCurve 'bezt' array to fit the given length.
| new_totvert | new number of elements in the FCurve's bezt array. Constraint: 0 <= new_totvert <= fcu->totvert |
Definition at line 1615 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BLI_assert, fcurve_bezt_free(), MEM_reallocN, and FCurve::totvert.
Referenced by BKE_fcurve_deduplicate_keys().
| bool BKE_fcurve_bezt_subdivide_handles | ( | BezTriple * | bezt, |
| BezTriple * | prev, | ||
| BezTriple * | next, | ||
| float * | r_pdelta ) |
Recompute bezier handles of all three given BezTriples, so that bezt can be inserted between prev and next without changing the resulting curve shape.
| r_pdelta | return Y difference between bezt and the original curve value at its X position. |
Definition at line 1553 of file blenkernel/intern/fcurve.cc.
References add_v2_v2v2(), BKE_fcurve_correct_bezpart(), copy_v2_v2(), findzero(), interp_v2_v2v2(), next, sub_v2_v2v2(), and BezTriple::vec.
Referenced by blender::animrig::subdivide_nonauto_handles(), and blender::bke::tests::TEST().
| void BKE_fcurve_blend_read_data | ( | BlendDataReader * | reader, |
| FCurve * | fcu ) |
Definition at line 2582 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BKE_fmodifiers_blend_read_data(), BLO_read_string(), BLO_read_struct, BLO_read_struct_array, BLO_read_struct_list, FCurve::driver, DRIVER_FLAG_INVALID, DRIVER_FLAG_PYTHON_BLOCKED, DRIVER_TARGETS_LOOPER_BEGIN, DRIVER_TARGETS_LOOPER_END, ChannelDriver::expr_comp, ChannelDriver::expr_simple, ChannelDriver::flag, FCurve::flag, FCurve::fpt, FCurve::grp, LISTBASE_FOREACH, FCurve::modifiers, FCurve::rna_path, FCurve::totvert, and ChannelDriver::variables.
Referenced by BKE_fcurve_blend_read_data_listbase().
| void BKE_fcurve_blend_read_data_listbase | ( | BlendDataReader * | reader, |
| ListBase * | fcurves ) |
Definition at line 2635 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_blend_read_data(), and LISTBASE_FOREACH.
Referenced by blender::bke::action_blend_read_data(), BKE_animdata_blend_read_data(), and blend_data_read_nla_strips().
| void BKE_fcurve_blend_write_data | ( | BlendWriter * | writer, |
| FCurve * | fcu ) |
Write the FCurve's data to the writer. If this is used to write an FCurve, be sure to call BLO_write_struct(writer, FCurve, fcurve); before calling this function.
Definition at line 2538 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BKE_fmodifiers_blend_write(), BLO_write_string(), BLO_write_struct, BLO_write_struct_array, BLO_write_struct_list, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, FCurve::fpt, LISTBASE_FOREACH, FCurve::modifiers, FCurve::rna_path, FCurve::totvert, and ChannelDriver::variables.
Referenced by BKE_fcurve_blend_write_listbase().
| void BKE_fcurve_blend_write_listbase | ( | BlendWriter * | writer, |
| ListBase * | fcurves ) |
Definition at line 2574 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_blend_write_data(), BLO_write_struct_list, and LISTBASE_FOREACH.
Referenced by blender::bke::action_blend_write(), BKE_animdata_blend_write(), and blend_write_nla_strips().
| bool BKE_fcurve_calc_bounds | ( | const FCurve * | fcu, |
| bool | selected_keys_only, | ||
| bool | include_handles, | ||
| const float | frame_range[2], | ||
| rctf * | r_bounds ) |
Calculate the x and y extents of F-Curve's data.
| frame_range | Only calculate the bounds of the FCurve in the given range. Does the full range if NULL. |
Definition at line 706 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, calculate_bezt_bounds(), calculate_fpt_bounds(), FCurve::fpt, and FCurve::totvert.
Referenced by get_graph_keyframe_extents(), get_normalized_fcurve_bounds(), and blender::bke::tests::TEST().
| bool BKE_fcurve_calc_range | ( | const FCurve * | fcu, |
| float * | r_min, | ||
| float * | r_max, | ||
| bool | selected_keys_only ) |
Calculate the x range of the given F-Curve's data.
Definition at line 730 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, calculate_bezt_bounds_x(), FCurve::fpt, get_bounding_bezt_indices(), max, min, FCurve::totvert, and FPoint::vec.
Referenced by draw_fcurve_curve(), blender::animrig::get_frame_range_of_fcurves(), get_keyframe_extents(), and blender::bke::tests::TEST().
Duplicate a F-Curve.
Definition at line 124 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, copy_fmodifiers(), FCurve::driver, fcurve_copy_driver(), FCurve::fpt, FCurve::grp, MEM_dupallocN, FCurve::modifiers, FCurve::next, FCurve::prev, and FCurve::rna_path.
Referenced by blender::bke::action_copy_data(), ANIM_copy_driver(), BKE_fcurves_copy(), blender::animrig::ChannelBag::ChannelBag(), blender::animrig::convert_to_layered_action(), do_version_bbone_scale_fcurve_fix(), icu_to_fcurves(), blender::interface::internal::paste_property_drivers(), seq_animation_duplicate(), sequencer_copy_animation_listbase(), sequencer_paste_animation(), and updateDuplicateActionConstraintSettings().
The length of each handle is not allowed to be more than the horizontal distance between (v1-v4). This is to prevent curve loops.
This function is very similar to BKE_curve_correct_bezpart(), but allows a steeper tangent for more snappy animations. This is not desired for other areas in which curves are used, though.
Definition at line 1363 of file blenkernel/intern/fcurve.cc.
References fabsf, len, and v2.
Referenced by add_bezt_vertices(), BKE_fcurve_bezt_subdivide_handles(), fcurve_eval_keyframes_interpolate(), and fcurve_scene_coord_range_get().
| FCurve * BKE_fcurve_create | ( | void | ) |
Definition at line 64 of file blenkernel/intern/fcurve.cc.
References MEM_callocN.
Referenced by alloc_driver_fcurve(), BKE_nlastrip_validate_fcurves(), blender::animrig::create_fcurve_for_channel(), create_ghost_curves(), blender::editor::animation::tests::create_test_keylist(), blender::animrig::tests::ActionFCurveMoveTest::fcurve_create(), icu_to_fcurves(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::testcurve_with_duplicates().
| void BKE_fcurve_deduplicate_keys | ( | FCurve * | fcu | ) |
Ensure the FCurve is a proper function, such that every X-coordinate of the timeline has only one value of the FCurve. In other words, removes duplicate keyframes.
Contrary to BKE_fcurve_merge_duplicate_keys, which is intended for interactive use, and where selection matters, this is a simpler deduplication where the last duplicate "wins".
Assumes the keys are sorted (see sort_time_fcurve).
After deduplication, call BKE_fcurve_handles_recalc(fcu);
Definition at line 1900 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BEZT_BINARYSEARCH_THRESH, BKE_fcurve_bezt_shrink(), BKE_fcurve_keyframe_move_time_with_handles(), BLI_assert_msg, floor(), FCurve::totvert, and BezTriple::vec.
Referenced by blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
Delete a keyframe from an F-curve at a specific index.
Definition at line 1634 of file blenkernel/intern/fcurve.cc.
References abs(), FCurve::bezt, fcurve_bezt_free(), and FCurve::totvert.
Referenced by BKE_fcurve_merge_duplicate_keys(), delete_key_button_exec(), blender::animrig::fcurve_delete_keyframe_at_time(), and pyrna_struct_keyframe_delete().
| void BKE_fcurve_delete_keys | ( | FCurve * | fcu, |
| blender::uint2 | index_range ) |
Delete an index range of keyframes from an F-curve. This is more performant than individually removing keys. Has a complexity of O(N) with respect to number of keys in fcu.
| index_range | is right exclusive. |
Definition at line 1663 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BLI_assert, fcurve_bezt_free(), and FCurve::totvert.
Referenced by blender::animrig::remove_fcurve_key_range().
| void BKE_fcurve_delete_keys_all | ( | FCurve * | fcu | ) |
Delete all keyframes from an F-curve.
Definition at line 1767 of file blenkernel/intern/fcurve.cc.
References fcurve_bezt_free().
Referenced by clean_fcurve(), paste_animedit_keys_fcurve(), and blender::animrig::remove_fcurve_key_range().
| bool BKE_fcurve_delete_keys_selected | ( | FCurve * | fcu | ) |
Delete selected keyframes from an F-curve.
Definition at line 1738 of file blenkernel/intern/fcurve.cc.
References FCurve::active_keyframe_index, FCurve::bezt, BKE_fcurve_active_keyframe_set(), BezTriple::f2, fcurve_bezt_free(), SELECT, and FCurve::totvert.
Referenced by delete_action_keys(), delete_graph_keys(), and paste_animedit_keys_fcurve().
| void BKE_fcurve_deselect_all_keys | ( | FCurve & | fcu | ) |
Deselect all keyframes within that FCurve.
Definition at line 950 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BEZT_DESEL_ALL, and FCurve::totvert.
Referenced by blender::animrig::action_deselect_keys().
Find the F-Curve affecting the given RNA-access path + index, in the list of F-Curves provided.
adt->drivers, or nlastrip->fcurves.Definition at line 255 of file blenkernel/intern/fcurve.cc.
References ELEM, LISTBASE_FOREACH, STREQ, and UNLIKELY.
Referenced by BKE_animadata_fcurve_find_by_rna_path(), BKE_fcurve_find_by_rna_context_ui(), BKE_nlastrip_validate_fcurves(), delete_key_button_exec(), blender::animrig::fcurve_find_in_action(), blender::animrig::fcurve_find_in_action_slot(), blender::interface::internal::get_property_drivers(), insert_key_button_exec(), nla_draw_strip_curves(), blender::interface::internal::paste_property_drivers(), pyrna_struct_driver_add(), pyrna_struct_keyframe_delete(), pyrna_struct_keyframe_insert(), seq_convert_transform_animation(), seq_convert_transform_animation_2(), seq_speed_factor_fix_rna_path(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and verify_driver_fcurve().
| FCurve * BKE_fcurve_find_by_rna | ( | PointerRNA * | ptr, |
| PropertyRNA * | prop, | ||
| int | rnaindex, | ||
| AnimData ** | r_adt, | ||
| bAction ** | r_action, | ||
| bool * | r_driven, | ||
| bool * | r_special ) |
Find an f-curve based on an rna property.
Definition at line 336 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_find_by_rna_context_ui(), and ptr.
Referenced by blender::interface::internal::paste_property_drivers(), and RNA_property_animated().
| FCurve * BKE_fcurve_find_by_rna_context_ui | ( | bContext * | C, |
| const PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| int | rnaindex, | ||
| AnimData ** | r_animdata, | ||
| bAction ** | r_action, | ||
| bool * | r_driven, | ||
| bool * | r_special ) |
Same as BKE_fcurve_find_by_rna, but takes a context data, temp hack needed for complex paths like texture ones.
| r_special | Optional, ignored when NULL. Set to true if the given RNA ptr is a NLA strip, and the returned F-curve comes from this NLA strip. |
Definition at line 348 of file blenkernel/intern/fcurve.cc.
References BKE_animadata_fcurve_find_by_rna_path(), BKE_animdata_from_id(), BKE_fcurve_find(), BKE_nlastrip_has_curves_for_property(), PointerRNA::data, NlaStrip::fcurves, PointerRNA::owner_id, ptr, RNA_path_from_ID_to_property(), RNA_property_animateable(), and RNA_property_identifier().
Referenced by add_driver_button_poll(), blender::animrig::autokeyframe_property(), BKE_fcurve_find_by_rna(), drivers_editor_show_exec(), graph_panel_drivers_popover(), insert_key_button_exec(), and ui_but_get_fcurve().
| void BKE_fcurve_foreach_id | ( | FCurve * | fcu, |
| LibraryForeachIDData * | data ) |
Callback used by lib_query to walk over all ID usages (mimics foreach_id callback of IDTypeInfo structure).
Note that this is only relevant when the F-Curve is a driver. Otherwise it won't refer to any other ID.
Definition at line 194 of file blenkernel/intern/fcurve.cc.
References BKE_LIB_FOREACHID_PROCESS_ID, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, IDWALK_CB_NOP, LISTBASE_FOREACH, and ChannelDriver::variables.
Referenced by BKE_animdata_foreach_id(), and BKE_nla_strip_foreach_id().
| void BKE_fcurve_free | ( | FCurve * | fcu | ) |
Frees the F-Curve itself too, so make sure BLI_remlink is called before calling this.
Definition at line 76 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, fcurve_free_driver(), FCurve::fpt, free_fmodifiers(), MEM_freeN(), MEM_SAFE_FREE, FCurve::modifiers, and FCurve::rna_path.
Referenced by blender::animrig::legacy::action_fcurves_remove(), ANIM_drivers_copybuf_free(), ANIM_remove_driver(), animchannels_delete_exec(), blender::animrig::animdata_fcurve_delete(), BKE_action_fcurves_clear(), BKE_fcurves_free(), blender::editor::animation::tests::create_test_keylist(), ED_curve_updateAnimPaths(), blender::animrig::fcurve_ptr_destructor(), blender::animrig::ChannelBag::fcurve_remove(), blender::animrig::ChannelBag::fcurve_remove_by_index(), fcurves_path_remove_from_listbase(), blender::interface::internal::paste_property_drivers(), remove_sequencer_fcurves(), seq_convert_transform_animation(), SEQ_free_animdata(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), AnimationImporter::~AnimationImporter(), and blender::animrig::ChannelBag::~ChannelBag().
| eFCU_Cycle_Type BKE_fcurve_get_cycle_type | ( | const FCurve * | fcu | ) |
Checks if the F-Curve has a Cycles modifier, and returns the type of the cycle behavior.
Definition at line 1114 of file blenkernel/intern/fcurve.cc.
References FModifier::data, ELEM, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCU_CYCLE_NONE, FCU_CYCLE_OFFSET, FCU_CYCLE_PERFECT, ListBase::first, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, FMODIFIER_FLAG_USEINFLUENCE, FMODIFIER_TYPE_CYCLES, FCurve::modifiers, and FModifier::type.
Referenced by BKE_fcurve_is_cyclic(), blender::animrig::insert_bezt_fcurve(), and blender::animrig::insert_vert_fcurve().
| void BKE_fcurve_handles_recalc | ( | FCurve * | fcu | ) |
This function recalculates the handles of an F-Curve. Acts based on selection with SELECT flag. To use a different flag, use BKE_fcurve_handles_recalc_ex().
If the BezTriples have been rearranged, sort them first before using this.
Definition at line 1256 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_handles_recalc_ex(), and SELECT.
Referenced by add_fmodifier(), alloc_driver_fcurve(), ANIM_animdata_keyframe_callback(), ANIM_animdata_update(), ANIM_fmodifiers_paste_from_buf(), blender::animrig::bake_fcurve(), blender::animrig::bake_fcurve_segments(), delete_key_button_exec(), blender::bke::greasepencil::convert::fcurve_convert_thickness_cb(), blender::animrig::fcurve_delete_keyframe_at_time(), fcurve_samples_to_keyframes(), graphedit_activekey_update_cb(), blender::io::usd::import_blendshapes(), blender::animrig::insert_vert_fcurve(), mirror_action_keys(), mirror_graph_keys(), nlaedit_apply_scale_exec(), paste_animedit_keys_fcurve(), pyrna_struct_keyframe_delete(), remove_fmodifier(), seteasing_graph_keys(), sethandles_action_keys(), sethandles_graph_keys(), setipo_graph_keys(), smooth_fcurve(), snap_action_keys(), and snap_graph_keys().
| void BKE_fcurve_handles_recalc_ex | ( | FCurve * | fcu, |
| eBezTriple_Flag | handle_sel_flag ) |
Variant of BKE_fcurve_handles_recalc() that allows calculating based on a different select flag.
| handle_sel_flag | The flag (bezt.f1/2/3) value to use to determine selection. Usually SELECT, but may want to use a different one at times (if caller does not operate on selection). |
Definition at line 1176 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BEZT_IS_AUTOH, BKE_fcurve_is_cyclic(), ELEM, and FCurve::totvert.
Referenced by action_flip_pchan(), BKE_fcurve_handles_recalc(), recalcData_graphedit(), and testhandles_fcurve().
| bool BKE_fcurve_has_selected_control_points | ( | const FCurve * | fcu | ) |
Are any of the keyframe control points selected on the F-Curve?
Definition at line 938 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BezTriple::f2, SELECT, and FCurve::totvert.
Referenced by graph_has_selected_control_points().
| bool BKE_fcurve_is_cyclic | ( | const FCurve * | fcu | ) |
Checks if the F-Curve has a Cycles modifier with simple settings that warrant transition smoothing.
Definition at line 1148 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_get_cycle_type(), and FCU_CYCLE_NONE.
Referenced by ANIM_fmodifiers_paste_from_buf(), BKE_fcurve_handles_recalc_ex(), and fcurve_to_keylist().
| bool BKE_fcurve_is_empty | ( | const FCurve * | fcu | ) |
Checks if the curve has valid keys, drivers or modifiers that produce an actual curve.
Definition at line 2429 of file blenkernel/intern/fcurve.cc.
References FCurve::driver, FMI_TYPE_GENERATE_CURVE, list_has_suitable_fmodifier(), FCurve::modifiers, and FCurve::totvert.
Referenced by animsys_evaluate_action_group(), calculate_fcurve(), clean_fcurve(), delete_action_keys(), delete_graph_keys(), delete_key_v3d_without_keying_set(), blender::animrig::delete_keyframe(), blender::animrig::delete_keyframe_fcurve_legacy(), blender::animrig::is_fcurve_evaluatable(), is_fcurve_evaluatable(), seq_convert_transform_animation(), seq_convert_transform_animation_2(), strip_draw_context_curve_get(), and ui_but_anim_flag().
| bool BKE_fcurve_is_keyframable | ( | const FCurve * | fcu | ) |
Can keyframes be added to F-Curve? Keyframes can only be added if they are already visible.
Definition at line 960 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_are_keyframes_usable(), and BKE_fcurve_is_protected().
Referenced by graphkeys_click_insert_exec(), graphop_editable_keyframes_poll(), blender::animrig::insert_keyframe_value(), and blender::animrig::StripKeyframeData::keyframe_insert().
| bool BKE_fcurve_is_protected | ( | const FCurve * | fcu | ) |
Definition at line 933 of file blenkernel/intern/fcurve.cc.
References AGRP_PROTECTED, FCURVE_PROTECTED, bActionGroup::flag, FCurve::flag, and FCurve::grp.
Referenced by BKE_fcurve_is_keyframable(), can_delete_key(), delete_key_button_exec(), blender::animrig::delete_keyframe(), draw_fcurve(), blender::animrig::fcurve_delete_keyframe_at_time(), and pyrna_struct_keyframe_delete().
Quick way to loop over all f-curves of a given 'path'.
Definition at line 282 of file blenkernel/intern/fcurve.cc.
References ELEM, FCurve::next, and STREQ.
Referenced by ANIM_remove_driver().
Move the indexed keyframe to the given value, and move the handles with it to ensure the slope remains the same.
Definition at line 855 of file blenkernel/intern/fcurve.cc.
References BezTriple::vec.
Referenced by BKE_fcurve_deduplicate_keys(), snap_bezier_cframe(), snap_bezier_nearest(), snap_bezier_nearestsec(), snap_bezier_nearmarker(), snap_bezier_time(), and blender::bke::tests::TEST().
Definition at line 863 of file blenkernel/intern/fcurve.cc.
References BezTriple::vec.
Referenced by blend_offset_fcurve_segment(), blend_to_default_fcurve(), blend_to_ease_fcurve_segment(), blend_to_neighbor_fcurve_segment(), breakdown_fcurve_segment(), butterworth_smooth_fcurve_segment(), ease_fcurve_segment(), euler_filter_multi_channel(), match_slope_fcurve_segment(), push_pull_fcurve_segment(), scale_average_fcurve_segment(), scale_from_fcurve_segment_neighbor(), shear_fcurve_segment(), smooth_fcurve_segment(), snap_bezier_value(), blender::bke::tests::TEST(), and time_offset_fcurve_segment().
Called during transform/snapping to make sure selected keyframes replace any other keyframes which may reside on that frame (that is not selected).
| sel_flag | The flag (bezt.f1/2/3) value to use to determine selection. Usually SELECT, but may want to use a different one at times (if caller does not operate on selection). |
Definition at line 1782 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BEZT_BINARYSEARCH_THRESH, BEZT_ISSEL_ANY, BKE_fcurve_delete_key(), BLI_addtail(), BLI_freelistN(), BLI_listbase_is_empty(), FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCurve::flag, float, tRetainedKeyframe::frame, G, G_DEBUG, IS_EQT, LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, MEM_callocN, printf, FCurve::rna_path, testhandles_fcurve(), tRetainedKeyframe::tot_count, FCurve::totvert, tRetainedKeyframe::val, and BezTriple::vec.
Referenced by posttrans_action_clean(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update__actedit(), and special_aftertrans_update__graph().
| void BKE_fcurve_rnapath_set | ( | FCurve & | fcu, |
| blender::StringRef | rna_path ) |
Set the RNA path of a F-Curve.
Definition at line 171 of file blenkernel/intern/fcurve.cc.
References BLI_strdupn(), blender::StringRefBase::data(), MEM_SAFE_FREE, FCurve::rna_path, and blender::StringRefBase::size().
Referenced by blender::animrig::tests::ActionLegacyTest::fcurve_add_legacy(), and blender::interface::internal::paste_property_drivers().
| float * BKE_fcurves_calc_keyed_frames | ( | FCurve ** | fcurve_array, |
| int | fcurve_array_len, | ||
| int * | r_frames_len ) |
Definition at line 801 of file blenkernel/intern/fcurve.cc.
References BKE_fcurves_calc_keyed_frames_ex().
Referenced by action_flip_pchan().
| float * BKE_fcurves_calc_keyed_frames_ex | ( | FCurve ** | fcurve_array, |
| int | fcurve_array_len, | ||
| float | interval, | ||
| int * | r_frames_len ) |
Return an array of keyed frames, rounded to interval.
| interval | Set to 1.0 to round to whole keyframes, 0.5 for in-between key-frames, etc. |
Definition at line 766 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BLI_assert, BLI_gset_add(), BLI_gset_free(), BLI_gset_int_new(), BLI_gset_len(), BLI_gsetIterator_getKey(), BLI_sortutil_cmp_float(), double(), GSET_ITER_INDEX, max_ff(), MEM_mallocN, POINTER_AS_INT, POINTER_FROM_INT, FCurve::totvert, and BezTriple::vec.
Referenced by BKE_fcurves_calc_keyed_frames().
Duplicate a list of F-Curves.
Definition at line 154 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_copy(), BLI_addtail(), BLI_listbase_clear(), ELEM, and LISTBASE_FOREACH.
Referenced by BKE_animdata_copy_in_lib(), BKE_animdata_merge_copy(), BKE_nlastrip_copy(), undocurve_from_editcurve(), and undocurve_to_editcurve().
| void BKE_fcurves_free | ( | ListBase * | list | ) |
Frees a list of F-Curves.
Definition at line 97 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_free(), BLI_listbase_clear(), and FCurve::next.
Referenced by blender::bke::action_free_data(), BKE_animdata_free(), BKE_nlastrip_free(), blender::ed::outliner::cleardrivers_animdata_fn(), create_ghost_curves(), do_versions_ipos_to_animato(), graph_free(), graphkeys_clear_ghostcurves_exec(), undocurve_free_data(), and undocurve_to_editcurve().
| void BKE_fmodifier_name_set | ( | FModifier * | fcm, |
| const char * | name ) |
Definition at line 177 of file blenkernel/intern/fcurve.cc.
References BLI_listbase_from_link(), BLI_uniquename(), BLT_I18NCONTEXT_ID_ACTION, CTX_DATA_, get_fmodifier_typeinfo(), FModifier::name, FModifierTypeInfo::name, offsetof, STRNCPY, and FModifier::type.
Referenced by add_fmodifier(), and blo_do_versions_300().
| void BKE_fmodifiers_blend_read_data | ( | BlendDataReader * | reader, |
| ListBase * | fmodifiers, | ||
| FCurve * | curve ) |
Definition at line 2505 of file blenkernel/intern/fcurve.cc.
References BLI_assert_unreachable, BLO_read_float_array(), BLO_read_struct_array, BLO_read_struct_by_name_array(), curve, FMod_Envelope::data, fmodifier_get_typeinfo(), FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_GENERATOR, LISTBASE_FOREACH, and FModifierTypeInfo::struct_name.
Referenced by BKE_fcurve_blend_read_data(), and blend_data_read_nla_strips().
| void BKE_fmodifiers_blend_write | ( | BlendWriter * | writer, |
| ListBase * | fmodifiers ) |
Definition at line 2464 of file blenkernel/intern/fcurve.cc.
References BLO_write_float_array(), BLO_write_struct_array, BLO_write_struct_by_name(), BLO_write_struct_list, fmodifier_get_typeinfo(), FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_GENERATOR, LISTBASE_FOREACH, and FModifierTypeInfo::struct_name.
Referenced by BKE_fcurve_blend_write_data(), and blend_write_nla_strips().
|
static |
Definition at line 644 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, calculate_bezt_bounds_x(), calculate_bezt_bounds_y(), get_bounding_bezt_indices(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BKE_fcurve_calc_bounds().
|
static |
Definition at line 598 of file blenkernel/intern/fcurve.cc.
References max_fff(), min_fff(), and BezTriple::vec.
Referenced by BKE_fcurve_calc_range(), and calculate_bezt_bounds().
|
static |
Definition at line 617 of file blenkernel/intern/fcurve.cc.
References BEZT_ISSEL_ANY, max_ff(), max_fff(), min_ff(), min_fff(), and BezTriple::vec.
Referenced by calculate_bezt_bounds().
| float calculate_fcurve | ( | PathResolvedRNA * | anim_rna, |
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Calculate the value of the given F-Curve at the given frame, and store it's value in FCurve.curval.
Definition at line 2435 of file blenkernel/intern/fcurve.cc.
References BKE_fcurve_is_empty(), FCurve::curval, FCurve::driver, AnimationEvalContext::eval_time, evaluate_fcurve(), and evaluate_fcurve_driver().
Referenced by animsys_blend_in_fcurves(), animsys_evaluate_action_group(), animsys_evaluate_drivers(), animsys_evaluate_fcurves(), animsys_quaternion_evaluate_fcurves(), BKE_animsys_eval_driver(), blender::animrig::evaluate_keyframe_data(), and fcurve_is_changed().
|
static |
Definition at line 667 of file blenkernel/intern/fcurve.cc.
References BLI_rctf_is_valid(), clamp_i(), FCurve::fpt, max_ff(), min_ff(), FCurve::totvert, FPoint::vec, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BKE_fcurve_calc_bounds().
|
static |
Definition at line 1157 of file blenkernel/intern/fcurve.cc.
References add_v3_v3(), and sub_v3_v3v3().
Definition at line 2366 of file blenkernel/intern/fcurve.cc.
References BLI_assert, FCurve::driver, evaltime, and evaluate_fcurve_ex().
Referenced by BCAnimationCurve::adjust_range(), blender::animrig::bake_fcurve_segments(), BKE_tracking_track_get_weight_for_marker(), calculate_fcurve(), draw_fcurve_curve(), draw_fcurve_curve_keys(), draw_seq_fcurve_overlay(), draw_seq_waveform_overlay(), AnimationImporter::evaluate_animation(), fcurve_samplingcb_evalcurve(), fetch_from_fcurve(), get_animated_weight(), BCAnimationCurve::get_value(), libmv_tracks_new(), blender::animrig::new_key_needed(), nla_draw_strip_curves(), nlasnapshot_from_action(), paste_get_y_offset(), pose_slide_apply_quat(), pose_slide_apply_val(), propagate_curve_values(), rectf_curve_zone_y(), blender::animrig::sample_fcurve_segment(), seq_effect_speed_rebuild_map(), seq_render_effect_strip_impl(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::animrig::tests::TEST_F(), and time_offset_fcurve_segment().
| float evaluate_fcurve_driver | ( | PathResolvedRNA * | anim_rna, |
| FCurve * | fcu, | ||
| ChannelDriver * | driver_orig, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Definition at line 2381 of file blenkernel/intern/fcurve.cc.
References BLI_assert, FCurve::driver, AnimationEvalContext::eval_time, evaltime, evaluate_driver(), evaluate_fcurve_ex(), FMODIFIER_FLAG_RANGERESTRICT, LISTBASE_FOREACH, FCurve::modifiers, and FCurve::totvert.
Referenced by calculate_fcurve().
Definition at line 2331 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BLI_listbase_count(), FModifiersStackStorage::buffer, evaltime, evaluate_fmodifiers_storage_size_per_modifier(), evaluate_time_fmodifiers(), evaluate_value_fmodifiers(), fcurve_eval_keyframes(), fcurve_eval_samples(), FCURVE_INT_VALUES, FCurve::flag, floorf, FCurve::fpt, FModifiersStackStorage::modifier_count, FCurve::modifiers, and FModifiersStackStorage::size_per_modifier.
Referenced by evaluate_fcurve(), evaluate_fcurve_driver(), and evaluate_fcurve_only_curve().
Definition at line 2373 of file blenkernel/intern/fcurve.cc.
References evaltime, and evaluate_fcurve_ex().
Referenced by action_flip_pchan_cache_init(), fcurve_scene_coord_range_get(), and insert_graph_keys().
|
static |
Definition at line 1547 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, MEM_SAFE_FREE, and FCurve::totvert.
Referenced by BKE_fcurve_bezt_shrink(), BKE_fcurve_delete_key(), BKE_fcurve_delete_keys(), BKE_fcurve_delete_keys_all(), and BKE_fcurve_delete_keys_selected().
|
static |
Definition at line 2272 of file blenkernel/intern/fcurve.cc.
References evaltime, fcurve_eval_keyframes_extrapolate(), fcurve_eval_keyframes_interpolate(), FCurve::totvert, and BezTriple::vec.
Referenced by evaluate_fcurve_ex().
|
static |
Definition at line 1956 of file blenkernel/intern/fcurve.cc.
References BEZT_IPO_CONST, BEZT_IPO_LIN, evaltime, FCurve::extend, FCURVE_DISCRETE_VALUES, FCURVE_EXTRAPOLATE_CONSTANT, FCurve::flag, BezTriple::ipo, FCurve::totvert, and BezTriple::vec.
Referenced by fcurve_eval_keyframes().
|
static |
Definition at line 2008 of file blenkernel/intern/fcurve.cc.
References BezTriple::amplitude, BezTriple::back, berekeny(), BEZT_IPO_BACK, BEZT_IPO_BEZ, BEZT_IPO_BOUNCE, BEZT_IPO_CIRC, BEZT_IPO_CONST, BEZT_IPO_CUBIC, BEZT_IPO_EASE_IN, BEZT_IPO_EASE_IN_OUT, BEZT_IPO_EASE_OUT, BEZT_IPO_ELASTIC, BEZT_IPO_EXPO, BEZT_IPO_LIN, BEZT_IPO_QUAD, BEZT_IPO_QUART, BEZT_IPO_QUINT, BEZT_IPO_SINE, BKE_fcurve_bezt_binarysearch_index_ex(), BKE_fcurve_correct_bezpart(), BLI_easing_back_ease_in(), BLI_easing_back_ease_in_out(), BLI_easing_back_ease_out(), BLI_easing_bounce_ease_in(), BLI_easing_bounce_ease_in_out(), BLI_easing_bounce_ease_out(), BLI_easing_circ_ease_in(), BLI_easing_circ_ease_in_out(), BLI_easing_circ_ease_out(), BLI_easing_cubic_ease_in(), BLI_easing_cubic_ease_in_out(), BLI_easing_cubic_ease_out(), BLI_easing_elastic_ease_in(), BLI_easing_elastic_ease_in_out(), BLI_easing_elastic_ease_out(), BLI_easing_expo_ease_in(), BLI_easing_expo_ease_in_out(), BLI_easing_expo_ease_out(), BLI_easing_linear_ease(), BLI_easing_quad_ease_in(), BLI_easing_quad_ease_in_out(), BLI_easing_quad_ease_out(), BLI_easing_quart_ease_in(), BLI_easing_quart_ease_in_out(), BLI_easing_quart_ease_out(), BLI_easing_quint_ease_in(), BLI_easing_quint_ease_in_out(), BLI_easing_quint_ease_out(), BLI_easing_sine_ease_in(), BLI_easing_sine_ease_in_out(), BLI_easing_sine_ease_out(), BezTriple::easing, eps, evaltime, fabsf, FCURVE_DISCRETE_VALUES, findzero(), FCurve::flag, G, G_DEBUG, BezTriple::ipo, BezTriple::period, printf, FCurve::totvert, v2, and BezTriple::vec.
Referenced by fcurve_eval_keyframes().
Definition at line 2287 of file blenkernel/intern/fcurve.cc.
References evaltime, fabsf, floorf, int, interpf(), FCurve::totvert, and FPoint::vec.
Referenced by evaluate_fcurve_ex().
Convert baked/sampled f-curves into bezt/regular f-curves.
Definition at line 1038 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_handles_recalc(), CLOG_ERROR, copy_v2_v2(), float, FCurve::fpt, init_unbaked_bezt_data(), LOG, MEM_callocN, MEM_freeN(), MEM_SAFE_FREE, FCurve::totvert, BezTriple::vec, and FPoint::vec.
Referenced by convert_samples_to_keys().
Basic sampling callback which acts as a wrapper for evaluate_fcurve() 'data' arg here is unneeded here.
Definition at line 986 of file blenkernel/intern/fcurve.cc.
References evaltime, and evaluate_fcurve().
Referenced by convert_keys_to_samples(), create_ghost_curves(), fcurve_bake_modifiers(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| void fcurve_store_samples | ( | FCurve * | fcu, |
| void * | data, | ||
| int | start, | ||
| int | end, | ||
| FcuSampleFunc | sample_cb ) |
Main API function for creating a set of sampled curve data, given some callback function used to retrieve the values to store.
Definition at line 992 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, CLOG_ERROR, ELEM, float, FCurve::fpt, LOG, MEM_callocN, MEM_freeN(), FCurve::totvert, and FPoint::vec.
Referenced by convert_keys_to_samples(), fcurve_bake_modifiers(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
Definition at line 1521 of file blenkernel/intern/fcurve.cc.
References q1, solve_cubic(), and x.
Referenced by BKE_fcurve_bezt_subdivide_handles(), and fcurve_eval_keyframes_interpolate().
|
static |
Get the first and last index to the bezt array that satisfies the given parameters.
| selected_keys_only | Only accept indices of bezt that are selected. Is a subset of frame_range. |
| frame_range | Only consider keyframes in that frame interval. Can be nullptr. |
Definition at line 535 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BEZT_ISSEL_ANY, BKE_fcurve_bezt_binarysearch_index(), clamp_i(), and FCurve::totvert.
Referenced by BKE_fcurve_calc_range(), and calculate_bezt_bounds().
| FCurve * id_data_find_fcurve | ( | ID * | id, |
| void * | data, | ||
| StructRNA * | type, | ||
| const char * | prop_name, | ||
| int | index, | ||
| bool * | r_driven ) |
High level function to get an f-curve from C without having the RNA.
If there is an action assigned to the id's AnimData, it will be searched for a matching F-curve first. Drivers are searched only if no valid action F-curve could be found.
r_driven) is optional and may be NULL.r_driven to True in case a valid driver F-curve is found, but will not return said F-curve. In other words:FCurve* and *r_driven = false.NULL and *r_driven = true.NULL and *r_driven = false. Definition at line 211 of file blenkernel/intern/fcurve.cc.
References AnimData::action, BKE_animadata_fcurve_find_by_rna_path(), BKE_animdata_from_id(), ELEM, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create(), and RNA_struct_find_property().
Referenced by BKE_tracking_track_get_weight_for_marker(), do_versions_sequencer_speed_effect_recursive(), libmv_tracks_new(), retrieve_stab_animation(), retrieve_track_weight_animation(), seq_effect_speed_speed_factor_curve_get(), seq_render_effect_strip_impl(), sound_update_animation_flags(), sound_update_animation_flags_fn(), and strip_draw_context_curve_get().
|
static |
Definition at line 1030 of file blenkernel/intern/fcurve.cc.
References BEZT_IPO_LIN, BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, BezTriple::ipo, and SELECT.
Referenced by fcurve_samples_to_keyframes().
Find roots of cubic equation (c0 + c1 x + c2 x^2 + c3 x^3)
o.o. Definition at line 1409 of file blenkernel/intern/fcurve.cc.
References b, cos(), float, SMALL, sqrt(), and sqrt3d().
Referenced by findzero().
| void sort_time_fcurve | ( | FCurve * | fcu | ) |
This function sorts BezTriples so that they are arranged in chronological order, as tools working on F-Curves expect that the BezTriples are in order.
Definition at line 1280 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, CLAMP_MAX, CLAMP_MIN, swap_v2_v2(), FCurve::totvert, and BezTriple::vec.
Referenced by ANIM_animdata_update(), graphedit_activekey_update_cb(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| bool test_time_fcurve | ( | FCurve * | fcu | ) |
This function tests if any BezTriples are out of order, thus requiring a sort.
Definition at line 1322 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, FCurve::fpt, FCurve::totvert, BezTriple::vec, and FPoint::vec.
Referenced by recalcData_graphedit().
| void testhandles_fcurve | ( | FCurve * | fcu, |
| eBezTriple_Flag | sel_flag, | ||
| bool | use_handle ) |
Update handles, making sure the handle-types are valid (e.g. correctly deduced from an "Auto" type), and recalculating their position vectors. Use when something has changed handle positions.
| sel_flag | The flag (bezt.f1/2/3) value to use to determine selection. Usually SELECT, but may want to use a different one at times (if caller does not operate on selection). |
| use_handle | Check selection state of individual handles, otherwise always update both handles if the key is selected. |
Definition at line 1261 of file blenkernel/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_handles_recalc_ex(), BKE_nurb_bezt_handle_test(), ELEM, NURB_HANDLE_TEST_EACH, NURB_HANDLE_TEST_KNOT_ONLY, and FCurve::totvert.
Referenced by BKE_fcurve_merge_duplicate_keys(), and createTransGraphEditData().
|
static |
Definition at line 58 of file blenkernel/intern/fcurve.cc.
Referenced by BKE_fcurve_bezt_binarysearch_index_ex(), fcurve_samples_to_keyframes(), and fcurve_store_samples().