Blender V2.61 - r43446
|
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "BKE_animsys.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_context.h"
#include "BKE_report.h"
#include "BKE_material.h"
#include "BKE_texture.h"
#include "ED_keyframing.h"
#include "UI_interface.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 | |
void | free_anim_drivers_copybuf (void) |
FCurve * | verify_driver_fcurve (ID *id, const char rna_path[], const int array_index, short add) |
short | ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type) |
short | ANIM_remove_driver (ReportList *UNUSED(reports), ID *id, const char rna_path[], int array_index, short UNUSED(flag)) |
short | ANIM_driver_can_paste (void) |
short | ANIM_copy_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag)) |
short | ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag)) |
static char * | get_driver_path_hack (bContext *C, PointerRNA *ptr, PropertyRNA *prop) |
static int | add_driver_button_exec (bContext *C, wmOperator *op) |
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 | 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 FCurve * | channeldriver_copypaste_buf = NULL |
Definition in file drivers.c.
static int add_driver_button_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 479 of file drivers.c.
References ANIM_add_driver(), CREATEDRIVER_WITH_DEFAULT_DVAR, CTX_data_main(), DAG_ids_flush_update(), PointerRNA::data, DRIVER_TYPE_PYTHON, get_driver_path_hack(), PointerRNA::id, MEM_freeN(), NC_ANIMATION, ND_FCURVES_ORDER, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_property_animateable(), uiContextActiveProperty(), uiContextAnimUpdate(), and WM_event_add_notifier().
Referenced by ANIM_OT_driver_button_add().
short ANIM_add_driver | ( | ReportList * | reports, |
ID * | id, | ||
const char | rna_path[], | ||
int | array_index, | ||
short | flag, | ||
int | type | ||
) |
Definition at line 138 of file drivers.c.
References BKE_reportf(), BLI_snprintf(), BLI_strncpy(), CREATEDRIVER_WITH_DEFAULT_DVAR, FCurve::driver, driver_add_new_variable(), driver_change_variable_type(), DRIVER_TYPE_PYTHON, DVAR_TYPE_TRANSFORM_CHAN, ChannelDriver::expression, ID::name, NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, RNA_id_pointer_create(), RNA_path_resolve(), RNA_property_array_length(), RNA_property_boolean_get(), RNA_property_boolean_get_index(), RNA_property_float_get(), RNA_property_float_get_index(), RNA_property_int_get(), RNA_property_int_get_index(), RNA_property_type(), RPT_ERROR, ChannelDriver::type, simple_enum_gen::val, and verify_driver_fcurve().
Referenced by add_driver_button_exec(), do_outliner_drivers_editop(), and pyrna_struct_driver_add().
short ANIM_copy_driver | ( | ReportList * | reports, |
ID * | id, | ||
const char | rna_path[], | ||
int | array_index, | ||
short | UNUSEDflag | ||
) |
Definition at line 303 of file drivers.c.
References BKE_reportf(), copy_fcurve(), FCurve::driver, free_anim_drivers_copybuf(), ID::name, NULL, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve(), RPT_ERROR, and verify_driver_fcurve().
Referenced by copy_driver_button_exec().
short ANIM_driver_can_paste | ( | void | ) |
void ANIM_OT_copy_driver_button | ( | wmOperatorType * | ot | ) |
Definition at line 614 of file drivers.c.
References copy_driver_button_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by ED_operatortypes_anim().
void ANIM_OT_driver_button_add | ( | wmOperatorType * | ot | ) |
Definition at line 515 of file drivers.c.
References add_driver_button_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_driver_button_remove | ( | wmOperatorType * | ot | ) |
Definition at line 567 of file drivers.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, remove_driver_button_exec(), RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_paste_driver_button | ( | wmOperatorType * | ot | ) |
Definition at line 658 of file drivers.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and paste_driver_button_exec().
Referenced by ED_operatortypes_anim().
short ANIM_paste_driver | ( | ReportList * | reports, |
ID * | id, | ||
const char | rna_path[], | ||
int | array_index, | ||
short | UNUSEDflag | ||
) |
Definition at line 350 of file drivers.c.
References FCurve::bezt, BKE_report(), BKE_reportf(), copy_fmodifiers(), FCurve::driver, FCurve::extend, fcurve_copy_driver(), FCurve::fpt, MEM_dupallocN(), FCurve::modifiers, ID::name, NULL, RNA_id_pointer_create(), RNA_path_resolve(), RPT_ERROR, FCurve::totvert, and verify_driver_fcurve().
Referenced by paste_driver_button_exec().
short ANIM_remove_driver | ( | ReportList * | UNUSEDreports, |
ID * | id, | ||
const char | rna_path[], | ||
int | array_index, | ||
short | UNUSEDflag | ||
) |
Definition at line 232 of file drivers.c.
References BKE_animdata_from_id(), BLI_remlink(), AnimData::drivers, ListBase::first, free_fcurve(), iter_step_fcurve(), FCurve::next, NULL, and verify_driver_fcurve().
Referenced by do_outliner_drivers_editop(), driver_remove_cb(), pyrna_struct_driver_remove(), and remove_driver_button_exec().
static int copy_driver_button_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 587 of file drivers.c.
References ANIM_copy_driver(), PointerRNA::data, get_driver_path_hack(), PointerRNA::id, MEM_freeN(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RNA_property_animateable(), uiContextActiveProperty(), and uiContextAnimUpdate().
Referenced by ANIM_OT_copy_driver_button().
void free_anim_drivers_copybuf | ( | void | ) |
Definition at line 284 of file drivers.c.
References free_fcurve(), and NULL.
Referenced by ANIM_copy_driver(), and WM_exit_ext().
static char* get_driver_path_hack | ( | bContext * | C, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop | ||
) | [static] |
Definition at line 410 of file drivers.c.
References Object::actcol, BLI_sprintfN(), CTX_data_active_object(), CTX_wm_area(), PointerRNA::data, give_current_material(), give_current_material_texture(), GS, Material::id, Object::id, PointerRNA::id, Tex::id, ID_MA, ID_TE, MEM_freeN(), ID::name, RNA_path_from_ID_to_property(), RNA_pointer_create(), SPACE_BUTS, and PointerRNA::type.
Referenced by add_driver_button_exec(), copy_driver_button_exec(), paste_driver_button_exec(), and remove_driver_button_exec().
static int paste_driver_button_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 631 of file drivers.c.
References ANIM_paste_driver(), PointerRNA::data, get_driver_path_hack(), PointerRNA::id, MEM_freeN(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RNA_property_animateable(), uiContextActiveProperty(), and uiContextAnimUpdate().
Referenced by ANIM_OT_paste_driver_button().
static int remove_driver_button_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 535 of file drivers.c.
References ANIM_remove_driver(), CTX_data_main(), DAG_ids_flush_update(), PointerRNA::data, get_driver_path_hack(), PointerRNA::id, MEM_freeN(), NC_ANIMATION, ND_FCURVES_ORDER, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), uiContextActiveProperty(), uiContextAnimUpdate(), and WM_event_add_notifier().
Referenced by ANIM_OT_driver_button_remove().
FCurve* verify_driver_fcurve | ( | ID * | id, |
const char | rna_path[], | ||
const int | array_index, | ||
short | add | ||
) | [read] |
Definition at line 81 of file drivers.c.
References add_fmodifier(), FCurve::array_index, BKE_animdata_from_id(), BKE_id_add_animdata(), BLI_addtail(), BLI_strdupn(), FCurve::driver, AnimData::drivers, ELEM, FCURVE_SELECTED, FCURVE_VISIBLE, FCurve::flag, FMODIFIER_TYPE_GENERATOR, list_find_fcurve(), MEM_callocN(), FCurve::modifiers, NULL, FCurve::rna_path, and strlen().
Referenced by ANIM_add_driver(), ANIM_copy_driver(), ANIM_paste_driver(), ANIM_remove_driver(), and ui_but_anim_expression_create().
FCurve* channeldriver_copypaste_buf = NULL [static] |