Blender
V3.3
|
#include "DNA_curve_types.h"
Go to the source code of this file.
Macros | |
#define | DRIVER_TARGETS_LOOPER_BEGIN(dvar) |
#define | DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar) |
#define | DRIVER_TARGETS_LOOPER_END |
#define DRIVER_TARGETS_LOOPER_BEGIN | ( | dvar | ) |
Definition at line 33 of file BKE_fcurve_driver.h.
#define DRIVER_TARGETS_LOOPER_END |
Definition at line 47 of file BKE_fcurve_driver.h.
#define DRIVER_TARGETS_USED_LOOPER_BEGIN | ( | dvar | ) |
Definition at line 40 of file BKE_fcurve_driver.h.
bool BKE_driver_expression_depends_on_time | ( | struct ChannelDriver * | driver | ) |
Check if the expression in the driver may depend on the current frame.
Definition at line 1083 of file fcurve_driver.c.
References BKE_driver_has_simple_expression(), driver_check_simple_expr_depends_on_time(), DRIVER_TYPE_PYTHON, ChannelDriver::expr_simple, ChannelDriver::expression, python_driver_exression_depends_on_time(), and ChannelDriver::type.
bool BKE_driver_has_simple_expression | ( | struct ChannelDriver * | driver | ) |
Check if the expression in the driver conforms to the simple subset.
Definition at line 1057 of file fcurve_driver.c.
References BLI_expr_pylike_is_valid(), driver_compile_simple_expr(), and ChannelDriver::expr_simple.
Referenced by BKE_driver_expression_depends_on_time(), and graph_draw_driver_settings_panel().
void BKE_driver_invalidate_expression | ( | struct ChannelDriver * | driver, |
bool | expr_changed, | ||
bool | varname_changed | ||
) |
Reset cached compiled expression data.
Definition at line 1098 of file fcurve_driver.c.
References BLI_expr_pylike_free(), DRIVER_FLAG_RECOMPILE, DRIVER_FLAG_RENAMEVAR, ChannelDriver::expr_simple, ChannelDriver::flag, and NULL.
Referenced by driver_add_new_variable(), driver_free_variable_ex(), ui_but_anim_expression_create(), and ui_but_anim_expression_set().
void BKE_driver_target_matrix_to_rot_channels | ( | float | mat[4][4], |
int | auto_order, | ||
int | rotation_mode, | ||
int | channel, | ||
bool | angles, | ||
float | r_buf[4] | ||
) |
Compute channel values for a rotational Transform Channel driver variable.
Definition at line 599 of file fcurve_driver.c.
References BLI_assert, DTAR_ROTMODE_AUTO, DTAR_ROTMODE_EULER_MAX, DTAR_ROTMODE_EULER_MIN, DTAR_ROTMODE_QUATERNION, DTAR_ROTMODE_SWING_TWIST_X, DTAR_ROTMODE_SWING_TWIST_Z, mat4_to_eulO(), mat4_to_quat(), NULL, quat_split_swing_and_twist(), quaternion_to_angles(), and zero_v4().
Referenced by transform_evaluate().
struct DriverVar* driver_add_new_variable | ( | struct ChannelDriver * | driver | ) |
Add a new driver variable.
Definition at line 851 of file fcurve_driver.c.
References BKE_driver_invalidate_expression(), BLI_addtail(), BLI_uniquename(), BLT_I18NCONTEXT_ID_ACTION, CTX_DATA_, driver_change_variable_type(), DVAR_TYPE_SINGLE_PROP, MEM_callocN, DriverVar::name, NULL, and ChannelDriver::variables.
Referenced by add_driver_with_target(), ANIM_add_driver(), ANIM_copy_as_driver(), driver_add_var_cb(), and idriver_to_cdriver().
Change the type of driver variable.
Definition at line 747 of file fcurve_driver.c.
References DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, DTAR_FLAG_ID_OB_ONLY, ELEM, get_dvar_typeinfo(), ID_OB, NULL, DriverVarTypeInfo::num_targets, DriverVar::num_targets, DriverVarTypeInfo::target_flags, type, and DriverVar::type.
Referenced by add_driver_with_target(), ANIM_add_driver(), driver_add_new_variable(), and idriver_to_cdriver().
Perform actual freeing driver variable and remove it from the given list.
Definition at line 697 of file fcurve_driver.c.
References BLI_freelinkN(), DRIVER_TARGETS_LOOPER_BEGIN, DRIVER_TARGETS_LOOPER_END, MEM_freeN, and NULL.
Referenced by ANIM_driver_vars_copybuf_free(), and driver_free_variable_ex().
void driver_free_variable_ex | ( | struct ChannelDriver * | driver, |
struct DriverVar * | dvar | ||
) |
Free the driver variable and do extra updates.
Definition at line 721 of file fcurve_driver.c.
References BKE_driver_invalidate_expression(), driver_free_variable(), and ChannelDriver::variables.
Referenced by driver_delete_var_cb(), and fcurve_free_driver().
bool driver_get_variable_property | ( | struct ChannelDriver * | driver, |
struct DriverTarget * | dtar, | ||
struct PointerRNA * | r_ptr, | ||
struct PropertyRNA ** | r_prop, | ||
int * | r_index | ||
) |
Same as 'dtar_get_prop_val'. but get the RNA property.
Definition at line 180 of file fcurve_driver.c.
References CLOG_ERROR, DRIVER_FLAG_INVALID, DTAR_FLAG_INVALID, ELEM, DriverTarget::flag, ChannelDriver::flag, G, G_DEBUG, id, DriverTarget::id, LOG, ID::name, NULL, PointerRNA_NULL, ptr, RNA_id_pointer_create(), DriverTarget::rna_path, and RNA_path_resolve_full().
Referenced by pyrna_driver_get_variable_value().
float driver_get_variable_value | ( | struct ChannelDriver * | driver, |
struct DriverVar * | dvar | ||
) |
Evaluate a Driver Variable to get a value that contributes to the final.
Definition at line 1124 of file fcurve_driver.c.
References DriverVar::curval, ELEM, get_dvar_typeinfo(), DriverVarTypeInfo::get_value, NULL, and DriverVar::type.
Referenced by BPY_driver_exec(), driver_evaluate_simple_expr(), evaluate_driver_min_max(), and evaluate_driver_sum().
Validate driver variable name (after being renamed).
Definition at line 776 of file fcurve_driver.c.
References BPY_string_is_keyword(), DVAR_ALL_INVALID_FLAGS, DVAR_FLAG_INVALID_EMPTY, DVAR_FLAG_INVALID_HAS_DOT, DVAR_FLAG_INVALID_HAS_SPACE, DVAR_FLAG_INVALID_HAS_SPECIAL, DVAR_FLAG_INVALID_NAME, DVAR_FLAG_INVALID_PY_KEYWORD, DVAR_FLAG_INVALID_START_CHAR, DVAR_FLAG_INVALID_START_NUM, DriverVar::flag, IN_RANGE_INCL, DriverVar::name, and NULL.
Ensure the driver variable's name is unique.
Assumes the driver variable has already been assigned to the driver, so that the prev/next
pointers can be used to find the other variables.
Definition at line 845 of file fcurve_driver.c.
References BLI_listbase_from_link(), BLI_uniquename(), and DriverVar::name.
Copy driver variables from src_vars list to dst_vars list.
Referenced by ANIM_copy_as_driver(), and ANIM_driver_vars_copy().
float evaluate_driver | ( | struct PathResolvedRNA * | anim_rna, |
struct ChannelDriver * | driver, | ||
struct ChannelDriver * | driver_orig, | ||
const struct AnimationEvalContext * | anim_eval_context | ||
) |
Evaluate an Channel-Driver to get a 'time' value to use instead of anim_eval_context->eval_time
.
anim_eval_context->eval_time
is the frame at which F-Curve is being evaluated.Referenced by evaluate_fcurve_driver(), and insert_keyframe_value().
struct ChannelDriver* fcurve_copy_driver | ( | const struct ChannelDriver * | driver | ) |
This makes a copy of the given driver.
Referenced by ANIM_paste_driver(), and BKE_fcurve_copy().
This frees the driver itself.
Definition at line 883 of file fcurve_driver.c.
References BLI_expr_pylike_free(), BPY_DECREF(), FCurve::driver, driver_free_variable_ex(), ELEM, ChannelDriver::expr_comp, ChannelDriver::expr_simple, ListBase::first, MEM_freeN, DriverVar::next, NULL, and ChannelDriver::variables.
Referenced by BKE_fcurve_free().