|
Blender V4.5
|
Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::animrig |
Drivers | |
| enum | eCreateDriverFlags { CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0) , CREATEDRIVER_WITH_FMODIFIER = (1 << 1) } |
| enum | eCreateDriver_MappingTypes { CREATEDRIVER_MAPPING_1_N = 0 , CREATEDRIVER_MAPPING_1_1 = 1 , CREATEDRIVER_MAPPING_N_N = 2 , CREATEDRIVER_MAPPING_NONE = 3 , CREATEDRIVER_MAPPING_NONE_ALL = 4 } |
| enum | eDriverFCurveCreationMode { DRIVER_FCURVE_LOOKUP_ONLY = 0 , DRIVER_FCURVE_KEYFRAMES = 1 , DRIVER_FCURVE_GENERATOR = 2 , DRIVER_FCURVE_EMPTY = 3 } |
| const EnumPropertyItem | prop_driver_create_mapping_types [] |
| FCurve * | verify_driver_fcurve (ID *id, const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode) |
| FCurve * | alloc_driver_fcurve (const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode) |
| 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) |
| Main Driver Management API calls. | |
| int | ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type) |
| Main Driver Management API calls. | |
| bool | ANIM_remove_driver (ID *id, const char rna_path[], int array_index) |
| Main Driver Management API calls. | |
| void | ANIM_drivers_copybuf_free () |
| void | ANIM_driver_vars_copybuf_free () |
| bool | ANIM_driver_can_paste () |
| bool | ANIM_copy_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag) |
| Main Driver Management API calls. | |
| bool | ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag) |
| Main Driver Management API calls. | |
| bool | ANIM_driver_vars_can_paste () |
| 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 (ID *target_id, const char *target_path, const char *var_name) |
Heuristic to use for connecting target properties to driven ones
Definition at line 125 of file ED_keyframing.hh.
| enum eCreateDriverFlags |
Flags for use by driver creation calls
| Enumerator | |
|---|---|
| CREATEDRIVER_WITH_DEFAULT_DVAR | create drivers with a default variable for nicer UI |
| CREATEDRIVER_WITH_FMODIFIER | Create drivers with Generator FModifier (for backwards compatibility). |
Definition at line 117 of file ED_keyframing.hh.
Definition at line 149 of file ED_keyframing.hh.
| FCurve * alloc_driver_fcurve | ( | const char | rna_path[], |
| int | array_index, | ||
| eDriverFCurveCreationMode | creation_mode ) |
Definition at line 91 of file drivers.cc.
References add_fmodifier(), alloc_driver_fcurve(), FCurve::array_index, FCurve::auto_smoothing, BKE_fcurve_create(), BKE_fcurve_handles_recalc(), BLI_strdup(), FCurve::driver, DRIVER_FCURVE_EMPTY, DRIVER_FCURVE_GENERATOR, DRIVER_FCURVE_LOOKUP_ONLY, ELEM, FCurve::extend, FCURVE_EXTRAPOLATE_LINEAR, FCURVE_SELECTED, FCURVE_VISIBLE, FCurve::flag, FMODIFIER_TYPE_GENERATOR, blender::animrig::get_keyframe_settings(), blender::animrig::insert_vert_fcurve(), INSERTKEY_FAST, MEM_callocN(), FCurve::modifiers, FCurve::rna_path, and U.
Referenced by alloc_driver_fcurve(), ANIM_copy_as_driver(), and verify_driver_fcurve().
| int ANIM_add_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag, | ||
| int | type ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block
Definition at line 398 of file drivers.cc.
References ANIM_add_driver(), BKE_reportf(), BLI_snprintf(), BLI_str_rstrip_float_zero(), BLI_strncpy(), CREATEDRIVER_WITH_DEFAULT_DVAR, CREATEDRIVER_WITH_FMODIFIER, FCurve::driver, driver_add_new_variable(), driver_change_variable_type(), DRIVER_TYPE_PYTHON, DVAR_TYPE_TRANSFORM_CHAN, ChannelDriver::expression, ID::name, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, reports, RNA_id_pointer_create(), RNA_path_resolve_property(), 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, and verify_driver_fcurve().
Referenced by add_driver_button_invoke(), add_driver_button_none(), ANIM_add_driver(), ANIM_add_driver_with_target(), blender::ed::outliner::do_outliner_drivers_editop(), pyrna_struct_driver_add(), and blender::interface::tests::CopyDriversToSelected::SetUp().
| 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 ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block, and make it be driven by the specified target.
This is intended to be used in conjunction with a modal "eyedropper" for picking the variable that is going to be used to drive this one.
| flag | eCreateDriverFlags |
| driver_type | eDriver_Types |
| mapping_type | eCreateDriver_MappingTypes |
Definition at line 284 of file drivers.cc.
References add_driver_with_target(), ANIM_add_driver(), ANIM_add_driver_with_target(), BKE_reportf(), CREATEDRIVER_MAPPING_1_1, CREATEDRIVER_MAPPING_1_N, CREATEDRIVER_MAPPING_N_N, CREATEDRIVER_MAPPING_NONE, CREATEDRIVER_WITH_DEFAULT_DVAR, i, len(), ID::name, reports, RNA_id_pointer_create(), RNA_path_resolve_property(), RNA_property_array_check(), RNA_property_array_length(), and RPT_ERROR.
Referenced by ANIM_add_driver_with_target(), and driverdropper_sample().
| void ANIM_copy_as_driver | ( | ID * | target_id, |
| const char * | target_path, | ||
| const char * | var_name ) |
Create a driver & variable that reads the specified property, and store it in the buffers for Paste Driver and Paste Variables.
Definition at line 784 of file drivers.cc.
References alloc_driver_fcurve(), ANIM_copy_as_driver(), ANIM_driver_vars_copybuf_free(), ANIM_drivers_copybuf_free(), BLI_strdup(), channeldriver_copypaste_buf, FCurve::driver, driver_add_new_variable(), DRIVER_FCURVE_KEYFRAMES, driver_variables_copy(), driver_vars_copybuf, ChannelDriver::expression, GS, i, DriverTarget::id, DriverTarget::idtype, DriverVar::name, ID::name, DriverTarget::rna_path, STRNCPY(), DriverVar::targets, and ChannelDriver::variables.
Referenced by ANIM_copy_as_driver(), and copy_as_driver_button_exec().
| bool ANIM_copy_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag ) |
Main Driver Management API calls.
Make a copy of the driver for the specified property on the given ID block.
Definition at line 579 of file drivers.cc.
References ANIM_copy_driver(), ANIM_drivers_copybuf_free(), BKE_fcurve_copy(), BKE_reportf(), channeldriver_copypaste_buf, FCurve::driver, DRIVER_FCURVE_LOOKUP_ONLY, ID::name, reports, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, and verify_driver_fcurve().
Referenced by ANIM_copy_driver(), and copy_driver_button_exec().
| bool ANIM_driver_can_paste | ( | ) |
Returns whether there is a driver in the copy/paste buffer to paste.
Definition at line 572 of file drivers.cc.
References ANIM_driver_can_paste(), and channeldriver_copypaste_buf.
Referenced by ANIM_driver_can_paste(), and ui_popup_context_menu_for_button().
| bool ANIM_driver_vars_can_paste | ( | ) |
Checks if there are driver variables in the copy/paste buffer.
Definition at line 700 of file drivers.cc.
References ANIM_driver_vars_can_paste(), BLI_listbase_is_empty(), and driver_vars_copybuf.
Referenced by ANIM_driver_vars_can_paste().
| bool ANIM_driver_vars_copy | ( | ReportList * | reports, |
| FCurve * | fcu ) |
Copy the given driver's variables to the buffer.
Definition at line 707 of file drivers.cc.
References ANIM_driver_vars_copy(), ANIM_driver_vars_copybuf_free(), BKE_report(), BLI_listbase_is_empty(), FCurve::driver, driver_variables_copy(), driver_vars_copybuf, ELEM, reports, RPT_ERROR, and ChannelDriver::variables.
Referenced by ANIM_driver_vars_copy(), and graph_driver_vars_copy_exec().
| void ANIM_driver_vars_copybuf_free | ( | ) |
Clear copy-paste buffer for driver variable sets.
Definition at line 684 of file drivers.cc.
References ANIM_driver_vars_copybuf_free(), BLI_listbase_clear(), driver_free_variable(), driver_vars_copybuf, ListBase::first, and DriverVar::next.
Referenced by ANIM_copy_as_driver(), ANIM_driver_vars_copy(), ANIM_driver_vars_copybuf_free(), and WM_exit_ex().
| bool ANIM_driver_vars_paste | ( | ReportList * | reports, |
| FCurve * | fcu, | ||
| bool | replace ) |
Paste the variables in the buffer to the given FCurve.
Definition at line 729 of file drivers.cc.
References ANIM_driver_vars_paste(), BKE_driver_invalidate_expression(), BKE_report(), BLI_listbase_clear(), BLI_listbase_is_empty(), FCurve::driver, driver_free_variable_ex(), driver_variables_copy(), driver_vars_copybuf, ELEM, ListBase::first, ListBase::last, DriverVar::next, DriverVar::prev, reports, RPT_ERROR, and ChannelDriver::variables.
Referenced by ANIM_driver_vars_paste(), and graph_driver_vars_paste_exec().
| void ANIM_drivers_copybuf_free | ( | ) |
Clear copy-paste buffer for drivers.
Definition at line 563 of file drivers.cc.
References ANIM_drivers_copybuf_free(), BKE_fcurve_free(), and channeldriver_copypaste_buf.
Referenced by ANIM_copy_as_driver(), ANIM_copy_driver(), ANIM_drivers_copybuf_free(), and WM_exit_ex().
| const EnumPropertyItem * ANIM_keying_sets_enum_itemf | ( | bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| bool * | r_free ) |
Dynamically populate an enum of Keying Sets.
Definition at line 657 of file editors/animation/keyingsets.cc.
References Scene::active_keyingset, ANIM_keying_sets_enum_itemf(), build_keyingset_enum(), C, CTX_data_scene(), rna_enum_dummy_DEFAULT_items, RNA_enum_item_add(), and RNA_enum_item_add_separator().
Referenced by ANIM_keying_sets_enum_itemf(), ANIM_OT_keyframe_delete(), ANIM_OT_keyframe_insert(), and ANIM_OT_keyframe_insert_menu().
Check if KeyingSet can be used in the current context.
Definition at line 716 of file editors/animation/keyingsets.cc.
References ANIM_keyingset_context_ok_poll(), C, KeyingSet::flag, KEYINGSET_ABSOLUTE, blender::animrig::keyingset_info_find_name(), KeyingSetInfo::poll, and KeyingSet::typeinfo.
Referenced by ANIM_keyingset_context_ok_poll(), anim_keyingset_visit_for_search_impl(), and build_keyingset_enum().
Get the keying set from enum values generated in ANIM_keying_sets_enum_itemf.
Type is the Keying Set the user specified to use when calling the operator:
| type |
Definition at line 687 of file editors/animation/keyingsets.cc.
References Scene::active_keyingset, ANIM_keyingset_get_from_enum_type(), BLI_findlink(), builtin_keyingsets, and Scene::keyingsets.
Referenced by ANIM_keyingset_get_from_enum_type(), insert_key_exec(), and keyingset_get_from_op_with_error().
Definition at line 700 of file editors/animation/keyingsets.cc.
References ANIM_keyingset_get_from_idname(), BLI_findstring(), builtin_keyingsets, Scene::keyingsets, and offsetof.
Referenced by ANIM_keyingset_get_from_idname(), and keyingset_get_from_op_with_error().
| void ANIM_keyingset_visit_for_search | ( | const bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| const char * | edit_text, | ||
| blender::FunctionRef< void(StringPropertySearchVisitParams)> | visit_fn ) |
Definition at line 635 of file editors/animation/keyingsets.cc.
References ANIM_keyingset_visit_for_search(), anim_keyingset_visit_for_search_impl(), and C.
Referenced by ANIM_keyingset_visit_for_search().
| void ANIM_keyingset_visit_for_search_no_poll | ( | const bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| const char * | edit_text, | ||
| blender::FunctionRef< void(StringPropertySearchVisitParams)> | visit_fn ) |
Definition at line 645 of file editors/animation/keyingsets.cc.
References anim_keyingset_visit_for_search_impl(), ANIM_keyingset_visit_for_search_no_poll(), and C.
Referenced by ANIM_keyingset_visit_for_search_no_poll(), ANIM_OT_keyframe_delete_by_name(), and ANIM_OT_keyframe_insert_by_name().
| bool ANIM_paste_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block or replace an existing one with the driver + driver-curve data from the buffer.
Definition at line 627 of file drivers.cc.
References ANIM_paste_driver(), FCurve::bezt, BKE_report(), BKE_reportf(), channeldriver_copypaste_buf, copy_fmodifiers(), FCurve::driver, DRIVER_FCURVE_EMPTY, FCurve::extend, fcurve_copy_driver(), FCurve::fpt, MEM_dupallocN(), FCurve::modifiers, ID::name, reports, RNA_id_pointer_create(), RNA_path_resolve_property(), RPT_ERROR, FCurve::totvert, and verify_driver_fcurve().
Referenced by ANIM_paste_driver(), and paste_driver_button_exec().
| bool ANIM_remove_driver | ( | ID * | id, |
| const char | rna_path[], | ||
| int | array_index ) |
Main Driver Management API calls.
Remove the driver for the specified property on the given ID block.
Definition at line 522 of file drivers.cc.
References ANIM_remove_driver(), BKE_animdata_from_id(), BKE_fcurve_free(), BKE_fcurve_iter_step(), BLI_remlink(), DRIVER_FCURVE_LOOKUP_ONLY, AnimData::drivers, ListBase::first, FCurve::next, and verify_driver_fcurve().
Referenced by ANIM_remove_driver(), blender::ed::outliner::do_outliner_drivers_editop(), graph_driver_delete_invalid_exec(), pyrna_struct_driver_remove(), and remove_driver_button_exec().
Get the index of the Keying Set provided, for the given Scene.
Definition at line 559 of file editors/animation/keyingsets.cc.
References ANIM_scene_get_keyingset_index(), BLI_findindex(), builtin_keyingsets, and Scene::keyingsets.
Referenced by ANIM_scene_get_keyingset_index().
| void ED_keyframes_add | ( | FCurve * | fcu, |
| int | num_keys_to_add ) |
Add the given number of keyframes to the FCurve. Their coordinates are uninitialized, so the curve should not be used without further attention.
The newly created keys are selected, existing keys are not touched.
This can be used to allocate all the keys at once, and then update them afterwards.
Definition at line 114 of file editors/animation/keyframing.cc.
References FCurve::bezt, BEZT_IPO_BEZ, BLI_assert_msg, ED_keyframes_add(), BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, BezTriple::ipo, MEM_recallocN, SELECT, and FCurve::totvert.
Referenced by ED_keyframes_add(), and blender::bke::tests::testcurve_with_duplicates().
| bool fcurve_is_changed | ( | PointerRNA | ptr, |
| PropertyRNA * | prop, | ||
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Lesser Keyframe Checking API call.
Definition at line 1304 of file editors/animation/keyframing.cc.
References FCurve::array_index, calculate_fcurve(), compare_ff_relative(), fcurve_is_changed(), blender::animrig::get_rna_values(), PathResolvedRNA::prop, PathResolvedRNA::prop_index, PathResolvedRNA::ptr, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by fcurve_is_changed(), and ui_but_anim_flag().
| void update_autoflags_fcurve | ( | FCurve * | fcu, |
| bContext * | C, | ||
| ReportList * | reports, | ||
| PointerRNA * | ptr ) |
Lesser Key-framing API call.
Update integer/discrete flags of the FCurve (used when creating/inserting keyframes, but also through RNA when editing an ID prop, see #37103).
Definition at line 78 of file editors/animation/keyframing.cc.
References BKE_report(), BKE_reportf(), C, PointerRNA::data, FCurve::flag, NA_EDITED, ID::name, NC_ANIMATION, ND_KEYFRAME, PointerRNA::owner_id, reports, FCurve::rna_path, RNA_path_resolve_property(), RNA_property_type(), RPT_, RPT_ERROR, update_autoflags_fcurve(), blender::animrig::update_autoflags_fcurve_direct(), and WM_event_add_notifier().
Referenced by update_autoflags_fcurve().
| FCurve * verify_driver_fcurve | ( | ID * | id, |
| const char | rna_path[], | ||
| int | array_index, | ||
| eDriverFCurveCreationMode | creation_mode ) |
Get (or add relevant data to be able to do so) F-Curve from the driver stack, for the given Animation Data block. This assumes that all the destinations are valid.
Definition at line 50 of file drivers.cc.
References alloc_driver_fcurve(), BKE_animdata_ensure_id(), BKE_animdata_from_id(), BKE_fcurve_find(), BLI_addtail(), DRIVER_FCURVE_LOOKUP_ONLY, AnimData::drivers, ELEM, and verify_driver_fcurve().
Referenced by add_driver_with_target(), ANIM_add_driver(), ANIM_copy_driver(), ANIM_paste_driver(), ANIM_remove_driver(), ui_but_anim_expression_create(), and verify_driver_fcurve().
|
extern |
Mapping Types enum for operators.
Definition at line 827 of file drivers.cc.
Referenced by ANIM_OT_driver_button_add_menu(), driver_mapping_type_itemf(), and UI_OT_eyedropper_driver().