Blender  V2.93
Functions | Variables
drivers.c File Reference
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_texture_types.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "ED_keyframing.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "anim_intern.h"

Go to the source code of this file.

Functions

FCurveverify_driver_fcurve (ID *id, const char rna_path[], const int array_index, eDriverFCurveCreationMode creation_mode)
 
struct FCurvealloc_driver_fcurve (const char rna_path[], const int array_index, eDriverFCurveCreationMode creation_mode)
 
static int add_driver_with_target (ReportList *UNUSED(reports), ID *dst_id, const char dst_path[], int dst_index, ID *src_id, const char src_path[], int src_index, PointerRNA *dst_ptr, PropertyRNA *dst_prop, PointerRNA *src_ptr, PropertyRNA *src_prop, short flag, int driver_type)
 
int ANIM_add_driver_with_target (ReportList *reports, ID *dst_id, const char dst_path[], int dst_index, ID *src_id, const char src_path[], int src_index, short flag, int driver_type, short mapping_type)
 
int ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type)
 
bool ANIM_remove_driver (ReportList *UNUSED(reports), ID *id, const char rna_path[], int array_index, short UNUSED(flag))
 
void ANIM_drivers_copybuf_free (void)
 
bool ANIM_driver_can_paste (void)
 
bool ANIM_copy_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag))
 
bool ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag))
 
void ANIM_driver_vars_copybuf_free (void)
 
bool ANIM_driver_vars_can_paste (void)
 
bool ANIM_driver_vars_copy (ReportList *reports, FCurve *fcu)
 
bool ANIM_driver_vars_paste (ReportList *reports, FCurve *fcu, bool replace)
 
void ANIM_copy_as_driver (struct ID *target_id, const char *target_path, const char *var_name)
 
static const EnumPropertyItemdriver_mapping_type_itemsf (bContext *C, PointerRNA *UNUSED(owner_ptr), PropertyRNA *UNUSED(owner_prop), bool *r_free)
 
static bool add_driver_button_poll (bContext *C)
 
static int add_driver_button_none (bContext *C, wmOperator *op, short mapping_type)
 
static int add_driver_button_menu_exec (bContext *C, wmOperator *op)
 
static int add_driver_button_menu_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static void UNUSED_FUNCTION() ANIM_OT_driver_button_add_menu (wmOperatorType *ot)
 
static int add_driver_button_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void ANIM_OT_driver_button_add (wmOperatorType *ot)
 
static int remove_driver_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_driver_button_remove (wmOperatorType *ot)
 
static int edit_driver_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_driver_button_edit (wmOperatorType *ot)
 
static int copy_driver_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_copy_driver_button (wmOperatorType *ot)
 
static int paste_driver_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_paste_driver_button (wmOperatorType *ot)
 

Variables

static FCurvechanneldriver_copypaste_buf = NULL
 
static ListBase driver_vars_copybuf = {NULL, NULL}
 
EnumPropertyItem prop_driver_create_mapping_types []
 

Function Documentation

◆ add_driver_button_invoke()

static int add_driver_button_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ add_driver_button_menu_exec()

static int add_driver_button_menu_exec ( bContext C,
wmOperator op 
)
static

◆ add_driver_button_menu_invoke()

static int add_driver_button_menu_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ add_driver_button_none()

static int add_driver_button_none ( bContext C,
wmOperator op,
short  mapping_type 
)
static

◆ add_driver_button_poll()

static bool add_driver_button_poll ( bContext C)
static

◆ add_driver_with_target()

static int add_driver_with_target ( ReportList UNUSEDreports,
ID dst_id,
const char  dst_path[],
int  dst_index,
ID src_id,
const char  src_path[],
int  src_index,
PointerRNA dst_ptr,
PropertyRNA dst_prop,
PointerRNA src_ptr,
PropertyRNA src_prop,
short  flag,
int  driver_type 
)
static

◆ alloc_driver_fcurve()

struct FCurve* alloc_driver_fcurve ( const char  rna_path[],
const int  array_index,
eDriverFCurveCreationMode  creation_mode 
)

◆ ANIM_add_driver()

int ANIM_add_driver ( ReportList reports,
ID id,
const char  rna_path[],
int  array_index,
short  flag,
int  type 
)

◆ ANIM_add_driver_with_target()

int ANIM_add_driver_with_target ( ReportList reports,
ID dst_id,
const char  dst_path[],
int  dst_index,
ID src_id,
const char  src_path[],
int  src_index,
short  flag,
int  driver_type,
short  mapping_type 
)

◆ ANIM_copy_as_driver()

void ANIM_copy_as_driver ( struct ID target_id,
const char *  target_path,
const char *  var_name 
)

◆ ANIM_copy_driver()

bool ANIM_copy_driver ( ReportList reports,
ID id,
const char  rna_path[],
int  array_index,
short   UNUSEDflag 
)

◆ ANIM_driver_can_paste()

bool ANIM_driver_can_paste ( void  )

