Blender  V3.3
Macros | Functions
BKE_fcurve_driver.h File Reference
#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
 

Functions

void fcurve_free_driver (struct FCurve *fcu)
 
struct ChannelDriverfcurve_copy_driver (const struct ChannelDriver *driver)
 
void driver_variables_copy (struct ListBase *dst_vars, const struct ListBase *src_vars)
 
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])
 
void driver_free_variable (struct ListBase *variables, struct DriverVar *dvar)
 
void driver_free_variable_ex (struct ChannelDriver *driver, struct DriverVar *dvar)
 
void driver_change_variable_type (struct DriverVar *dvar, int type)
 
void driver_variable_name_validate (struct DriverVar *dvar)
 
void driver_variable_unique_name (struct DriverVar *dvar)
 
struct DriverVardriver_add_new_variable (struct ChannelDriver *driver)
 
float driver_get_variable_value (struct ChannelDriver *driver, struct DriverVar *dvar)
 
bool driver_get_variable_property (struct ChannelDriver *driver, struct DriverTarget *dtar, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index)
 
bool BKE_driver_has_simple_expression (struct ChannelDriver *driver)
 
bool BKE_driver_expression_depends_on_time (struct ChannelDriver *driver)
 
void BKE_driver_invalidate_expression (struct ChannelDriver *driver, bool expr_changed, bool varname_changed)
 
float evaluate_driver (struct PathResolvedRNA *anim_rna, struct ChannelDriver *driver, struct ChannelDriver *driver_orig, const struct AnimationEvalContext *anim_eval_context)
 

Macro Definition Documentation

◆ DRIVER_TARGETS_LOOPER_BEGIN

#define DRIVER_TARGETS_LOOPER_BEGIN (   dvar)
Value:
{ \
DriverTarget *dtar = &dvar->targets[0]; \
int tarIndex = 0; \
for (; tarIndex < MAX_DRIVER_TARGETS; tarIndex++, dtar++)
#define MAX_DRIVER_TARGETS

Definition at line 33 of file BKE_fcurve_driver.h.

◆ DRIVER_TARGETS_LOOPER_END

#define DRIVER_TARGETS_LOOPER_END
Value:
} \
((void)0)
SyclQueue void void size_t num_bytes void

Definition at line 47 of file BKE_fcurve_driver.h.

◆ DRIVER_TARGETS_USED_LOOPER_BEGIN

#define DRIVER_TARGETS_USED_LOOPER_BEGIN (   dvar)
Value:
{ \
DriverTarget *dtar = &dvar->targets[0]; \
int tarIndex = 0; \
for (; tarIndex < dvar->num_targets; tarIndex++, dtar++)

Definition at line 40 of file BKE_fcurve_driver.h.

Function Documentation

◆ BKE_driver_expression_depends_on_time()

bool BKE_driver_expression_depends_on_time ( struct ChannelDriver driver)

◆ BKE_driver_has_simple_expression()

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().

◆ BKE_driver_invalidate_expression()

void BKE_driver_invalidate_expression ( struct ChannelDriver driver,
bool  expr_changed,
bool  varname_changed 
)

◆ BKE_driver_target_matrix_to_rot_channels()

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] 
)

◆ driver_add_new_variable()

struct DriverVar* driver_add_new_variable ( struct ChannelDriver driver)

◆ driver_change_variable_type()

void driver_change_variable_type ( struct DriverVar dvar,
int  type 
)

◆ driver_free_variable()

void driver_free_variable ( struct ListBase variables,
struct DriverVar dvar 
)

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().

◆ 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().

◆ driver_get_variable_property()

bool driver_get_variable_property ( struct ChannelDriver driver,
struct DriverTarget dtar,
struct PointerRNA r_ptr,
struct PropertyRNA **  r_prop,
int *  r_index 
)

◆ 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().

◆ driver_variable_name_validate()

void driver_variable_name_validate ( struct DriverVar dvar)

◆ driver_variable_unique_name()

void driver_variable_unique_name ( struct DriverVar dvar)

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.

◆ driver_variables_copy()

void driver_variables_copy ( struct ListBase dst_vars,
const struct ListBase src_vars 
)

Copy driver variables from src_vars list to dst_vars list.

Referenced by ANIM_copy_as_driver(), and ANIM_driver_vars_copy().

◆ evaluate_driver()

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.
  • Has to return a float value.
  • driver_orig is where we cache Python expressions, in case of COW

Referenced by evaluate_fcurve_driver(), and insert_keyframe_value().

◆ fcurve_copy_driver()

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().

◆ fcurve_free_driver()

void fcurve_free_driver ( struct FCurve fcu)