Definition at line 617 of file drivers.c.

References channeldriver_copypaste_buf, and NULL.

Referenced by ui_popup_context_menu_for_button().

◆ ANIM_driver_vars_can_paste()

bool ANIM_driver_vars_can_paste ( void  )

Definition at line 754 of file drivers.c.

References BLI_listbase_is_empty(), and driver_vars_copybuf.

◆ ANIM_driver_vars_copy()

bool ANIM_driver_vars_copy ( ReportList reports,
FCurve fcu 
)

◆ ANIM_driver_vars_copybuf_free()

void ANIM_driver_vars_copybuf_free ( void  )

◆ ANIM_driver_vars_paste()

bool ANIM_driver_vars_paste ( ReportList reports,
FCurve fcu,
bool  replace 
)

Definition at line 785 of file drivers.c.

References FCurve::driver, and NULL.

Referenced by graph_driver_vars_paste_exec().

◆ ANIM_drivers_copybuf_free()

void ANIM_drivers_copybuf_free ( void  )

Definition at line 607 of file drivers.c.

References BKE_fcurve_free(), channeldriver_copypaste_buf, and NULL.

Referenced by ANIM_copy_as_driver(), ANIM_copy_driver(), and WM_exit_ex().

◆ ANIM_OT_copy_driver_button()

void ANIM_OT_copy_driver_button ( wmOperatorType ot)

◆ ANIM_OT_driver_button_add()

void ANIM_OT_driver_button_add ( wmOperatorType ot)

◆ ANIM_OT_driver_button_add_menu()

static void UNUSED_FUNCTION() ANIM_OT_driver_button_add_menu ( wmOperatorType ot)
static

◆ ANIM_OT_driver_button_edit()

void ANIM_OT_driver_button_edit ( wmOperatorType ot)

◆ ANIM_OT_driver_button_remove()

void ANIM_OT_driver_button_remove ( wmOperatorType ot)

◆ ANIM_OT_paste_driver_button()

void ANIM_OT_paste_driver_button ( wmOperatorType ot)

◆ ANIM_paste_driver()

bool ANIM_paste_driver ( ReportList reports,
ID id,
const char  rna_path[],
int  array_index,
short   UNUSEDflag 
)

◆ ANIM_remove_driver()

bool ANIM_remove_driver ( ReportList UNUSEDreports,
ID id,
const char  rna_path[],
int  array_index,
short   UNUSEDflag 
)

◆ copy_driver_button_exec()

static int copy_driver_button_exec ( bContext C,
wmOperator op 
)
static

◆ driver_mapping_type_itemsf()

static const EnumPropertyItem* driver_mapping_type_itemsf ( bContext C,
PointerRNA UNUSEDowner_ptr,
PropertyRNA UNUSEDowner_prop,
bool *  r_free 
)
static

◆ edit_driver_button_exec()

static int edit_driver_button_exec ( bContext C,
wmOperator op 
)
static

◆ paste_driver_button_exec()

static int paste_driver_button_exec ( bContext C,
wmOperator op 
)
static

◆ remove_driver_button_exec()

static int remove_driver_button_exec ( bContext C,
wmOperator op 
)
static

◆ verify_driver_fcurve()

FCurve* verify_driver_fcurve ( ID id,
const char  rna_path[],
const int  array_index,
eDriverFCurveCreationMode  creation_mode 
)

Variable Documentation

◆ channeldriver_copypaste_buf

FCurve* channeldriver_copypaste_buf = NULL
static

◆ driver_vars_copybuf

ListBase driver_vars_copybuf = {NULL, NULL}
static

◆ prop_driver_create_mapping_types

EnumPropertyItem prop_driver_create_mapping_types[]
Initial value:
= {
"SINGLE_MANY",
0,
"All from Target",
"Drive all components of this property using the target picked"},
"DIRECT",
0,
"Single from Target",
"Drive this component of this property using the target picked"},
"MATCH",
ICON_COLOR,
"Match Indices",
"Create drivers for each pair of corresponding elements"},
"NONE_ALL",
ICON_HAND,
"Manually Create Later",
"Create drivers for all properties without assigning any targets yet"},
"NONE_SINGLE",
0,
"Manually Create Later (Single)",
"Create driver for this property only and without assigning any targets yet"},
{0, NULL, 0, NULL, NULL},
}
@ CREATEDRIVER_MAPPING_NONE_ALL
@ CREATEDRIVER_MAPPING_1_N
@ CREATEDRIVER_MAPPING_NONE
@ CREATEDRIVER_MAPPING_N_N
@ CREATEDRIVER_MAPPING_1_1

Mapping Types enum for operators.

Note
Used by ANIM_OT_driver_button_add and UI_OT_eyedropper_driver.

XXX: These names need reviewing.

Definition at line 891 of file drivers.c.

Referenced by ANIM_OT_driver_button_add_menu(), driver_mapping_type_itemsf(), and UI_OT_eyedropper_driver().